AnsweredAssumed Answered

CPU component for ARM - stack setup issue?

Question asked by Marc Lindahl on Jan 31, 2014
Latest reply on Aug 26, 2014 by Marek Neuzil

I noticed this while using the MKL04Z16VFK4 (ARM Cortex M0+) CPU component.  Under build options, you have a setting for stack size.

Well, tracing through a compiled running program, it looks like the stack settings are used to initialize the MSP (SP_MAIN) stack.  But... when running, the program seems to be using the PSP (SP_PROCESS) stack, which is initialized to a different memory area which is not noted anywhere or protected, and ends up smashing into various static variables.


So, what's the deal?  Should there be TWO stack settings (as, I believe, the MSP is used for ISRs?), or at least the MSP initialized somewhere protected?