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.
pull/13951/head
Lingkai Dong 2020-11-23 18:00:47 +00:00
parent f2278567d0
commit b174edb282
1 changed files with 5 additions and 4 deletions

View File

@ -26,22 +26,23 @@
#define MBED_RAM0_START MBED_RAM_START
#define MBED_RAM0_SIZE 0xE0
#define MBED_RAM1_START (MBED_RAM_START + MBED_RAM0_SIZE)
#define MBED_RAM1_START (MBED_RAM0_START + MBED_RAM0_SIZE)
#define MBED_RAM1_SIZE (MBED_RAM_SIZE - MBED_RAM0_SIZE)
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
*.o (RESET, +First)
*(InRoot$$Sections)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM0 MBED_RAM0_START UNINIT MBED_RAM0_SIZE { ;no init section
*(*nvictable)
}
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE {
.ANY (+RW +ZI)
}
ARM_LIB_STACK MBED_RAM1_START+MBED_RAM1_SIZE EMPTY -Stack_Size { ; Stack region growing down
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM1_START + MBED_RAM1_SIZE - MBED_CONF_TARGET_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
}
ARM_LIB_STACK MBED_RAM1_START + MBED_RAM1_SIZE EMPTY - Stack_Size { ; Stack region growing down
}
}