- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
When I use modus,through the function uxTaskGetStackHighWaterMark(),I could confirm the task stack.
But,I don't know how to comfirm the maximum usage of system stack .
Question 1 : Is there any way to do it?
※When I use Keil, an htm file will be generated after the project is compiled, and I can find the maximum usage of the stack through this file.
Question 2: Is there a similar file after compiling?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @micro-atama ,
After you complete the build procedure in Modus Toolbox, you get a summary of the memory usage in the console window as shown below:
The system stack usage can only be observed at runtime as this parameter is dynamic.
You can observe the stack pointer value from the Registers view while debugging the device:
Warm Regards
Alen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @micro-atama ,
After you complete the build procedure in Modus Toolbox, you get a summary of the memory usage in the console window as shown below:
The system stack usage can only be observed at runtime as this parameter is dynamic.
You can observe the stack pointer value from the Registers view while debugging the device:
Warm Regards
Alen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply,@AlenAn14
Following your method ,I can confirm the current usage of system stack .It is really helpful.
But there is still no way about call chain for maximum stack depth
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @micro-atama ,
The actual stack depth is a run time parameter which increases as you increase the number of functions you use recursively in your project.
If you require to know the total stack size that is allocated for your project in the RAM then, you can find the same in the linker script of the CM4 core in the following path:
<Path to project>\libs\TARGET_CY8CKIT-062-WIFI-BT\COMPONENT_CM4\TOOLCHAIN_GCC_ARM\cy8c6xx7_cm4_dual.ld
In the above mentioned .ld file, you can look for the macro STACK_SIZE which tells you how much of RAM is allocated for stack.
I will check on this internally and see if there is a way to get the maximum stack depth that is utilized by a project.
Hope this helps.
Warm Regards
Alen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you,@AlenAn14
Actually,I'm writing a report about stack.And I wish to add some theoretical value such as maximum stack depth.
If there is,then better.If not, it doesn't matter.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @micro-atama ,
If its for a theoretical sense, then the only thing that mainly decides the stack depth is the number of recursive function calls that you do in your project.
Now another important detail here is the amount of RAM available in your embedded device as stack is taken form the RAM and you do not want your stack memory to grow and exceed the maximum RAM size nor do you want it to grow into your heap area (also present in RAM) there by corrupting the heap memory segment when the stack grows down from the top of RAM.
So it is difficult to give a theoretical value for stack unless you are aware/specify a specific project but you can always know the maximum stack size based on the RAM supported provided you are aware of the device you are using.
Hope this helps.
Warm Regards
Alen