From a4cf4782400139f95f93a2747bc96d7c79b5c13a Mon Sep 17 00:00:00 2001 From: bcostm Date: Fri, 19 Feb 2016 10:09:08 +0100 Subject: [PATCH 1/2] Set NVIC_RAM_VECTOR_ADDRESS to 0x10000000 --- .../TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/cmsis_nvic.c | 2 +- .../TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/cmsis_nvic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/cmsis_nvic.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/cmsis_nvic.c index 9263c748e78..a8a6a487a54 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/cmsis_nvic.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/cmsis_nvic.c @@ -30,7 +30,7 @@ */ #include "cmsis_nvic.h" -#define NVIC_RAM_VECTOR_ADDRESS (0x20000000) // Vectors positioned at start of RAM +#define NVIC_RAM_VECTOR_ADDRESS (0x10000000) // Vectors positioned at start of SRAM2 #define NVIC_FLASH_VECTOR_ADDRESS (0x08000000) // Initial vector position in flash void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/cmsis_nvic.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/cmsis_nvic.c index 9263c748e78..a8a6a487a54 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/cmsis_nvic.c +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/cmsis_nvic.c @@ -30,7 +30,7 @@ */ #include "cmsis_nvic.h" -#define NVIC_RAM_VECTOR_ADDRESS (0x20000000) // Vectors positioned at start of RAM +#define NVIC_RAM_VECTOR_ADDRESS (0x10000000) // Vectors positioned at start of SRAM2 #define NVIC_FLASH_VECTOR_ADDRESS (0x08000000) // Initial vector position in flash void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) { From c30cb0129e6ef34dae91d801adf6610bb3aac49e Mon Sep 17 00:00:00 2001 From: bcostm Date: Fri, 19 Feb 2016 16:51:31 +0100 Subject: [PATCH 2/2] Update ARM_MICRO startup files Fix issue #1348 with stack/heap and with many ST shields. --- .../TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s | 16 +++------------- .../TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s | 16 +++------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s index 919f1d969e1..fba5efee895 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_DISCO_L476VG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s @@ -39,18 +39,8 @@ ; ;******************************************************************************* -; Amount of memory (in bytes) allocated for Stack -; Tailor this value to your application needs -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - -Stack_Size EQU 0x00000400 - AREA STACK, NOINIT, READWRITE, ALIGN=3 EXPORT __initial_sp - -Stack_Mem SPACE Stack_Size __initial_sp EQU 0x10008000 ; Top of RAM, L4-ECC-SRAM2 retained in standby @@ -58,7 +48,7 @@ __initial_sp EQU 0x10008000 ; Top of RAM, L4-ECC-SRAM2 retained in standb ; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Heap_Size EQU 0x00000400 +Heap_Size EQU 0x8000 ; 32KB AREA HEAP, NOINIT, READWRITE, ALIGN=3 EXPORT __heap_base @@ -66,12 +56,11 @@ Heap_Size EQU 0x00000400 __heap_base Heap_Mem SPACE Heap_Size -__heap_limit EQU (__initial_sp - Stack_Size) +__heap_limit PRESERVE8 THUMB - ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors @@ -415,3 +404,4 @@ FPU_IRQHandler END ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** + diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s index 919f1d969e1..fba5efee895 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L4/TARGET_NUCLEO_L476RG/TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s @@ -39,18 +39,8 @@ ; ;******************************************************************************* -; Amount of memory (in bytes) allocated for Stack -; Tailor this value to your application needs -; Stack Configuration -; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; - -Stack_Size EQU 0x00000400 - AREA STACK, NOINIT, READWRITE, ALIGN=3 EXPORT __initial_sp - -Stack_Mem SPACE Stack_Size __initial_sp EQU 0x10008000 ; Top of RAM, L4-ECC-SRAM2 retained in standby @@ -58,7 +48,7 @@ __initial_sp EQU 0x10008000 ; Top of RAM, L4-ECC-SRAM2 retained in standb ; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Heap_Size EQU 0x00000400 +Heap_Size EQU 0x8000 ; 32KB AREA HEAP, NOINIT, READWRITE, ALIGN=3 EXPORT __heap_base @@ -66,12 +56,11 @@ Heap_Size EQU 0x00000400 __heap_base Heap_Mem SPACE Heap_Size -__heap_limit EQU (__initial_sp - Stack_Size) +__heap_limit PRESERVE8 THUMB - ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors @@ -415,3 +404,4 @@ FPU_IRQHandler END ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** +