aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/ext/target/stm/common/stm32l5xx/Device/Source/startup_stm32l5xx_s.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/ext/target/stm/common/stm32l5xx/Device/Source/startup_stm32l5xx_s.c b/platform/ext/target/stm/common/stm32l5xx/Device/Source/startup_stm32l5xx_s.c
index 8c7869585f..9bdea560cc 100644
--- a/platform/ext/target/stm/common/stm32l5xx/Device/Source/startup_stm32l5xx_s.c
+++ b/platform/ext/target/stm/common/stm32l5xx/Device/Source/startup_stm32l5xx_s.c
@@ -348,6 +348,9 @@ void Reset_Handler(void)
{
__disable_irq();
__set_MSPLIM((uint32_t)(&__MSP_STACK_LIMIT));
+#if defined ( __GNUC__ )
+ __set_MSP((uint32_t)(&__MSP_INITIAL_SP));
+#endif
SystemInit(); /* CMSIS System Initialization */
__set_PSP((uint32_t)(&__INITIAL_SP));
__set_PSPLIM((uint32_t)(&__STACK_LIMIT));