summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Cross <sean@xobs.io>2020-04-21 11:09:43 +0800
committerSean Cross <sean@xobs.io>2020-04-21 12:29:57 +0800
commit33720af0c6b13e974fdf3246d87ad66082977a46 (patch)
treead91566ae353a35b35d730ad54d5e56b789ba89c
parent3ed5b87b8fea218c0485282ed1cf9fdf5a6f687f (diff)
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 <sean@xobs.io>
-rw-r--r--ports/nrf/mpconfigport.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index 464a0b3bd..5fdc0f019 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -141,7 +141,7 @@
#define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE)
// The firmware space is the space left over between the fixed lower and upper regions.
-#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR)
+#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE)
#if BOOTLOADER_START_ADDR % FLASH_ERASE_SIZE != 0
#error BOOTLOADER_START_ADDR must be on a flash erase boundary.