The microcontroller profiles support two different stacks, a main stack and a process stack. It has two stack pointers, one for each stack. Only one stack pointer is visible at a time, depending on the stack in use.
The main stack is used at reset, and on entry to an exception
handler. To use the process stack it must be selected. You can do
this while in Thread Mode, by writing to CONTROL using an
Your initialization or context switching code must initialize the process stack pointer.