Skip to content

Commit 3957519

Browse files
committed
MCU_NRF52832: use two-region memory layout (stack + heap) to support MicroLib
MicroLib is the lightweight C lib for the Arm toolchain and used as the default C lib on bare metal builds with the Arm toolchain. It requires two separate memory regions for stack and heap. The change is based on nRF52840.sct.
1 parent f227856 commit 3957519

File tree

1 file changed

+6
-4
lines changed
  • targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD

1 file changed

+6
-4
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,24 @@
2626

2727
#define MBED_RAM0_START MBED_RAM_START
2828
#define MBED_RAM0_SIZE 0xE0
29-
#define MBED_RAM1_START (MBED_RAM_START + MBED_RAM0_SIZE)
29+
#define MBED_RAM1_START (MBED_RAM0_START + MBED_RAM0_SIZE)
3030
#define MBED_RAM1_SIZE (MBED_RAM_SIZE - MBED_RAM0_SIZE)
31+
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE + MBED_RAM0_SIZE)
3132

3233
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
3334
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
3435
*.o (RESET, +First)
35-
*(InRoot$$Sections)
36+
*(InRoot$$Sections)
3637
.ANY (+RO)
3738
}
38-
3939
RW_IRAM0 MBED_RAM0_START UNINIT MBED_RAM0_SIZE { ;no init section
4040
*(*nvictable)
4141
}
4242
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE {
4343
.ANY (+RW +ZI)
4444
}
45-
ARM_LIB_STACK MBED_RAM1_START+MBED_RAM1_SIZE EMPTY -Stack_Size { ; Stack region growing down
45+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE + MBED_RAM_START - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
46+
}
47+
ARM_LIB_STACK MBED_RAM1_START + MBED_RAM1_SIZE EMPTY - Stack_Size { ; Stack region growing down
4648
}
4749
}

0 commit comments

Comments
 (0)