Happy May to all Fomu backers. In this update, we'll talk about all of the amazing progress being made to bring Fomu to you. There has been a lot of progress on the software side, and we implemented a debugging mode that we think you'll really like. Finally, if you're in the Portland, OR, USA area this weekend, stop by and say hello!
Latchup is a conference dedicated to open silicon. When you make a chip, it is important to simulate it in software first, and then run it in an FPGA to make sure the design is good. Only then do you send it to production. Because of this, FPGAs are a natural fit for open silicon. And with Fomu using an open toolchain, we think this fits in nicely with the theme of the conference.
We'll be in Portland this weekend (May 3, 4, and 5), so if you're in the area stop by and say "Hi!". We're always on #tomu on IRC, so you can contact us to find out where we are.
Now that USB has started to stabilize, we've turned towards the software stack that powers Fomu. While we would like to have a more friendly-to-use "mass storage" interface, we're starting off with a simple Device Firmware Update (DFU) interface, just like with Tomu. DFU is very simple from a programming standpoint, and Tomu proved that the user interface is simple as well. Initial Fomu units will ship with a DFU interface, and we'll upgrade later to a fancier interface.
The DFU bootloader runs on a RISC-V core, and lets you load software via USB. This software can be either an ICE40 FPGA bitstream, or a RISC-V program. If you load a bitstream, the FPGA will reset itself and load your new bitstream. However, if you load a RISC-V program, the bootloader will exit and load your program.
As part of an experiment in USB reliability and programming, we completed an initial port of Micropython. This port simply presents a Python REPL over a simulated USB serial port. By implementing this, we were able to test multiple endpoint support as well as loading large files over USB -- the full interpreter weighed in at over 120 kilobytes! Eventually we intend to ship the Python interpreter as part of the main system, and have the bootloader enter the interpreter if you upload a Python script as a program. For now, it's very nice to know that Python fits on Fomu, giving you Python in your USB port!
We've also been hard at work getting debugging working over USB. Fomu uses an internal bus called Wishbone to communicate with all of its peripherals. Wishbone connects the CPU to its memory, as well as peripherals such as USB, the LED, and the touchpads. When the CPU wants to turn on the LED, it writes a value to a special area of memory that causes the LED to turn on.
Thanks to the architecture of LiteX, we were able to modify the USB core to act as a Wishbone master, meaning the USB core can now write to any area of memory. As part of these modifications, we had the USB core look for a special kind of packet, which allows us to read and write memory from the host. This gives us all sorts of cool abilities such as debugging the CPU from your host PC, even if you reset the CPU. This debugger was super helpful in bringing up the Python port, and we'll write about it more in a future update!
All in all, it's been a very productive month. Once again, if you're in Portland, OR, USA this weekend, come on over and say hello. We'll be refining the Fomu software and getting feedback, and making sure it works with as many devices as we can find. Thank you again for your support.
Sean "xobs" Cross