I'm having some major problems with my software, trying to find strange runtime errors that are giving me no clue on where to start looking!
I am constantly collecting CAN Data and processing the data in an XGATE interrupt service routine. However, when I turn the CAN off (ie, don't connect my CAN simulator), then the rest of the application works just fine.
But, when CAN is connected and processing data (ie, casuing CAN Rx interrupts on the XGATE), I sometimes get really weird runtime errors. So far I've had the following errors:
- ILLEGAL_BP in the debugger (though I never set a breakpoint - I sometimes just leave the BDM connected).
- Program restart. For some reason the program just seems to start over, even though theres no location in my code that says it should do this...
- I've had it ONCE go into the COP interrupt service routine (only ONCE!)
(note that every ISR has an endless loop in it, with a unique code that I can look at with LEDs to tell me the program crashed at that ISR)
The first 2 errors are pretty common and usually happen anywhere between 5 minutes to one hours of the application running (but the rest of the time it works just as it should). Because it works until the error happens, I'm suspecting something weird is happeneing when a specific condition happens on the CAN bus, either a value that's not being correctly processed, or something...
Does anyone have any suggestions on how I could debug this beast and get this running flawlessly? Has anyone had similar problems with their application when processing a lot of CAN data?
Any help or ideas would be greatly appreciated - its starting to get quite frusterating since it works so well, except for this sporatic error!