Reputation: 41
I'm a beginner in FreeRTOS (ARM CM3), my question is:
When you create a task with some local variables inside, where are store these variables in RAM, in the stack (used by the main()) like it's the case in general for the local variables, or in the stack dedicated for this task (create with xTaskCreate() function / usStackDepth parameter) ?
Best regards
Upvotes: 1
Views: 1178
Reputation: 399723
If the variables are declared inside the task function, i.e. they're normal "automatic" variables, then they will use the task's stack.
Such variables are allocated on the stack for the thread of execution that runs the function in question, that's the same with main()
except of course that main()
doesn't run in a FreeRTOS task.
Upvotes: 1