From ba78401609b69a3f0841fc546ed20933e63c1c0f Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 27 Aug 2023 16:07:26 -0700 Subject: [PATCH] dynamic bootloader size --- firmware/bootloader/openblt_chibios/openblt_flash.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/bootloader/openblt_chibios/openblt_flash.cpp b/firmware/bootloader/openblt_chibios/openblt_flash.cpp index 934b35f95c..91bea717e6 100644 --- a/firmware/bootloader/openblt_chibios/openblt_flash.cpp +++ b/firmware/bootloader/openblt_chibios/openblt_flash.cpp @@ -13,8 +13,11 @@ blt_bool FlashVerifyChecksum() { return intFlashIsErased(FlashGetUserProgBaseAddress(), 4) ? BLT_FALSE : BLT_TRUE; } +// Bootloader size imported from the linker script +extern uint32_t bootloader_size; + blt_addr FlashGetUserProgBaseAddress() { - return 0x08008000; + return 0x08000000 + bootloader_size; } blt_bool FlashWrite(blt_addr addr, blt_int32u len, blt_int8u *data) {