diff options
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_start.c')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_start.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_start.c b/nuttx/arch/arm/src/stm32/stm32_start.c index a2f82f7b2..add226b07 100644 --- a/nuttx/arch/arm/src/stm32/stm32_start.c +++ b/nuttx/arch/arm/src/stm32/stm32_start.c @@ -77,6 +77,16 @@ #endif /**************************************************************************** + * Public Functions + ****************************************************************************/ + +#ifdef CONFIG_ARMV7M_STACKCHECK +/* we need to get r10 set before we can allow instrumentation calls */ + +void __start(void) __attribute__ ((no_instrument_function)); +#endif + +/**************************************************************************** * Name: stm32_fpuconfig * * Description: @@ -183,6 +193,12 @@ void __start(void) const uint32_t *src; uint32_t *dest; +#ifdef CONFIG_ARMV7M_STACKCHECK + /* Set the stack limit before we attempt to call any functions */ + + __asm__ volatile ("sub r10, sp, %0" : : "r" (CONFIG_IDLETHREAD_STACKSIZE - 64) : ); +#endif + /* Configure the uart so that we can get debug output as soon as possible */ stm32_clockconfig(); |