summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Cross <sean@xobs.io>2020-04-21 11:13:58 +0800
committerSean Cross <sean@xobs.io>2020-04-21 12:29:58 +0800
commit3537ad40594b3d23785108475be571c6fa92e769 (patch)
tree544ba1e87a991ebda9cf04c144cca9b57b8a815b
parent33720af0c6b13e974fdf3246d87ad66082977a46 (diff)
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 <sean@xobs.io>
-rw-r--r--ports/nrf/mpconfigport.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h
index 5fdc0f019..1f10f5e7e 100644
--- a/ports/nrf/mpconfigport.h
+++ b/ports/nrf/mpconfigport.h
@@ -36,7 +36,9 @@
// Max RAM used by SoftDevice. Can be changed when SoftDevice parameters are changed.
// See common.template.ld.
+#ifndef SOFTDEVICE_RAM_SIZE
#define SOFTDEVICE_RAM_SIZE (64*1024)
+#endif
#ifdef NRF52840
#define MICROPY_PY_SYS_PLATFORM "nRF52840"
@@ -53,8 +55,10 @@
#define RAM_SIZE (0x20000) // 128 KiB
// Special RAM area for SPIM3 transmit buffer, to work around hardware bug.
// See common.template.ld.
+#ifndef SPIM3_BUFFER_SIZE
#define SPIM3_BUFFER_SIZE (8192)
#endif
+#endif
#define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1)
#define MICROPY_PY_FUNCTION_ATTRS (1)
@@ -124,7 +128,9 @@
// Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld
#define BOOTLOADER_START_ADDR (FLASH_SIZE - BOOTLOADER_SIZE - BOOTLOADER_SETTINGS_SIZE - BOOTLOADER_MBR_SIZE)
#define BOOTLOADER_MBR_SIZE (0x1000) // 4kib
+#ifndef BOOTLOADER_SIZE
#define BOOTLOADER_SIZE (0xA000) // 40kiB
+#endif
#define BOOTLOADER_SETTINGS_START_ADDR (FLASH_SIZE - BOOTLOADER_SETTINGS_SIZE)
#define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB
@@ -137,7 +143,9 @@
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE)
// 32kiB for bonding, etc.
+#ifndef CIRCUITPY_BLE_CONFIG_SIZE
#define CIRCUITPY_BLE_CONFIG_SIZE (32*1024)
+#endif
#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.