Skip to content

Commit e11fabd

Browse files
committed
moved nrf internal filesystem to just below bootloader
1 parent 8176325 commit e11fabd

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

ports/atmel-samd/mpconfigport.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@
151151

152152
// Flash layout, starting at 0x00000000
153153
//
154-
// bootloader (8 or 16kB)
155-
// firmware
156-
// internal CIRCUITPY flash filesystem (optional)
157-
// internal config, used to store crystalless clock calibration info (optional)
158-
// microntroller.nvm (optional)
154+
// - bootloader (8 or 16kB)
155+
// - firmware
156+
// - internal CIRCUITPY flash filesystem (optional)
157+
// - internal config, used to store crystalless clock calibration info (optional)
158+
// - microntroller.nvm (optional)
159159

160160
// Define these regions starting up from the bottom of flash:
161161

ports/nrf/boards/common.template.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ MEMORY
1111
FLASH_SD (rx) : ORIGIN = ${SD_FLASH_START_ADDR}, LENGTH = ${SD_FLASH_SIZE}
1212
FLASH_ISR (rx) : ORIGIN = ${ISR_START_ADDR}, LENGTH = ${ISR_SIZE}
1313
FLASH_FIRMWARE (rx) : ORIGIN = ${CIRCUITPY_FIRMWARE_START_ADDR}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE}
14-
FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE}
1514
FLASH_BLE_CONFIG (r) : ORIGIN = ${CIRCUITPY_BLE_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_BLE_CONFIG_SIZE}
1615
FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE}
16+
FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE}
1717
FLASH_BOOTLOADER (rx) : ORIGIN = ${BOOTLOADER_START_ADDR}, LENGTH = ${BOOTLOADER_SIZE}
1818
FLASH_BOOTLOADER_SETTINGS (r) : ORIGIN = ${BOOTLOADER_SETTINGS_START_ADDR}, LENGTH = ${BOOTLOADER_SETTINGS_SIZE}
1919
RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x03C000 /* 240 KiB */

ports/nrf/mpconfigport.h

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,16 @@
7676

7777
// Flash layout, starting at 0x00000000
7878
//
79-
// SoftDevice
80-
// ISR
81-
// firmware
82-
// internal CIRCUITPY flash filesystem (optional)
83-
// BLE config (bonding info, etc.) (optional)
84-
// microcontroller.nvm (optional)
85-
// bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash)
86-
// bootloader settings
79+
// - SoftDevice
80+
// - ISR
81+
// - firmware
82+
// - BLE config (bonding info, etc.) (optional)
83+
// - microcontroller.nvm (optional)
84+
// - internal CIRCUITPY flash filesystem (optional)
85+
// The flash filesystem is adjacent to the bootloader, so that its location will not change even if
86+
// other regions change in size.
87+
// - bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash)
88+
// - bootloader settings
8789

8890
// Define these regions starting up from the bottom of flash:
8991

@@ -105,14 +107,18 @@
105107
#define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000)
106108
#define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB
107109

108-
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE)
110+
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE)
111+
112+
#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE > 0 && CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR != (BOOTLOADER_START_ADDR - 256*1024)
113+
#warning Internal flash filesystem location has moved!
114+
#endif
115+
116+
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE)
109117

110118
// 32kiB for bonding, etc.
111119
#define CIRCUITPY_BLE_CONFIG_SIZE (32*1024)
112120
#define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE)
113121

114-
#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE)
115-
116122
// The firmware space is the space left over between the fixed lower and upper regions.
117123
#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR)
118124

0 commit comments

Comments
 (0)