|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: Calculating Stack SizeQUESTIONHow can I determine the maximum stack size of my C51 program? ANSWERThere is no automatic way the tools can tell you the maximum stack depth or stack utilization. Because of asynchronous events and interrupts, the automation is too complex. However, you can use the µVision Simulator which provides the sp_max value in the register window. When you execute all features of your application, this gives you the maximum sp value that has been reached by your application. Make sure that your assumptions about the available stack are correct. Some 8051 variants have just 128 bytes on-chip RAM and therefore the stack space ends at 0x7F. You should have more bytes available for executed interrupts. As a guideline, there should be enough space to execute the most complex interrupt of your application. If you cannot use the µVision Simulator, use the following method, which works in any debugging tool. You may use the Monitor, the ISD51 In-system debugger, or any in-circuit emulator. The results should be similar.
SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.