Hi everybody,
I wonder if there is a tool based on .elf, .bin and .map after compilation and linkage which can calculate the stask size required by a task.
Around the forum when people ask about "stack overflow" the answer is typically: "try increase until you don't get "stack overflow"".
Any insight on this can be usefull.
Thanks
tool to calculate task stack size
Re: tool to calculate task stack size
You can try analyze individual stack with High Water Mark: https://www.freertos.org/uxTaskGetStack ... rMark.html
Or using xTaskGetInfo() to see all stacks (HighWater Mark) together, you need active some settings in menuconfig to use this: https://www.freertos.org/vTaskGetInfo.html
Or using xTaskGetInfo() to see all stacks (HighWater Mark) together, you need active some settings in menuconfig to use this: https://www.freertos.org/vTaskGetInfo.html
Re: tool to calculate task stack size
Thanks @urbanze,
I already use High Water Mark feature but it requires to flash and run the program. And you have to be sure to test cover all the branch program flow of the task.
I'm looking for an "offline" tool (if it exists) to use without downloading firmware to device. Something which says "Hey, the task XXX will crash for stack overflow" after I have compiled the program. I guess it can leverage on files genereted by the compiler/linker..
I already use High Water Mark feature but it requires to flash and run the program. And you have to be sure to test cover all the branch program flow of the task.
I'm looking for an "offline" tool (if it exists) to use without downloading firmware to device. Something which says "Hey, the task XXX will crash for stack overflow" after I have compiled the program. I guess it can leverage on files genereted by the compiler/linker..
Re: tool to calculate task stack size
Probably not going to find that. The tool would have to be able to parse the C/C++ code and intelligently look at all the local variables stored on the stack in a function. Then it would have to traverse into all the called functions and do the same. As soon as the tool hit a call into a function that was binary only with no source available it would fail to accurately compute stack requirements.davdav wrote:I'm looking for an "offline" tool (if it exists) to use without downloading firmware to device. Something which says "Hey, the task XXX will crash for stack overflow" after I have compiled the program. I guess it can leverage on files genereted by the compiler/linker..
John A
Re: tool to calculate task stack size
Exactly @fly135, you resume what was my sentiment. Your explanation about "binary only" functions makes sense and therefore stopped my hope.. Thanks
Who is online
Users browsing this forum: Bing [Bot] and 114 guests