Browse Source

AP_Bootloader: support building on STM32H7

mission-4.1.18
Andrew Tridgell 6 years ago
parent
commit
4d3cbd95ac
  1. 5
      Tools/AP_Bootloader/bl_protocol.cpp
  2. 17
      Tools/AP_Bootloader/mcu_h7.h
  3. 5
      Tools/AP_Bootloader/support.cpp

5
Tools/AP_Bootloader/bl_protocol.cpp

@ -222,7 +222,12 @@ jump_to_app() @@ -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();

17
Tools/AP_Bootloader/mcu_h7.h

@ -0,0 +1,17 @@ @@ -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

5
Tools/AP_Bootloader/support.cpp

@ -12,6 +12,7 @@ @@ -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) @@ -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) @@ -122,6 +126,7 @@ uint32_t flash_func_read_otp(uint32_t idx)
}
return *(uint32_t *)(idx + OTP_BASE);
#endif
}
// read chip serial number

Loading…
Cancel
Save