Fomu: an FPGA in your USB Port

Fomu (with case): an FPGA in your USB port. Crowdfunding now! One week to go. t.xobs.io/fomu

Fomu: An FPGA in your USB Port

A whirlwind introduction to Fomu and FPGAs

Sean Cross - https://xobs.io/ - @xobs

Outline

  1. Fomu Firmware Layout
    1. Bootloader
    2. Recovery
    3. Magic constants
    4. Interpreters
    5. Updates
  2. Loading firmware onto Fomu
  3. Blinkenlights

Workshop Outline

  1. What do I need to get started?
  2. What is Fomu, and what is an FPGA?
  3. What can I do with Fomu?
  4. What makes Fomu special?

What do I need to get started?

  1. Synthesis
  2. Place-and-Route
  3. Packer

What is an FPGA?

An FPGA is like a hardware emulator. It can change itself so that it can take on the characteristics of any other digital logic.

FPGAs are measured in resources called LUTs or LCs.

What is Fomu?

Fomu is an FPGA that fits in your USB port. It has foru buttons, 2 MB of SPI flash, an RGB LED, and an ICE40UP5K with 5280 LCs. It also has 128 kB of dedicated RAM, not counting the block RAM. Unlike many other PCBs, Fomu does not have a separate USB controller chip. This means that any projects that want to use the USB port must include a USB softcore.

Fomu Block Design Diagram

ICE40 Features

What is this PCB?

This is Fomu EVT1. This is the original stretch prototype of Fomu. The schematics are the same, but much has changed: * Name changed from Tomu-FPGA to Fomu * Package changed from SG48 to WLCSP32 Additionally, some patches were needed to get this PCB working: * SO-8 for SPI flash was too small * Crystal footprint was upside-down These are yours to take home with you! Differences between EVT1 and EVT3: * Silkscreen on Raspberry Pi header * Populate Raspberry Pi header * Add PMOD pins to touchpads * Swap PMODa pins for I3C

What modifications does it have?

  • Shorting out two zero-ohm resistors
  • Programming SPI flash
  • Bending SPI flash pins inward
  • Mounting crystal on its side
  • Attaching power to crystal

Levels of Fomu

Fomu aims to be accessable on three levels:

  1. Python / Interpreted
  2. RISC-V
  3. Verilog / FPGA

Python / Interpreted

  1. Goal: Multiple interpreters, auto-reload, USB disk interface
  2. Now: MicroPython binary

Loading Programs onto Fomu

dfu-util -l dfu-util -D update.bin

Loading MicroPython

dfu-util -D micropython.dfu

Connecting via serial

Interacting with Fomu

RGB LEDD reference

Future Work

CircuitPython, etc.

RISC-V code

LiteX Machine Model

Wishbone Interface

Wishbone Bridge

Interacting with LEDD directly

Writing RISC-V Code

Hardware Description Language

Yosys and NextPNR

Blinking an LED

LiteX and MiGen

VexRiscv