Skip to content

Commit

Permalink
AP_Bootloader: add support for running from external flash
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator authored and tridge committed Sep 1, 2021
1 parent 35df1b1 commit fc4be36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tools/AP_Bootloader/bl_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit fc4be36

Please sign in to comment.