This article is more than 1 year old

Raspberry Pi Foundation launches $12 USB Debug Probe

Cheap'n'cheerful option for bare-metal debugging – on anything with SWD connections

The Raspberry Pi Foundation has a new gadget: a cheap, easy USB probe for debugging bare-metal code on a Pi Pico… but it should work with several other devices too.

The Debug Probe is a device to help debug bare-metal software on the Raspberry Pi Pico. The Pico is the Foundation's $4 single-board computer for microcontroller type roles. In embedded computers like this, there's often no display output, and in typical use, no operating system – both of which make it tricky to monitor what it's doing, or more to the point, work out why it's not doing it.

A common way to peer into the memory of an embedded Arm device and work out what it's doing is Arm's SWD interface, or Serial Wire Debugbroadly, Arm's three-wire version of the traditional four- or five-wire JTAG interface.

However, to use those SWD signals, you need a device to read and translate them into something another computer can read and interpret, using software such as the FOSS OpenOCD or pyOCD. (In this context, OCD stands for On-Chip Debugger.) This device is called a debug probe.

Conveniently, the normal Raspberry Pi's GPIO interface can talk SWD over a few of its pins [PDF]. This means you can use a Pi to debug something else – including another Pi.

The OCD software runs on the Pi, and you connect a few wires from the Pi's GPIO interface to probe the other device. These days, you'd probably want to use a Pi 4 for this, but in principle any model can do it. For example, here is how to debug an STM32, and this tells you how to reprogram a Particle Xenon.

For clarity: Yes, that does even include the Pi Pico. A Pico hasn't got enough power to run a full OCD suite on the device itself, but the Pico can be used as a probe for a larger computer running the OCD software, thanks to some special firmware called Picoprobe. This is a little cheaper than a dedicated hardware debug probe, but the snag is that you'll need to wire up some circuits, as this blogpost describes.

Even if it's versatile – for instance, you can also use SWD to upload software into a Pi Pico from another Pi – it's not that easy, and if you want to use a bigger, faster computer, such as a PC or Mac, you then need to interface your Pi-based probe to that.

Which is the selling point of the new Pi Debug Probe. You plug one end into your Pi Pico, and the other end into a free USB port, and you're ready to go. It's a very low-end offering, but it should do the job – and it's $12. For comparison, a professional tool such as a Segger J-Link comes in at $60 a pop in the States and €576 for a 12-pack (€48 per unit) in the EU. Even an open-source hardware device such as an ORBtrace Mini – for instance from this store – is around 10 times the price.

Better still, the Pi Debug Probe should be able to talk to any embedded device with an Arm Cortex M series and an SWD interface, such as the Arm-powered Arduino Due, or the 32-bit variants of the Teensy development boards. These are popular for tasks like equipping vintage keyboards with a USB interface. ®

More about

More about

More about

TIP US OFF

Send us news


Other stories you might like