Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


stack pointer initialization

Hi,

I’m pretty new to ARM processor and STM32 microcontroller, so my question is very basic.
In the startup file for a SW4STM32 project (eg startup_stm32f446xx.s) the stack pointer is set in Reset_Handler with the line

ldr sp, =_estack /* set stack pointer */

Why is this needed? I mean as far as I know the ARM Cortex-M is fetching automatically the value of the stack pointer as first step during the booting sequence. Why has it to be done a second time via software? It looks like it is initialized twice to the same value (_estack) since the vector table has the form:

.word _estack
.word Reset_Handler
.
.
.

Sometimes SP may not be pointing to the end of the stack on bootup. So the instruction “ldr sp, =_estack” /* set stack pointer */ will forcefully set the SP to end of the stack. I found this behavior in STM32F103VEt MCU whose code was generated by using CubeMx. The expected stack pointer register value on startup was “0x20005000” but the value found in the SP was “0x200001FC”.