From f00aeea70f746c025602d6b215365cc80a14b9e7 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 8 Jan 2021 18:37:03 +0000 Subject: [PATCH] Apollo3: Fix heap size formula and stack start address in scatter file The heapsize 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. The stack start address should be the top of the RAM which is also fixed. --- .../TARGET_Apollo3/TOOLCHAIN_ARM_STD/AMA3B1KK.sct | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TOOLCHAIN_ARM_STD/AMA3B1KK.sct b/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TOOLCHAIN_ARM_STD/AMA3B1KK.sct index 67fb5a5f8b..cc2bc7e7d6 100644 --- a/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TOOLCHAIN_ARM_STD/AMA3B1KK.sct +++ b/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/TOOLCHAIN_ARM_STD/AMA3B1KK.sct @@ -56,8 +56,8 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE { .ANY (+RW +ZI) } - ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { + ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM1_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { } - ARM_LIB_STACK MBED_RAM1_START+MBED_RAM1_SIZE-8 EMPTY -Stack_Size { ; Stack region growing down + ARM_LIB_STACK MBED_RAM1_START+MBED_RAM1_SIZE EMPTY -Stack_Size { ; Stack region growing down } }