alexwhittemore has posted a detailed tutorial how to make an adapter: ST-Link/V2 SWD-JTAG adapter
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.