Hi,
How I can determine a stack size when I create a task (xTaskCreate)?
Can you tell me what factors need to be consider for calculating a task stack size?
Thanks!
Task stack size
Re: Task stack size
You need the stack space for all the variables in the scope of that task. (not including malloc, which goes on the heap)
You can see how much of that space is/was used by calling "uxTaskGetStackHighWaterMark(NULL)" inside the task. Or passing the task handle instead of NULL, calling the function from anywhere.
You can see how much of that space is/was used by calling "uxTaskGetStackHighWaterMark(NULL)" inside the task. Or passing the task handle instead of NULL, calling the function from anywhere.
Re: Task stack size
Ok, thanks I tried that you suggested to me.
So do I have to find the value empirically?
So do I have to find the value empirically?
Re: Task stack size
I start with a safe / big enough stack size, then try to call
Cheers
Gfast2
monitor how is the "High Water Mark", then lastely I shrink down the stack size I allocated before. 8192 is what I tried first normally.uxTaskGetStackHighWaterMark(NULL)
Cheers
Gfast2
Re: Task stack size
Ok, thanks a lot Gfast2!
I do in your way.
I do in your way.
Who is online
Users browsing this forum: No registered users and 115 guests