I have a project which I believe has some bad code in it, and I am trying to debug the problem. I am using a custom board, an XDS200 emulator, and Code Composer Studio 5.5. My custom board is populated with a TM4C129 processor.
My problem is that my program runs for ~5 minutes, and then skips several state machine states and ends up back in the IDLE (default) state. Initially, I saw the program call exit(), but that only occurred once and I haven't been able to reproduce it. Instead, now, I'm seeing the code leave the state it's normally in and go back to IDLE. Conditions aren't appropriate for it to exit IDLE, so it gets stuck there.
In order to see why this was happening, I put a breakpoint on the IDLE state's steady-state function, so I would be able to see when the device re-entered IDLE. To my surprise, even when I could tell from external equipment that the device went back into IDLE, the breakpoint was not referenced and did not halt the system.
I paused execution and did 'step-over' until I was in the state engine, and it's walking directly over my breakpoint, but not halting on it. If I run the system, it continues execution uninterrupted. If I pause the system, remove the breakpoint, re-add the breakpoint, and hit resume, it stops on the breakpoint immediately. This is a hardware breakpoint.
So, it seems my breakpoint is somehow being disregarded during execution - but it still shows as active. If I re-create it during the same debug session, debugging the same program, in the same place, it halts the system as intended. What's going on here?