Skip to content

Commit

Permalink
dynamic bootloader size
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Aug 27, 2023
1 parent 717aae8 commit ba78401
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion firmware/bootloader/openblt_chibios/openblt_flash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ba78401

Please sign in to comment.