Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I followed the example in Appendix B of http://www.cypress.com/?docID=42246 to detect a stack overflow in software. Basically, pre-set the SRAM byte at 0xFF to value of 0xAA. Then periodically check to make sure it hasn't changed.
Seems like a good idea, but I am getting false-positives. I verified there is no stack overflow by using the ICE with Events as also described in that document.
Seems the function E2Read() is stepping on that ram location. Then I checked the datasheet for E2PROM, and it indeed says that the E2Read() uses "RAM High Memory: 0xF8 - 0xFF".
That doesn't seem like a safe practice to me. So there is no hardware to detect a stack-overflow, no way to statically set the stack size, and functions that write to the stack area without using the stack pointer? Am I missing something?