I did a quick test on your code and I can see the issue. But If you remove the breakpoint when it hits -> Run -> And again place a breakpoint, then it does not hit it again.
So I feel that the EVT is being called only once, but due to some debugger aberration you see the multiple hits on same breakpoint.
You can test it by placing a LED toggle code inside this event and observe how much toggling occurs.
1 of 1 people found this helpful
Thanks for your response. It looks like this is correct.
With enabled interrupts debugging can turn out to be complicated. The situation is:
- You stop at a breakpoint and watch debugging results
- During that time an interrupt occurs, but is not served because the processor is halted
- At resume, the pending interrupt becomes active and gets served.
- The return point for the interrupt handler is the instruction where you set the breakpoint to.
- The program breaks again at the same point, sometimes looking as if nothing has happened.
Remember: A breakpoint stops the CPU execution, but does not stop any hardware from running as there are counters, timers, radios, DMA etc.
Thanks for your insight Bob. That makes a lot of sense. I guess for some of this stuff I need to go back to debugging with LEDs ;)
A first solution might be to disable interrupts when you reached a brekpoint, there is a button for this function.
You may even use the USB-UART connection which is supported by the KitProg module of your PRoC BLE. Only the right io-pins have to be connected to an UART component. Shows some more than an LED.