Skip to content

Commit 4780dd5

Browse files
committed
NRF52840: 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 4780dd5

File tree

1 file changed

+1
-1
lines changed
  • targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD

1 file changed

+1
-1
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE {
5050
RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE {
5151
.ANY (+RW +ZI)
5252
}
53-
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE + MBED_RAM_START - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
53+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE - RAM_FIXED_SIZE + MBED_RAM1_START - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
5454
}
5555
ARM_LIB_STACK MBED_RAM1_START + MBED_RAM1_SIZE EMPTY - Stack_Size { ; Stack region growing down
5656
}

0 commit comments

Comments
 (0)