The OpenSDA on the FRDM-KL25Z board is a cool feature: I do not need any external debugging device to program and debug my board :-). But my KL25Z custom board will not have that OpenSDA on it: first because it would add additional costs, and I do not see a way how I could use it for my board. I better start using a SWD/JTAG debugger for my Freedom board to have everything in place.
What I need to add to the black Freedom board is the SWD header:
💡 With that header usually both JTAG and SWD debugging is possible. If it is SWD (lower pincount) or JTAG depends which microcontroller signals are routed to the header. But many times the terms JTAG and SWD are mixed even if technically not correct.
For the part numbers see this post.
Looking at the schematics and the SWD connector, there is a J11 jumper (unpopulated) which can isolate the SWD (Single Wire Debug) clock signal between OpenSDA and the target.
The Freedom Board User Guide (chapter 5.2.1 Debug Interface) seems to indicate that it is possible to cut the J6 trace and then to debug another board with the connector. However, this is not possible, as it seems that the OpenSDA firmware is tight to the processor on the board. You will receive an error that this is not possible:
💡 Cutting that trace is *not* needed for me to debug the target over the SWD connector. Cutting that trace is *only* needed if I want to debug another board with OpenSDA (e.g. see “Using the Freedom Board as SWD Programmer“). For debugging the FRDM board with an external SWD cable the trace/jumper has to be installed!
The good thing is that I can use my existing P&E Universal Multilink. The debugging connection settings are very transparent between OpenSDA and USB Multilink: all what I need to do is to change the interface in the run/debug launch settings:
With this, ready to connect the Multilink with the Freedom board:
❗ Do *not* power the board with the OpenSDA USB port if debugging with a SWD/JTAG cable! Use the KL25Z USB connector as shown in the picture above! I have been told that otherwise either the diode D1 or D2 on the board might get burned, so be warned! I have not seen that problem for myself.
Debugging with the P&E Multilink just worked fine. OpenSDA already is pretty fast, but felt that using the Multilink was even a bit snappier. In any case, if OpenSDA would not be able to connect to my KL25Z on the Freedom board, I have now a second way to get access to it. And something like this has been always been useful for me in the past. I hope I have not to count on it, but always good to have it 😉
Happy SWDing 🙂