I'm using keil uVision5 for developing my application with freeRTOS. As we know , allocating enough stack to each task (thread) is important . Keil IDE provides detailed informatons in HTML file about functions and tasks include maximum stack depth. It is not obvious for me some parts of details.
For example, in static call graph file for menu_Dispaly task that I create we have:
menu_Display (Thumb, 11860 bytes, Stack size 1008 bytes, main.o(i.menu_Display))[Stack]
"Max Depth" is the maximum stack usage when deepest call occurs but I don't know what the second(11860 bytes) and third (Stack size 1008 bytes) arguments stand for? And what does "Thumb" mean?
"Thumb" refers to the instruction set - you are likely using Cortex-M, which supports only one (Thumb) instruction set - Cortex-A has two, a 32-bit Arm instruction set as well as Thumb.
11860 is the code size of menu_Display, in bytes.
1008 is the amount of stack this function uses, then you see the greater stack chain that involves this function.
Sorry,but I confused about which I should take into account in order to be sure about allocating enough stack to this or similar task (maximum stack depth (13848 bytes) or stack usage (1008 bytes))?What is the difference between them?
The 1008 bytes is attributable just to the menu_Display() function itself. The 13848 number is for the deepest function call stack all the way down to the disk_write() function. Therefore you should allocate (at least) 13848 bytes for your stack.The function size, 11860 bytes, has no effect on the stack usage.
Thanks for your help.
View all questions in Arm Compilers forum