From 2d7f24285093e0c5135e5518a4d8ed54ff33fd0f Mon Sep 17 00:00:00 2001 From: JojoS Date: Tue, 31 Jan 2023 05:56:13 +0100 Subject: [PATCH] device ram size is 40 kb, not 48 kB (#128) * device ram size is 40 kb, not 48 kB in total RAM+RAM1 it has 48 kB, but the regions are not continous. This error is also arm-pack index.json * add section for CCM --- .../TOOLCHAIN_GCC_ARM/STM32F303XC.ld | 14 ++++++++++++-- .../TARGET_STM32F3/TARGET_STM32F303xC/cmsis_nvic.h | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TOOLCHAIN_GCC_ARM/STM32F303XC.ld b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TOOLCHAIN_GCC_ARM/STM32F303XC.ld index 5f479936c8..e8e6b52acd 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TOOLCHAIN_GCC_ARM/STM32F303XC.ld +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/TOOLCHAIN_GCC_ARM/STM32F303XC.ld @@ -37,8 +37,9 @@ MEMORY { - FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE - RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE + FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE + RAM (rwx) : ORIGIN = MBED_RAM_START + VECTORS_SIZE, LENGTH = MBED_RAM_SIZE - VECTORS_SIZE + RAM_CCM (rwx) : ORIGIN = MBED_RAM1_START, LENGTH = MBED_RAM1_SIZE } /* Linker script to place sections and symbol values. Should be used together @@ -183,6 +184,15 @@ SECTIONS __HeapLimit = .; } > RAM + .ram_ccm_section (NOLOAD): + { + __ram_ccm_start__ = .; + *(.RAM_CCM_section) + . = ORIGIN(RAM_CCM) + LENGTH(RAM_CCM); + __ram_ccm_end__ = .; + } >RAM_CCM + + /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign * values to stack symbols later */ diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/cmsis_nvic.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/cmsis_nvic.h index c3bf4943a7..1587dc7034 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/cmsis_nvic.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/cmsis_nvic.h @@ -30,7 +30,7 @@ #endif #if !defined(MBED_RAM_SIZE) -#define MBED_RAM_SIZE 0xc000 // 48 KB +#define MBED_RAM_SIZE 0xa000 // 40 KB #endif #if !defined(MBED_RAM1_START)