Skip to content

Commit 15d9aa5

Browse files
committed
nrf: mpconfigport: support configuration of various sizes
Conditionally set variables such as the softdevice RAM size, bootloader size, and the spi m3 buffer size. This allows ports to adjust these values to suit their needs. Signed-off-by: Sean Cross <[email protected]>
1 parent a653a7c commit 15d9aa5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/nrf/mpconfigport.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636

3737
// Max RAM used by SoftDevice. Can be changed when SoftDevice parameters are changed.
3838
// See common.template.ld.
39+
#ifndef SOFTDEVICE_RAM_SIZE
3940
#define SOFTDEVICE_RAM_SIZE (64*1024)
41+
#endif
4042

4143
#ifdef NRF52840
4244
#define MICROPY_PY_SYS_PLATFORM "nRF52840"
@@ -53,8 +55,10 @@
5355
#define RAM_SIZE (0x20000) // 128 KiB
5456
// Special RAM area for SPIM3 transmit buffer, to work around hardware bug.
5557
// See common.template.ld.
58+
#ifndef SPIM3_BUFFER_SIZE
5659
#define SPIM3_BUFFER_SIZE (8192)
5760
#endif
61+
#endif
5862

5963
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
6064
#define MICROPY_PY_FUNCTION_ATTRS (1)
@@ -124,7 +128,9 @@
124128
// Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld
125129
#define BOOTLOADER_START_ADDR (FLASH_SIZE - BOOTLOADER_SIZE - BOOTLOADER_SETTINGS_SIZE - BOOTLOADER_MBR_SIZE)
126130
#define BOOTLOADER_MBR_SIZE (0x1000) // 4kib
131+
#ifndef BOOTLOADER_SIZE
127132
#define BOOTLOADER_SIZE (0xA000) // 40kiB
133+
#endif
128134
#define BOOTLOADER_SETTINGS_START_ADDR (FLASH_SIZE - BOOTLOADER_SETTINGS_SIZE)
129135
#define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB
130136

@@ -137,7 +143,9 @@
137143
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE)
138144

139145
// 32kiB for bonding, etc.
146+
#ifndef CIRCUITPY_BLE_CONFIG_SIZE
140147
#define CIRCUITPY_BLE_CONFIG_SIZE (32*1024)
148+
#endif
141149
#define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE)
142150

143151
// The firmware space is the space left over between the fixed lower and upper regions.

0 commit comments

Comments
 (0)