I have a home-brew co-routine task management system that uses a WFE() [or WFI()] to sleep in between events that might cause tasks to run. I have been using this software for a couple years now on a SAM3S with no problems. It is a simple mainloop of the form:
Code: Select all
while (1)
{
_WFE();
processAllReadyTasks();
}
After upgrading to Studio 7 and the latest firmware for my JLink debugger, I now get very strange error messages within a few seconds of running my program in debug mode. For example, one message says "J-Link V4.98e Internal Error Could not find breakpoint in internal list". Other times, the debugger will stop at a line of code as though I had a breakpoint, but there is no breakpoint at that location.
The strange part is that the debugger crash seems connected to the presence of the _WFE().
#1. If I remove the _WFE(), the system works perfectly as expected, even with the debugger connected.
2. If I flash the version of the code that contains _WFE(), with a debugger connected the program hits phantom breakpoints, or gives me spurious internal errors as described above. But when disconnect the debugger physically from my board (without changing the program or reflashing), the program also runs just fine.
Has anyone else had weird behavior with J-Link V4.98e internal errors?