From 5601fc93971d958b9e6087764ca6664e5f1c7558 Mon Sep 17 00:00:00 2001 From: Glenn Ruben Bakke Date: Sat, 25 Nov 2017 01:43:23 +0100 Subject: [PATCH] nrf/boards/microbit: Move microbit target to custom linker script. To use if BLE stack is enabled. The custom linker script also set off space enough to compile in microbitfs+hal_nvmc. --- .../microbit/custom_nrf51822_s110_microbit.ld | 28 +++++++++++++++++++ .../nrf/boards/microbit/mpconfigboard_s110.mk | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 ports/nrf/boards/microbit/custom_nrf51822_s110_microbit.ld diff --git a/ports/nrf/boards/microbit/custom_nrf51822_s110_microbit.ld b/ports/nrf/boards/microbit/custom_nrf51822_s110_microbit.ld new file mode 100644 index 0000000000..71d57aeb02 --- /dev/null +++ b/ports/nrf/boards/microbit/custom_nrf51822_s110_microbit.ld @@ -0,0 +1,28 @@ +/* + GNU linker script for NRF51822 AA w/ S110 8.0.0 SoftDevice +*/ +/* Specify the memory areas */ +SEARCH_DIR(.) +GROUP(-lgcc -lc -lnosys) +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ + FLASH_TEXT (rx) : ORIGIN = 0x00018000, LENGTH = 148K /* app */ + FLASH_USER (rx) : ORIGIN = 0x0003D000, LENGTH = 12K /* app data, filesystem */ + RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 8K /* app RAM */ +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 2K; +_minimum_heap_size = 1K; + +/* top end of the stack */ + +/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_end = ORIGIN(RAM) + LENGTH(RAM); +_heap_end = 0x20003c00; /* tunable */ + +INCLUDE "boards/common.ld" diff --git a/ports/nrf/boards/microbit/mpconfigboard_s110.mk b/ports/nrf/boards/microbit/mpconfigboard_s110.mk index d638b06095..efda6a0a2d 100644 --- a/ports/nrf/boards/microbit/mpconfigboard_s110.mk +++ b/ports/nrf/boards/microbit/mpconfigboard_s110.mk @@ -2,7 +2,7 @@ MCU_SERIES = m0 MCU_VARIANT = nrf51 MCU_SUB_VARIANT = nrf51822 SOFTDEV_VERSION = 8.0.0 -LD_FILE = boards/nrf51x22_256k_16k_s110_$(SOFTDEV_VERSION).ld +LD_FILE = boards/microbit/custom_nrf51822_s110_microbit.ld FLASHER = pyocd CFLAGS += -DBLUETOOTH_LFCLK_RC