Troubleshooting Stack Over / Under Flow Crashes.
Stuart says:
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: 2024/11/22 03:54,
18.119.159.196:LOG IN
|
©2024 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://massmind.org/Techref/ti/msp430/stacks.htm"> TI MSP430 Microcontroller Stacks</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to massmind.org! |
.