diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct index e33232db83..d9d270be29 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct @@ -10,12 +10,14 @@ #endif /* If softdevice is present, set aside space for it */ -#if defined(SOFTDEVICE_PRESENT) - #define MBED_RAM_START 0x200031D0 - #define MBED_RAM_SIZE 0xCE30 -#else - #define MBED_RAM_START 0x20000000 - #define MBED_RAM_SIZE 0x10000 +#if !defined(MBED_RAM_START) + #if defined(SOFTDEVICE_PRESENT) + #define MBED_RAM_START 0x200031D0 + #define MBED_RAM_SIZE 0xCE30 + #else + #define MBED_RAM_START 0x20000000 + #define MBED_RAM_SIZE 0x10000 + #endif #endif #define MBED_RAM0_START MBED_RAM_START diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_GCC_ARM/NRF52832.ld b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_GCC_ARM/NRF52832.ld index 1d2bdfc7df..b793baf3c9 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_GCC_ARM/NRF52832.ld +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_GCC_ARM/NRF52832.ld @@ -26,12 +26,14 @@ #endif /* If softdevice is present, set aside space for it */ -#if defined(SOFTDEVICE_PRESENT) - #define MBED_RAM_START 0x200031D0 - #define MBED_RAM_SIZE 0xCE30 -#else - #define MBED_RAM_START 0x20000000 - #define MBED_RAM_SIZE 0x10000 +#if !defined(MBED_RAM_START) + #if defined(SOFTDEVICE_PRESENT) + #define MBED_RAM_START 0x200031D0 + #define MBED_RAM_SIZE 0xCE30 + #else + #define MBED_RAM_START 0x20000000 + #define MBED_RAM_SIZE 0x10000 + #endif #endif #define MBED_RAM0_START MBED_RAM_START @@ -189,7 +191,7 @@ SECTIONS PROVIDE(__start_fs_data = .); KEEP(*(.fs_data)) PROVIDE(__stop_fs_data = .); - + *(.jcr) . = ALIGN(4); /* All data end */ diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf index de450f5516..03789113c1 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf @@ -12,12 +12,14 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) { } /* If softdevice is present, set aside space for it */ -if (isdefinedsymbol(SOFTDEVICE_PRESENT)) { - define symbol MBED_RAM_START = 0x200031D0; - define symbol MBED_RAM_SIZE = 0xCE30; -} else { - define symbol MBED_RAM_START = 0x20000000; - define symbol MBED_RAM_SIZE = 0x10000; +if (!isdefinedsymbol(MBED_RAM_START)) { + if (isdefinedsymbol(SOFTDEVICE_PRESENT)) { + define symbol MBED_RAM_START = 0x200031D0; + define symbol MBED_RAM_SIZE = 0xCE30; + } else { + define symbol MBED_RAM_START = 0x20000000; + define symbol MBED_RAM_SIZE = 0x10000; + } } define symbol MBED_RAM0_START = MBED_RAM_START; diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct index 5c61eecdfc..da9be7a8d5 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct @@ -9,13 +9,15 @@ #define MBED_APP_SIZE 0x100000 #endif -/* If app_start is 0, do not set aside space for the softdevice */ -#if MBED_APP_START == 0 - #define MBED_RAM_START 0x20000000 - #define MBED_RAM_SIZE 0x40000 -#else - #define MBED_RAM_START 0x20003188 - #define MBED_RAM_SIZE 0x3CE78 +/* If softdevice is present, set aside space for it */ +#if !defined(MBED_RAM_START) + #if defined(SOFTDEVICE_PRESENT) + #define MBED_RAM_START 0x20003188 + #define MBED_RAM_SIZE 0x3CE78 + #else + #define MBED_RAM_START 0x20000000 + #define MBED_RAM_SIZE 0x40000 + #endif #endif #define MBED_RAM0_START MBED_RAM_START diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld index e42984a874..f496331aa3 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld @@ -25,13 +25,15 @@ #define MBED_APP_SIZE 0x100000 #endif -/* If app_start is 0, do not set aside space for the softdevice */ -#if MBED_APP_START == 0 - #define MBED_RAM_START 0x20000000 - #define MBED_RAM_SIZE 0x40000 -#else - #define MBED_RAM_START 0x20003188 - #define MBED_RAM_SIZE 0x3CE78 +/* If softdevice is present, set aside space for it */ +#if !defined(MBED_RAM_START) + #if defined(SOFTDEVICE_PRESENT) + #define MBED_RAM_START 0x20003188 + #define MBED_RAM_SIZE 0x3CE78 + #else + #define MBED_RAM_START 0x20000000 + #define MBED_RAM_SIZE 0x40000 + #endif #endif #define MBED_RAM0_START MBED_RAM_START diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf index 522e1f5a33..c681e88e5a 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf @@ -11,13 +11,15 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x100000; } -/* If app_start is 0, do not set aside space for the softdevice */ -if (MBED_APP_START == 0) { - define symbol MBED_RAM_START = 0x20000000; - define symbol MBED_RAM_SIZE = 0x40000; -} else { - define symbol MBED_RAM_START = 0x20003188; - define symbol MBED_RAM_SIZE = 0x3CE78; +/* If softdevice is present, set aside space for it */ +if (!isdefinedsymbol(MBED_RAM_START)) { + if (isdefinedsymbol(SOFTDEVICE_PRESENT)) { + define symbol MBED_RAM_START = 0x20003188; + define symbol MBED_RAM_SIZE = 0x3CE78; + } else { + define symbol MBED_RAM_START = 0x20000000; + define symbol MBED_RAM_SIZE = 0x40000; + } } define symbol MBED_RAM0_START = MBED_RAM_START;