We have a new project where we want to use the K22F. For testing of the toolchain, we used the FRDM-K22F board and KDS 2.0. We noticed that if we program the board with some demo code (e.g. the CDC virtual com example), we can program the board just fine, and it starts executing it just right. However, the "Reset" button doesn't work (e.g. if you want to start over from the initialization). KDS properly executes the gdb commands:
tbreak main
mon reset halt
continue
However, the system never stops at main, and it just keeps executing. We dug a little deeper and used openocd directly. Executing "reset halt" does not reset the core! You can single step, execute the reset, and the PC will still be at the same location.
Anybody else observe this issue, or has a fix for this? It is very inconvenient to have to reprogram every time you want to re-execute your binary.
To give some more details, I traced the issue down to OpenOCD. When I am using the PEMicro OpenSDA programmer, everything works as expected. I confirmed this behavior both on Linux and Windows.
A second follow-up, the problem is still there in KDS 3.0.
Hi Thomas,
I have been able to look into this a little more. I have a workaround (not exactly the solution I wanted I think, but at least I think this fixes your problem). Have you tried setting checking the "Set program counter at (hex):" option? I set it as follows and I am able to click the restart button and end up back at SystemInit.
You may need to set it to a different location depending on where your compiler puts things and what program you are running. But either way let me know if this works for you. I will probably have to submit a ticket for this and enlist some more help for a more "elegant" solution.
Best Regards,
Chris