I'm using a BF561 with a HPUSB-ICE emulator and CCES 2.2.
Debugging with this setup works fine at first. But after I terminate the debug session and try to start a new one (like you have to if you have changed your code), debugging fails.
The load seems to work, and the processor halts at the start of the main function. But when I try to step or run, the processor immediately resets and I lose contact. If I try again, the same happens.
However, if I cycle power to the processor and try again, debugging works again. If I restart the debug session, the error appears again.
Any help is appreciated.
Actually, I can single step. I found the instruction that causes the crash:
|*pWDOGA_CTL = TMR_DIS;|
The value of TMR_DIS is 0x0AD0, which is the reset value of the watchdog control register. I have checked the register view, and the WDOGA_CTL register already has the value 0x0AD0 before this instruction. This is true also when I have cycled power before I start the debug session, but in that case this instruction does not cause a crash.
After some more testing, the previous result doesn't seem to apply anymore. I need to do some more testing to see how I can consistently recreate the problem.