From a1b9e560e23cf6e700471d153d089918995f75eb Mon Sep 17 00:00:00 2001 From: svastm Date: Thu, 9 Jun 2016 17:57:27 +0200 Subject: [PATCH] [STM32L4XX] Fix heap size for uARM --- .../TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s | 4 ++-- .../TOOLCHAIN_ARM_MICRO/stm32l476xx.sct | 7 +++---- .../TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s b/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s index 10b68e9feb7..34373f13574 100644 --- a/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s +++ b/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s @@ -42,13 +42,13 @@ AREA STACK, NOINIT, READWRITE, ALIGN=3 EXPORT __initial_sp -__initial_sp EQU 0x10008000 ; Top of RAM, L4-ECC-SRAM2 retained in standby +__initial_sp EQU 0x20018000 ; Top of RAM, L4-ECC-SRAM2 retained in standby ; Heap Configuration ; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Heap_Size EQU 0x18000 ; 96KB +Heap_Size EQU 0x17800 ; 94KB (96KB, -2*1KB for main thread and scheduler) AREA HEAP, NOINIT, READWRITE, ALIGN=3 EXPORT __heap_base diff --git a/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/stm32l476xx.sct b/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/stm32l476xx.sct index 59fe0fc1515..39fbb380c46 100644 --- a/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/stm32l476xx.sct +++ b/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/stm32l476xx.sct @@ -36,12 +36,11 @@ LR_IROM1 0x08000000 0x100000 { ; load region size_region .ANY (+RO) } - ; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM - RW_IRAM1 (0x10000000+0x188) (0x08000-0x188) { ; RW data 32k L4-ECC-SRAM2 retained in standby + RW_IRAM1 0x20000000 0x00018000 { ; RW data 96k L4-SRAM1 .ANY (+RW +ZI) } - - RW_IRAM2 0x20000000 0x00018000 { ; RW data 96k L4-SRAM1 + ; Total: 98 vectors = 392 bytes (0x188) to be reserved in RAM + RW_IRAM2 (0x10000000+0x188) (0x08000-0x188) { ; RW data 32k L4-ECC-SRAM2 retained in standby .ANY (+RW +ZI) } diff --git a/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s b/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s index d825e46f89a..d444518bc95 100644 --- a/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s +++ b/hal/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s @@ -48,7 +48,7 @@ __initial_sp EQU 0x20018000 ; Top of RAM, L4-ECC-SRAM2 retained in standb ; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Heap_Size EQU 0x18000 ; 96KB +Heap_Size EQU 0x17800 ; 94KB (96KB, -2*1KB for main thread and scheduler) AREA HEAP, NOINIT, READWRITE, ALIGN=3 EXPORT __heap_base