Nash’s Four Favorite Firmware Debug Tools | Interrupt

As much as I enjoy writing firmware, I am, at heart, a hardware engineer. I love hunting for minutia in chip datasheets. I love fiddling with eval boards, tacking on wires, and reworking nets together. I love flipping through The Art of Electronics, finding a new circuit, and piecing through its operation. This is why, when invited to write for Interrupt, I jumped at the chance to write about a hardware-related topic that’s near and dear to my heart: debug tools.

This is a companion discussion topic for the original entry at
1 Like

Totally agree with your FTDI comments however the simple USB-to-UART adapter doesn’t do it for me personally. I will buy cheap ones off of eBay and use them everywhere. (Just look closely to get the ones with activity LEDs. Love me some LEDs…). But FTDI is a hair expensive for that one usage.

Enter the FTDI C232HM cable!

For around $40 (USD) this thing does USB-to-UART out of the box. But additionally you can put it into a multiprotocol mode (MPSSE) and now the sky breaks open, the sun beams flare into beautiful ribbons of light as you observe that you now have JTAG, SPI, and I2C available to you! Oh, and GPIO bit-bang, if that doesn’t suit you.

Pair that cable with the PyFtdi library, well… NOW you’re cookin’.

I personally have used this as a normal USB-to-UART adapter and also used PyFtdi + PySpiFlash (both written by Emmanuel Blot) to program an FPGA’s flash chip. Not at the same time of course, it’s fancy, but not that fancy.

Cable is available in 3.3v and 5v options so take your pick.

And no, I’m not affiliated with FTDI, lol.

1 Like

Agreed @thumbcore ! I’ve always felt like MPSSE is under appreciated – you can do some very cool things with it!

At Pebble, we at a 4-channel FTDI chip with MPSSE built into our development boards. One of the channels was UART, another was SWD, the 3rd was on the main I2C bus, and the 4th one was on a separate bus which connected I2C current sensors attached to all of our main power buses.

We built a very cool application with PyFTDI which could talk to all those channels. My favorite use case was reading from those current sensors to get live power consumption graphs from each subsystem while under load. I wish we’d open sourced that code!

There’s also the Black Magic Probe software, which is open-source. It can be installed on a wide variety of boards, all the way down to the cheap “Blue Pill”, which allows keeping several of them around. The BMP does JTAG/SWD, serial, and SWO. I’ve been using it for many years now (no affiliation, just very happy with it).

I had a BMP years ago, and at the time I had regular issues getting it to work with my project (a TZ1200 based device at the time). Loved the concept though!

Very low budget opportunity: Segger offers on its site a reflash tool for their on-board J-Link software running on different boards. If for example you have a STM32 NUCLEO64 evaluation board, the on-board ST-Link software is replaceable and you can even disconnect the on-board hardware and use it as J-Link for a different MCU.