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).

STM32 JTAG
PA0 TDI
PA1 TDO
PA2 TCK
PA3 TMS
PA4 TRST
PA5 SRST

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.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus

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

    1. 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.

  1. 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?

    1. 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.

  2. 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.

    1. 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…

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC