DirtyJTAG Firmware Convert $2 STM32 “Bluepill” Boards or ST-Link V2 Clones into JTAG Adapters

DirtyJTAG is a JTAG adapter firmware for cheap STM32 boards like BluePill or equally inexpensive ST-Link V2 clones that was developed to create an  alternative to the cheap – but now obsolete – LPT Wiggler cables, and more expensive USB JTAG probes.

Bluepill Board Connected to Router as JTAG Adapter – Click to Enlarge

You’ll find the source, and documentation on Github. First, you’ll need to flash the firmware using the DFU method or an SWD programmer (for ST-Link) or USB to TLL debug board (for STM32 dev boards), before making the connection to the target board as shown below (for Bluepill).

STM32JTAG
PA0TDI
PA1TDO
PA2TCK
PA3TMS
PA4TRST
PA5SRST

You can then use mainline UrJTAG for your newly flashed JTAG adapter. If you prefer OpenOCD, it might eventually be possible to use Versaloon firmware instead on STM32 Bluepill board.

Thanks to Zoobab for the tip.

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.

Support CNX Software - Donate via PayPal, become a Patron on Patreon, or buy review samples
Subscribe
Notify of
guest
7 Comments
oldest
newest most voted
zoobab
2 years ago

Nice, his blog is a gold mine. I recently used his pill_serial firmware to have 3 serial ports on the bluepill. Will try that one as well.

I also found another firmware last week:

https://github.com/zoobab/armblaster

But could not make it work on a bluepill. A friend of mine will ship me an STBee board from Japan so at least I have a reference board where I am sure the code works.

ben
ben
2 years ago

So when you program a Bluepill/V2Clone with one of these images, can you program/debug any JTAG device? Not just ST?

Also, since JTAG and SWD share the same pins, I assume none of these project ( UrJtag/DirtyJtag, OpenOCD/Versaloon, BlackMagicProbe) support the Single Wire Interface? Even though the factory ST-Link v2 says it can do SWIM?

Jean
Jean
2 years ago

Yup, I wrote DirtyJTAG to debug Broadcom MIPS boards. You’re limited to what UrJTAG is compatible with, its code base is quite simple to understand so if needed you can code it yourself.

DirtyJTAG doesn’t supports SWD, I think you’d better be using an ST-Link dongle with its stock firmware and texane/stlink + OpenOCD.

Garoux
Garoux
2 years ago

While that is indeed an interesting project, from a practical point of view there are imho better options that are already supported by OpenOCD:
* for $2.65 incl shipping (aliexpress), you get an Altera USB Blaster clone ready made incl. housing, USB cable and JTAG ribbon cable
* for $6,70 incl. shipping, you get a FT232H based USB-JTAG adapter which does usb hi-speed and is therefore much faster than any of the above.

Jean
Jean
2 years ago

There are indeed better&faster solutions if you’re prefering OpenOCD. There’s the “versaloon” firmware for STM32 boards, which is available on Zoobab’s GitHub repository.

IMHO, I’d stay away from Altera Blaster clones unless you’re doing FPGA stuff, as there are a ton of hardware variants, each with a different MCU+firmware combination. Mine got a PIC 18F14K50, which only seems to be compatible with Altera FPGA software…

Benjamin HENRION
1 year ago

There is now a binary release of the Versaloon firmware, thanks to the big cleanup made by Jean Thomas, testers welcomed: https://github.com/zoobab/versaloon/blob/master/README.md

Advertisements