JTAG Hat for Raspberry Pi eases debugging with OpenOCD

Low-level debugging can be performed with a JTAG debugger and OpenOCD open-source software, but since not everybody may have a JTAG debugger at home, some have reverted to using the Raspberry Pi as a JTAG debugger, and you’ll find instructions for cabling and installing the software on the Internet.

Matt Mets of BlinkinLabs have been using the Raspberry Pi SBC and OpenOCD to debug Arm-based microcontroller boards for a while, but found it to be a pain to find jumper wires and look up the pin-outs manually each time. So he designed a JTAG Hat with properly labeled 20-pin .1″ and 1.27mm Cortex debug connectors to speed up the process.

JTAG Hat for Raspberry Pi

The expansion board also adds level-shifting buffers to interface with targets running at 1.8-5V, transistor-based power reset pins, a power switch for optionally supplying 3.3V to the target, a voltage/current sensor for measuring the target power consumption, and a buffered serial connection for communicating with the target using the Pi.

All that makes the JTAG Hat for Raspberry Pi suitable to support debugging devices with either a JTAG (TCK/TMS/TDI/TDO) or SWD (SWDIO/SWDCLK) programming interface which includes most of STM32, ESP32, ESP8266, etc.. boards. You’ll find the instructions to get started with the JTAG Hat and OpenOCD on Github, where you’ll also download the (PNG) schematics and Altium design files.

JTAG Hat Raspberry Pi Arm Cortex JTAG Connector
JTAG Hat with Raspberry Pi and Arm Cortex debug cable

JTAG Hat is sold fully assembled and tested for 22 Euros on BlinkinLabs store together with Nylon standoffs and screws to attach the hat to a Rasbperrry Pi.

Share this:

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

ROCK 5 ITX Rockchip RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
7 Comments
oldest
newest
willy
willy
3 years ago

I used to use a Beaglebone Black as an OpenOCD machine, which I found pretty convenient and fast (and much better in every aspect than the old dirty solutions like hacking a parallel port). I agree that having a board featuring the various connectors with the proper pinouts is even better!

Jim st
Jim st
3 years ago

This is very cool! Ordered one.

dgp
dgp
3 years ago

Is this any better than the bus blaster or the edu jlink..?

Matt Mets
3 years ago

It’s roughly similar to a bus blaster, except that OpenOCD is running entirely on the Pi, so you can connect over a network, or embed it into a test rig fairly easily. The Bus Blaster uses an FTDI chip to do the JTAG signalling, where this one uses the Rasberry Pi GPIO; in practice there’s probably not much difference, and they should both support the same targets through OpenOCD. This one does include some extra features that the Bus Blaster doesn’t seem to have (target current measurement, 1.27mm connector for ARM Cortex devices, buffered UART connection). The J-Link is a… Read more »

dgp
dgp
3 years ago

The 1.27mm connector isn’t a massive issue. You can get little adapter. I’m not sure if measuring the current when powering the target is that useful as we’re talking a few hundred mA that can be source right? If this was combined with a 0-8v configurable power supply that could supply a few amps (enough for most hobby projects) that would be really nice. You could really go to town and have scripts that simulate brown outs and use the JTAG part to work out what would happen. Jlink isn’t that different really. It’s a microcontroller and some level shifters.… Read more »

zoobab
3 years ago

There is some support for libgpiod GPIOs in its release candidate version.

So no more Rpi specific code to tranform your Linux SBC into a JTAG adaptor.

Matt Mets
3 years ago

Oh, that’s smart!

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...