Troubleshooting Stack Over / Under Flow Crashes.
The in past, I have created "guard bytes" which are located immediately above and below each stack. The words are initialized with some kind of magic number (i.e. "0xABCD", "0xFEED", "0xDEAD", "0xBEEF"...) If the stack overflows or underflows (or they get trashed some other way), the guard words will be overwritten. You can then carefully craft a check that tests the value of the guard words. If it is a simple matter of a stack over or underflow, you'll know which task is causing the problem. If you really want to instrument the code, you can modify your RTOS scheduler/task switch such that it tests the guard bytes whenever leaving a task. This will hurt your timing a little, but it's only for debugging.
|file: /Techref/ti/msp430/stacks.htm, 1KB, , updated: 2009/9/14 12:50, local time: 2018/12/16 21:21,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.sxlist.com/techref/ti/msp430/stacks.htm"> TI MSP430 Microcontroller Stacks</A>
|Did you find what you needed?|
Welcome to sxlist.com!
& kind contributors
just like you!
Please don't rip/copy
Copies of the site on CD
are available at minimal cost.
Welcome to www.sxlist.com!