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 13:50, local time: 2018/7/22 04:17,
|©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.piclist.com/techref/ti/msp430/stacks.htm"> TI MSP430 Microcontroller Stacks</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180722 RussellMc, Van Horn, David, Sean Breheny, David C Brown, Isaac M. Bavaresco, Bob Blick, Neil, Denny Esterline, John Gardner, Brent Brown,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!