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.
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.
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 cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
Or you can use the BlackMagic Probe firmware on the BluePill as well:
https://satoshinm.github.io/blog/171223_jtagswdpillblink_jtagswd_debugging_via_black_magic_probe_on_an_stm32_blue_pill_and_blinking_a_led_using_stm32cubemx_libopencm3_and_bare_metal_c.html
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.
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?
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.
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.
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…
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