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.
pull/14131/head
Hugues Kamba 2021-01-08 18:35:33 +00:00
parent e917282d60
commit 96dbb42024
1 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,8 @@
#define VECTOR_SIZE NVIC_RAM_VECTOR_SIZE #define VECTOR_SIZE NVIC_RAM_VECTOR_SIZE
#define MBED_RAM1_START (MBED_RAM_START+VECTOR_SIZE)
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE) #if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE) # if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE # define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
@ -55,12 +57,12 @@ LR_CODE MBED_ROM_START MBED_ROM_SIZE {
.ANY (+RO) .ANY (+RO)
} }
RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE) { RW_IRAM1 MBED_RAM1_START (MBED_RAM_SIZE-VECTOR_SIZE) {
* (+RW) ; RW data that gets copied from Flash to SRAM * (+RW) ; RW data that gets copied from Flash to SRAM
* (+ZI) ; ZI data that gets initialised to zero in SRAM * (+ZI) ; ZI data that gets initialised to zero in SRAM
} }
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_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; stack ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_CONF_TARGET_BOOT_STACK_SIZE { ; stack