SLUAAP6 September   2023 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138128A , UCD3138A , UCD3138A64

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
    1. 1.1 Check the Size for Each Stack
  5. 2Check if an Overflow Happens
  6. 3Summary
  7. 4References

Summary

Unexpected problems can happen when stack overflow occurs. This application note describes two options for stack overflow detection. Option 1 is done with memory peek/poke. It is easy to implement, but cannot detect the worst case because stack usage varies with code running. Option 2 is detecting continuously and alerts once an overflow happens.