Stack Memory - Remaining size
Hi everyone,
Is there a way/function to get the currently allocated stack memory of the system when you do not use any OS?
How can I understand that the reason of a crash is insufficient stack size?
Thank you,
-
-
Also, for a more interactive way, look at the build's .map file. look to see where the stack is defined . eg .stack or .stack_process (depending of the chip and build options) the stack should be filled with 0's at startup. During program operation, set a break point and dump the stack memory, looking for non zero values at the low(est) address range.
this method wont always be accurate, depending on how the stack is used, eg array allocation etc, but it will give you a good idea of there are issues.
Please sign in to leave a comment.
Comments
2 comments