AP_Bootloader: support building on STM32H7

This commit is contained in:
Andrew Tridgell 2019-02-03 20:23:56 +11:00
parent aab911ac50
commit 4d3cbd95ac
3 changed files with 27 additions and 0 deletions

View File

@ -222,7 +222,12 @@ jump_to_app()
led_set(LED_OFF);
// resetting the clocks is needed for loading NuttX
#if defined(STM32H7)
rccDisableAPB1L(~0);
rccDisableAPB1H(~0);
#else
rccDisableAPB1(~0);
#endif
rccDisableAPB2(~0);
#if HAL_USE_SERIAL_USB == TRUE
rccResetOTG_FS();

View File

@ -0,0 +1,17 @@
/*
MCU tables for STM32H7
*/
#if defined(STM32H7)
#define STM32_UNKNOWN 0
mcu_des_t mcu_descriptions[] = {
{ STM32_UNKNOWN, "STM32H7?????", '?'},
};
const mcu_rev_t silicon_revs[] = {
};
#endif // STM32H7

View File

@ -12,6 +12,7 @@
#include "support.h"
#include "mcu_f4.h"
#include "mcu_f7.h"
#include "mcu_h7.h"
static BaseChannel *uarts[] = { BOOTLOADER_DEV_LIST };
#if HAL_USE_SERIAL == TRUE
@ -113,6 +114,9 @@ void flash_func_erase_sector(uint32_t sector)
// read one-time programmable memory
uint32_t flash_func_read_otp(uint32_t idx)
{
#ifndef OTP_SIZE
return 0;
#else
if (idx & 3) {
return 0;
}
@ -122,6 +126,7 @@ uint32_t flash_func_read_otp(uint32_t idx)
}
return *(uint32_t *)(idx + OTP_BASE);
#endif
}
// read chip serial number