1 of 46

Fomu Workshop

workshop.fomu.im

Please download toolchain while waiting!

(from workshop.fomu.im)

2 of 46

I'm Fomu

fomu.im

Fitting an FPGA in your USB port...

3 of 46

Download toolchain!

Step 1

4 of 46

Tim

"mithro"

Ansell

I'm the "manager"

5 of 46

Michael

"many hats"

Gielda

6 of 46

Sean

"xobs"

Cross

I do the work

xobs.io

7 of 46

Tomu FPGA

  • Lattice iCE40UP5K
  • 5k LUTs + DSP tiles
  • 128kb^ RAM
  • 2064kb^ Flash (QIO, XIP)

  • 1 x RGB LED
  • 2 x ~touch buttons�
  • Fits inside your USB port

^kilobytes

I'm Tomu

j.mp/fomu-cs

Send pull request →

get hardware!

An MCU inside a USB port

8 of 46

Download toolchain!

Step 1

9 of 46

Assembly Fomu

Step 2

10 of 46

Awesome Plastic Case

11 of 46

Awesome Plastic Case

  • Open source
  • FreeCAD models
  • STEP files
    • case
    • tool
  • Same mold base

12 of 46

Download toolchain!

Step 1

13 of 46

Assembly Fomu

Step 2

14 of 46

Do workshop!

workshop.fomu.im

Step 3

15 of 46

16 of 46

An Introduction

17 of 46

Python in your USB Port

18 of 46

Tomu FPGA

FPGA µPython

I'm Tomu

j.mp/fomu-cs

Send pull request →

get hardware!

An MCU inside a USB port

19 of 46

Circuit Python

I'm Tomu

j.mp/fomu-cs

Send pull request →

get hardware!

An MCU inside a USB port

20 of 46

RISC-V in your USB Port

21 of 46

Tomu FPGA

  • Lattice iCE40UP5K
  • 5k LUTs + DSP tiles
  • 128kb^ RAM
  • 2064kb^ Flash (QIO, XIP)

  • 1 x RGB LED
  • 2 x ~touch buttons�
  • Fits inside your USB port

^kilobytes

I'm Tomu

j.mp/fomu-cs

Send pull request →

get hardware!

An MCU inside a USB port

22 of 46

Tomu FPGA

Tools

Could use it just as

  • Development toolchain;
    • (upstream) GCC
    • Bare Metal C
    • Zephyr RTOS
    • (maybe?) UF2 + DFU

CPU!

I'm Tomu

j.mp/fomu-cs

Send pull request →

get hardware!

An MCU inside a USB port

23 of 46

RISC-V - VexRiscv

  • Several designs to choose from
  • Compilers are upstream
  • Embeddable on an ICE40UP5K
  • On-chip Debugger Support

24 of 46

Debugging through USB

25 of 46

Debugging through USB

26 of 46

GDB over USB

[Run gdb over Wishbone over USB]

$ riscv64-unknown-elf-gdb riscv-blink.elf -ex 'target remote localhost:1234'

GNU gdb (GDB) 8.2.90.20190228-git

...

Reading symbols from .\riscv-blink.elf...

Remote debugging using localhost:1234

csr_writel (addr=3758106660, value=1) at ./include/hw/common.h:41

41 *((volatile uint32_t *)addr) = value;

(gdb) bt

#0 0x2004014c in csr_readl (addr=3758106664) at ./include/hw/common.h:46

#1 timer0_value_read () at ./include/generated/csr.h:242

#2 0x200401dc in msleep (ms=ms@entry=80) at ./include/hw/common.h:41

#3 0x20040074 in main () at ./src/main.c:45

(gdb)

27 of 46

FPGA in your USB Port

28 of 46

Tomu FPGA

Tools

Fully

open source

toolchain

�Verilog → Bitstream

Lattice iCE40UP5K

I'm Tomu

j.mp/fomu-cs

Send pull request →

get hardware!

An MCU inside a USB port

29 of 46

Open source tools

  • Compiler - gcc
  • Synthesizer - yosys
  • Place-and-Route - nextpnr
  • Packing - icestorm
  • Bootloader - dfu-utils
  • Interaction - wishbone-tool

Simple installation: just set PATH

30 of 46

Migen - Write Python hardware

  • Outputs Verilog
    • Great for simulation!
    • Helps understand what's�going on inside migen
  • Native finite state�machine support
  • Multiple clock domains
  • No distinction between�"reg" and "wire"

transfer = FSM(reset_state="WAIT_TOKEN")

self.submodules.transfer = transfer

transfer.act("ERROR",

self.error.eq(1),

If(self.reset, NextState("WAIT_TOKEN"))

)

transfer.act("WAIT_TOKEN",

If(rx.o_pkt_start, NextState("RECV_TOKEN"))

)

31 of 46

Emulating the Fomu in your USB Port...

32 of 46

  • Support for whole SoCs
    • RISC-V,
    • Cortex-A,
    • Cortex-M, and
    • other stuff�
  • Platforms are modular and text-based, tweak as you like
  • Same binary runs in Renode and on HW
  • Use for development/debugging and Continuous Integration

33 of 46

Renode Fomu Support!

  • Simulation of VexRiscv
  • Simulation of many LiteX peripherals
  • Working on ValentyUSB simulation�
  • Therefore Fomu configs can be simulated in Renode!
  • Ships with an example Fomu config!

34 of 46

Renode + Fomu via bridge

  • Simulate part in Renode, part on Fomu
  • Communicates over USB-Wishbone bridge

Gives you;

  • precise HW behavior in FPGA, and
  • Renode debugging/testing capabilities

Example;� - Control an LED on Fomu� - Step-by-step tutorial

USB

35 of 46

Renode + Fomu via bridge

36 of 46

37 of 46

The Tomu family!

38 of 46

Tomu

Tim's Open Micro USB

j.mp/tomu-cs

  • ARM Cortex M0+
  • 8k RAM, 64k Flash
  • Build yourself!

39 of 46

Fomu

Fpga Tomu

j.mp/fomu-cs

  • iCE40UP5K FPGA
  • 128kb RAM, 2mb Flash
  • Configurable hardware!

40 of 46

Somu

Security Tomu

j.mp/somu-cs

  • Arm Cortex M4
  • 64kb RAM, 256kb Flash
  • STM32L432KC "Secure Processor"
  • Security Key!

41 of 46

Femu

The Femto ESP32 Tomu

j.mp/femu-had

  • ESP32-D2WD
  • 512kb RAM, 448kb Flash
  • Under current development...
  • Wifi + Bluetooth!

42 of 46

Femu

Wireless Tomu

j.mp/femu-had

  • ESP32-D2WD
  • 512kb RAM, 448kb Flash
  • Uses FTDI, needs soft USB stack!
  • Wifi + Bluetooth!

Womu

43 of 46

Bomu

Bluetooth Tomu

Doesn't exist yet...

  • Arm Cortex M4
  • 256kb RAM, 1mb Flash
  • nRF52840 "Secure Processor"
  • Security Key with� NFC + Bluetooth?

44 of 46

?omu

????? Tomu

What

about

you?

45 of 46

FPGA Tomu

Tomu

46 of 46