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
  • Hi,

    with RTX, create U64 taskStack[STACKSIZE/8] arrays, and memset them to 0xcc in the main function before creating a task.
    Then simply add this variable to the watch Window and let your application run.

    The stack gets filled from top, the last entry you see is the magic word which gets checked by the OS.

    By counting the remaining "0xcc" you can see the maximal stack usage.

    BR,
    /th.

Reply
  • Hi,

    with RTX, create U64 taskStack[STACKSIZE/8] arrays, and memset them to 0xcc in the main function before creating a task.
    Then simply add this variable to the watch Window and let your application run.

    The stack gets filled from top, the last entry you see is the magic word which gets checked by the OS.

    By counting the remaining "0xcc" you can see the maximal stack usage.

    BR,
    /th.

Children
No data