Sizing the main and task stacks

cemer wrote on Monday, March 04, 2013:


I am wondering how to correctly size stacks of an application with several tasks running. Is there any relation in between the main stack and the task stacks? How much main stack (defined in the linker) do the tasks use?

Finally, is there any static analysis tool which calculates the worst case stack depth required by the application?

Thanks in advance.

rtel wrote on Monday, March 04, 2013:



There is no tool to pre-calculate the stack usage, but facilities exist in the kernel to allow you to detect overflows and tune the stack usage.

The state viewer debugger plug-ins will also show you the high water mark use of each task.