My application uses TI-RTOS with 5 tasks. I'm getting an Illegal Instruction trap intermittently at a certain place in my code. But what is puzzling is the stack trace appears corrupted:
illegalOpIsr is my ISR handler (as a note, you have to register this with hwi_plug(), not hwi_create() for anyone trying to figure out similar issues). The assembly in RunBluetoothTask() where the ISR appears to be called from is completely valid. If I return from the ISR, I can step through subsequent lines of code. However, the next task switch (when an Event_pend() is called) doesn't work properly.
I have looked through ROV at my stack usage using the initStackFlag and checkStackFlag parameters in the cfg file. I'm OK there. I think I'm trashing the RTOS internal data by writing past the end of a buffer, but need a better sense of how to find what particular data is getting overwritten. What data contains the base of the call stack? It's obviously incorrect. Any other tips for debugging this kind of problem?
Looking at the registers, the RPC is 0x000015 as shown in the call-stack. Again, I'm not sure how that's getting set or what might be corrupting it, but it's clearly not correct. As I step through Event_pend(), the Task_self() function returns a value that is an invalid address.