From 4dc4bfff9a2b57fa5b7d0ea1632f561498b65c24 Mon Sep 17 00:00:00 2001 From: Jammu Kekkonen Date: Thu, 19 Sep 2019 11:38:27 +0300 Subject: [PATCH] Add option to use CCMRAM on F303xE. --- .../device/TOOLCHAIN_ARM_STD/stm32f303xe.sct | 6 +++++- .../device/TOOLCHAIN_GCC_ARM/STM32F303XE.ld | 7 +++++++ .../device/TOOLCHAIN_IAR/stm32f303xe.icf | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_ARM_STD/stm32f303xe.sct b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_ARM_STD/stm32f303xe.sct index c1412b409f..02373d988f 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_ARM_STD/stm32f303xe.sct +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_ARM_STD/stm32f303xe.sct @@ -42,7 +42,7 @@ #define Stack_Size MBED_BOOT_STACK_SIZE -; STM32F303RE: 512KB FLASH (0x80000) + 64KB SRAM (0x10000) +; STM32F303RE: 512KB FLASH (0x80000) + 64KB SRAM (0x10000) + 16KB CCMRAM (0x4000) LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address @@ -58,5 +58,9 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region ARM_LIB_STACK (0x20000000+0x10000) EMPTY -Stack_Size { ; stack } + + CCMRAM (0x10000000) (0x4000) { + .ANY (CCMRAM) + } } diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_GCC_ARM/STM32F303XE.ld b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_GCC_ARM/STM32F303XE.ld index 5e5c2921cd..9bc823eb91 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_GCC_ARM/STM32F303XE.ld +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_GCC_ARM/STM32F303XE.ld @@ -168,5 +168,12 @@ SECTIONS /* Check if data + heap + stack exceeds RAM limit */ ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") + + .CCMRAM (NOLOAD): + { + Image$$RW_IRAM2$$Base = . ; + *(CCMRAM) + Image$$RW_IRAM2$$ZI$$Limit = .; + } > CCM } diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_IAR/stm32f303xe.icf b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_IAR/stm32f303xe.icf index bce5012ece..87bc0bfa92 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_IAR/stm32f303xe.icf +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_IAR/stm32f303xe.icf @@ -33,8 +33,10 @@ define block STACKHEAP with fixed order { block HEAP, block CSTACK }; initialize by copy with packing = zeros { readwrite }; do not initialize { section .noinit }; +do not initialize { section CCMRAM }; place at address mem:__intvec_start__ { readonly section .intvec }; place in ROM_region { readonly }; place in RAM_region { readwrite, block STACKHEAP }; +place in CCMRAM_region { section CCMRAM };