The fantastic STM32 Discovery boards from ST Micro all come with an embedded ST-Link/V2 debugger onboard, including some jumpers to disconnect it from the target device for use as a standalone SWD debugger. Presumably, this is to allow for easy use debugging a custom end-product PCB, but it’s also useful if you have any other STM32 evaluation boards hanging around with no built-in debugger, but don’t happen to have a proper JTAG dongle handy. Here’s how to make an adapter.
It happens to be the case that I’ve got an STM3210E-Eval board I need to work on, but no compatible JTAG debugger handy. I do have a ton of Discovery boards, so now I just need an adapter to use the Serial Wire Debug capabilities on the STM3210E from my Discovery board.
The Discovery board has a 6 pin SWD header and the STM3210E a standard 20-pin JTAG connector. Here are the pinouts as relevant for this adapter:
Naturally, the schematic follows from that map at the bottom:
I happen to have a Fry’s nearby so I just ran out and got the proper 20-pin keyed PCB mount socket, but you could just as easily use naked male header pins.
The finished product – not pretty, but works just fine.