Skip to content

Commit ad68c17

Browse files
committed
EFM32GG: 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 ad68c17

File tree

1 file changed

+4
-2
lines changed
  • targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_ARM_MICRO

1 file changed

+4
-2
lines changed

targets/TARGET_Silicon_Labs/TARGET_EFM32/TARGET_EFM32GG/device/TARGET_1024K/TOOLCHAIN_ARM_MICRO/efm32gg.sct

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

3333
#define RAM_FIXED_SIZE (MBED_CONF_TARGET_BOOT_STACK_SIZE+VECTOR_SIZE)
3434

35+
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
36+
3537
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3638

3739
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
@@ -40,11 +42,11 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
4042
.ANY (+RO)
4143
}
4244

43-
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE) { ; RW data
45+
RW_IRAM1 MBED_RAM1_START (MBED_RAM_SIZE-VECTOR_SIZE) { ; RW data
4446
.ANY (+RW +ZI)
4547
}
4648

47-
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16) - MBED_CONF_TARGET_BOOT_STACK_SIZE) {
49+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM1_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) {
4850
}
4951

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

0 commit comments

Comments
 (0)