Are local variables of a task are saves on the task stack too ?
Where local variables are saved is completely under the control of the
compiler you are using. FreeRTOS is just C code, compiled along with
the rest of your application – it cannot change how the processor or the
Where can I find what is the order of the MCU registers are saved in
the stack of a task, and what are the registers that are saved ?
Have a look at the port layer source code. The initial stack is created
by vPortInitialiseStack() in each port.c file – but that might not tell
you much (depending on the port). Otherwise look at the code that saves
and restores the context, which will be in the same port.c file or in an
assembly file in the same directory as the port.c file.