The ESP32 Is the Chip That Keeps on Giving, This Time as a Wi-Fi JTAG Programmer for the ECP5!

Wi-Fi bitstream programming for FPGAs, for a few bucks is pretty darn impressive.

Tom Fleet
4 years agoPython on Hardware

I was scrolling through the Twittersphere the other day, and swept past what I must admit I initially took as YAEN — Yet Another ESP32 Node board.

Thankfully, I was mistaken in this rushed assessment!

This rather unassuming looking PCB from Goran Mahovlic happened to sit in line with a few choice words in the tweet that my eyes thankfully caught — namely ECP5 and JTAG.

Looks like we've got an ESP32-based (at the minimum) JTAG programmer for Lattice ECP5 parts. That's worthy of some investigation, let's dig in!

Radiona... Rings a bell...

The combination of a Lattice Semiconductor ECP5, in conjunction with an ESP32 isn't a new one, we've seen this before in a very popular development board known as the Radiona ULX3S.

In fact, the ULX3S is a fitting board example to think of, as it turns out that this is a somewhat circular reference to the sources for the firmware used on these stand-alone ESP32-JTAG pods — both the esp32ecp5 firmware and the ULX3S repositories, are perhaps unsurprisingly, both released by GitHub user emard!

MicroPython magic

Written in just about 700 lines of MicroPython, the firmware created by emard offers a significant amount of functionality! It enables the ESP32 hardware to do some pretty impressive things — as far as a few dollars worth of Wi-Fi-enabled MCU are concerned, anyway!

Making use of webrepl, one is able to remotely interact with the micropython interpreter running on the ESP32 module, giving them the ability to enter micropython code directly, or call loaded functions directly.

With the ability to also upload files (e.g. bitstreams) to the device through HTTP GET/POST, FTP(!) or even from local storage, the code — as supplied — makes programming a bitstream over Wi-Fi as easy as the following few Python commands;

import ecp5
ecp5.prog("blink.bit")
99262 bytes uploaded in 142 ms (675 kB/s)

ecp5.prog("filepath_or_url") uploads to FPGA SRAM.
ecp5.flash("filepath_or_url", addr=0x000000) uploads to SPI CONFIG FLASH

While we can see that the roots of this project very plainly targeted the Lattice ECP5 FPGA / ESP32 combo that emard has put together on the ULX3S board, we are glad to see Mahovlic taking some interest in splitting the functionality off into a standalone Wi-Fi programming pod.

We can his hardware sat happily mounted upon the JTAG header of a physically separate Lattice ECP5 target board in the picture below.

Not only is that an attractive tool for use with any of the popular maker boards based around the ECP5 (Like the incredible Orange Crab Feather from GsD for example...), but it also would pair very nicely with the wide range of cheap ECP5 boards that have flooded the market — originally designed to drive masses of RGB LED panels, they now serve as versatile and incredibly cheap platforms (if you don't mind a little bit of hacking and modification to get bi-directional I/O...)

As this wasn't an attractive enough rabbit hole to fall down and spend a weekend playing with, I'm really keen to see how Mahovlic gets on with his intents to port it over to work with the Xilinx and Altera bitstreams and programming q̶u̶i̶r̶k̶s̶ ̶ interfaces.

There's already been some footsteps in that direction thankfully with the previous rbp version of the firmware from emard, so we can't wait to see Mahovlic's developments in this direction!

Go and wing some bitstreams over Wi-Fi!

While we haven't seen any yet, we hope to soon see a set of board files for this handy little helper board, but really, this is as simple as wiring a few I/O from the many capable ones on the ESP32 chip to the JTAG pins of the target device — the selection is somewhat documented within the rbp implementation — the original firmware that the MicroPython release supersedes.

There's a been lot to take in in a very rapid fire fashion in this flurry of excitement, so here's a bootstrap for the TLDR crowd; now go get programming!

Tom Fleet
Hi, I'm Tom! I create content for Hackster News, allowing us to showcase your latest and greatest projects for the world to see!
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles