I am new to Creator, having used Designer for many years.
I am working on a PSoC4 BLE project.
There seems to be some random behavior with breakpoints.
When the code hits a breakpoint it often cant be continued again, it simply sticks at the same breakpoint.
When code hits a breakpoint, and another breakpoint is then added, the code never stops at the added breakpoint even if it reaches that point.
When setting a breakpoint "on the fly" the Bluetooth connection is randomly lost even though the break is not reached and the code is still running.
Is this expected behaviour?
Welcome in the forum, Andy!
To tell the truth, this unexpected behave of breakpoints is fully expected, but surprises me every time.
One (simple) explanation is: When hitting a breakpoint you stop the CPU, but you do not halt all the underlying hardware which is able to produce more and more interrupts while we are looking at the screen to see what goes on.
Halting on a BP, then just a single step and the program is at entry of an interrupt handler. While looking at the screen some other ints get fired (but not yet worked on) and you can be sure that one of those is telling that there was a time-out causing now the project to behave differently from the case without the breakpoint. Cypress Designer had the very same behave when using the ICE-Cube for debugging and tracing.
I always found Designer with the Ice-cube to be very well-behaved during breakpoints. It didnt do any of the above.
With the Cube, the timers appeared to stop when the break was reached.
I am wondering if this behaviour is being exacerbated by the sleep modes being enabled. I am not sure how to disable all sleep modes in the BLE examples.
Solution for this is to remove the break point, place a new break point at the next required location and then run the CPU.
And keep repeating the above steps. Other work around is to disable the global interrups while debugging.
placing next breakpoint works, or the long way around is to disable global ints, single step which will bring you inside an interrupt, then step out to your code. Re-enable globals ints when you're done... This sometimes crashes the radio though.
Bob Marlowe answered the question. Interrupts are generated while you mouse click. Conditions are changing under your feet if you have interrupts active.