This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Checking Stack Size and/or Heap during Runtime

Other Parts Discussed in Thread: CC3200

Hello E2E,

Is there any way to check the heap (and/or stack size for tasks) during runtime? Even if it is just printing to UART. I’m running into some audio clipping/cutout issues on a CC3200 Audio Boosterpack and I can’t tell if the issue is related to the size of the circular buffer we are using or stack overrun.

Best Regards,

Wilson

  • Hello Wilson,

    Put a break point at main and then fill all the stack with 0xFFFF. Make sure you only change the part that hasn't been used yet (the part with zeros). Then run the program for a while. You can then see (using the memory window and continuous refresh) what parts of the stack hasn't been changed (the part that has 0xFFFF). The stack memory size and location is defined in the .map file.

    It might be best to test the circular buffer code by itself using the simulator.

    Stephen
  • Also, you can tests if something else is writing to the circular buffer. Modify the code to disable normal writing to the circular buffer. Break at main and then fill the circular buffer with some special value. Then, run the code for a while watching the circular buffer in the memory window.

    Has the circular buffer code been used before? If not, I think it is probably best to unit test it in the simulator or on the actual target.
  • Thanks for your help! As always your quick response time is greatly appreciated.
  • Did you find out what was causing the issue?
  • Hello StevenH,

    I'm still haven't received feedback. I'm quite confident the information you've provided has been quite helpful.

    -Wilson