Skip to content

Commit 96dbb42

Browse files
committed
MUSCA_B1: Fix heap size formula in scatter files
The heap size was incorrectly calculated. This fixes it by subtracting the Stack size, any memory chunks allocated before the start of the application (for vectors and/or crash report), and finally the size of the application from the total RAM size.
1 parent e917282 commit 96dbb42

File tree

1 file changed

+4
-2
lines changed
  • targets/TARGET_ARM_SSG/TARGET_MUSCA_B1/device/TOOLCHAIN_ARMC6

1 file changed

+4
-2
lines changed

targets/TARGET_ARM_SSG/TARGET_MUSCA_B1/device/TOOLCHAIN_ARMC6/musca_ns.sct

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939

4040
#define VECTOR_SIZE NVIC_RAM_VECTOR_SIZE
4141

42+
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
43+
4244
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
4345
# if defined(MBED_BOOT_STACK_SIZE)
4446
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
@@ -55,12 +57,12 @@ LR_CODE MBED_ROM_START MBED_ROM_SIZE {
5557
.ANY (+RO)
5658
}
5759

58-
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE) {
60+
RW_IRAM1 MBED_RAM1_START (MBED_RAM_SIZE-VECTOR_SIZE) {
5961
* (+RW) ; RW data that gets copied from Flash to SRAM
6062
* (+ZI) ; ZI data that gets initialised to zero in SRAM
6163
}
6264

63-
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
65+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM1_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
6466
}
6567

6668
ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; stack

0 commit comments

Comments
 (0)