Skip to content

Commit 7d810e3

Browse files
committed
nrf: mpconfigport: subtract config size from firmware size
The BLE Config area needs to be subtracted from the size of the firmware. THis is because the firmware is counted by walking backwards from the end of memory, and the BLE config area is placed lower in memory than the firmware. Subtracting the BLE config size ensures the internal flash filesystem doesn't try to use the firmware as storage. Signed-off-by: Sean Cross <[email protected]>
1 parent 1802bd8 commit 7d810e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/nrf/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
#define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE)
142142

143143
// The firmware space is the space left over between the fixed lower and upper regions.
144-
#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR)
144+
#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE)
145145

146146
#if BOOTLOADER_START_ADDR % FLASH_ERASE_SIZE != 0
147147
#error BOOTLOADER_START_ADDR must be on a flash erase boundary.

0 commit comments

Comments
 (0)