This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am trying to troubleshoot code and if I set a breakpoint I stop there, however when I go to hit run again I notice the board resets and seems to come up operationally (logic analyzer) yet I never stop at my breakpoint again. Breakpoint has been tried in main and in an ISR on turning an LED indicator off/on. My guess is I have bad code somewhere and am not handling something properly or over-running. How do I go about tracking this down? I have multiple files and about 1500 lines of code.
Thanks
The debugger often loses track of itself after an unexpected Reset. The first thing to do is set a breakpoint at the beginning of your program, and look at SYSRSTIV.
1) The easiest method is to set a breakpoint on the second line of main() [the first line may be meddled by the debugger]
2) The best method is to breakpoint at the Reset entry point. I can never remember the exact name, so if I have the luxury ahead of time I do a "Hard Reset" (the chip icon around the top-middle) and breakpoint wherever it puts me.
Either one will allow you to check SYSRSTIV. Option (2) allows you to dissect the stack, since SP, RAM and all the registers (except PC/SR) are still intact.
**Attention** This is a public forum