AP_Bootloader: free few bytes of flash as bootloader build overflew on devices with 16k flash

This commit is contained in:
bugobliterator 2021-05-15 16:05:26 +05:30 committed by Andrew Tridgell
parent 017b267fee
commit 23757c249e

View File

@ -37,7 +37,11 @@ extern "C" {
int main(void);
}
struct boardinfo board_info;
struct boardinfo board_info = {
.board_type = APJ_BOARD_ID,
.board_rev = 0,
.fw_size = (BOARD_FLASH_SIZE - (FLASH_BOOTLOADER_LOAD_KB + FLASH_RESERVE_END_KB + APP_START_OFFSET_KB))*1024
};
#ifndef HAL_BOOTLOADER_TIMEOUT
#define HAL_BOOTLOADER_TIMEOUT 5000
@ -49,9 +53,6 @@ struct boardinfo board_info;
int main(void)
{
board_info.board_type = APJ_BOARD_ID;
board_info.board_rev = 0;
board_info.fw_size = (BOARD_FLASH_SIZE - (FLASH_BOOTLOADER_LOAD_KB + FLASH_RESERVE_END_KB + APP_START_OFFSET_KB))*1024;
if (BOARD_FLASH_SIZE > 1024 && check_limit_flash_1M()) {
board_info.fw_size = (1024 - (FLASH_BOOTLOADER_LOAD_KB + APP_START_OFFSET_KB))*1024;
}