This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is there a way to check the stack size during runtime?

Is there a way to check the stack size during runtime?

I use a Freescale K10 MCU.

Parents
  • Do you mean checking it from inside the running program, or from the debugger? If you run an OS, the debugger will be able to tell you something about stack useage.

    If you need to check it from the running program itself, you could of course fill the stack with a pre-defined content and make a small functeion that runs thru the stack area, looking for the amount of stack that don't have the pre-defind content anymore.

Reply
  • Do you mean checking it from inside the running program, or from the debugger? If you run an OS, the debugger will be able to tell you something about stack useage.

    If you need to check it from the running program itself, you could of course fill the stack with a pre-defined content and make a small functeion that runs thru the stack area, looking for the amount of stack that don't have the pre-defind content anymore.

Children