2024-03-26 2:57 AM
Hello,
I'm a bit confused about stack management on Cortex M7.
In my SW I only use the MSP.
I understood that the MSP can only be modified with a MSR instruction. However the SP can be modified with a "simple" LDR instruction.
Does that mean that when I do a ldr sp, =xxx (with CONTROL.SPSEL = 0) it modifies not only the SP register but also the MSP register ?
Since I use only MSP, is there a difference between setting the SP with a LDR and setting the MSP with a MSR ?
2024-03-26 6:48 AM
Instruction ldr sp .... relates to the current SP, whatever it is msp or psp.
If you are sure that the active SP is msp, no need to use msr.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.