TinyFPGA BX secrets

Posted on April 10, 2021
Tags: electronics

Nearly three years ago, I bought a TinyFPGA BX, thinking it would be interesting to play around with at some point. It’s been just sitting in a box, waiting patiently for me, and I finally got it out last month.

I followed the user guide, but immediately ran into problems. Selecting “Upload” from the “Apio” menu in Atom just resulted in the error message “Error: board TinyFPGA-BX not connected”.

I dug a bit deeper, and learned how to run tinyprog from the command line. (Because the IDE was hiding the real error message from me, and because I just don’t like IDEs anyway.) tinyprog was throwing an exception, saying that the serial port did not exist. This seemed weird, since tinyprog was the one who chose the serial port to use in the first place, and the solution was not obvious to me.

I asked some questions on the TinyFPGA Discourse and on Stack Exchange. Asking on Stack Exchange went about as well as Stack Exchange usually does, which is to say that people rushed to berate me for asking the question in the first place, without providing any constructive suggestions.

Although it required waiting a few days for a response, the TinyFPGA Discourse proved to be much more fruitful in the end.

The main problem, which prevented the board from being programmed at all, was that TinyFPGA BX and my computer’s USB ports (all of them) did not get along, for unknown reasons. The solution was to put a powered USB hub between the computer and the TinyFPGA.

Now the TinyFPGA could be programmed, but tinyprog still threw an exception after successfully programming the board. This problem turned out to be caused by modemmanager, a mysterious daemon that runs on Ubuntu, which pokes random serial ports at inappropriate times.

I disabled modemmanager with:

$ systemctl disable ModemManager.service
Removed /etc/systemd/system/dbus-org.freedesktop.ModemManager1.service.
Removed /etc/systemd/system/multi-user.target.wants/ModemManager.service.
$ systemctl stop ModemManager.service

and now tinyprog programs the board without throwing an exception.

So far, so good. Next, I need to learn Verilog! (I read some Verilog other people had written at my job at Fulcrum Microsystems back 15 years ago or so, but I didn’t write any myself.)