AP_Bootloader: add support for running from external flash

This commit is contained in:
Siddharth Purohit 2021-06-13 18:13:23 +05:30 committed by Andrew Tridgell
parent 35df1b1bd3
commit fc4be3695f
1 changed files with 8 additions and 0 deletions

View File

@ -251,9 +251,11 @@ jump_to_app()
return;
}
#if !EXTERNAL_PROG_FLASH_MB // its very likely to happen when using external flash
if (app_base[1] >= (APP_START_ADDRESS + board_info.fw_size)) {
return;
}
#endif
#if HAL_USE_CAN == TRUE || HAL_NUM_CAN_IFACES
// for CAN firmware we start the watchdog before we run the
@ -271,6 +273,12 @@ jump_to_app()
led_set(LED_OFF);
// If we have QSPI chip start it
uint8_t* ext_flash_start_addr;
if (!ext_flash.start_xip_mode((void**)&ext_flash_start_addr)) {
return;
}
// resetting the clocks is needed for loading NuttX
#if defined(STM32H7)
rccDisableAPB1L(~0);