Website for MicroPython on FPGAs

View on GitHub

Welcome to MicroPython on FPGAs

MicroPython and Migen, sitting in a tree!]

The aim of this project is to make MicroPython run on FPGAs using the LiteX & Migen+MiSoC technologies. This allows you to do full stack development (FPGA gateware & soft CPU firmware) in Python!


Gateware is the name we use for the hardware code that is loaded onto the FPGA that MicroPython runs on.

For MicroPython development we use a slightly modified version of the HDMI2USB-litex-firmware from the HDMI2USB project.

Getting Started

Developing in MicroPython environment

Developing in HDMI2USB LiteX environment

  1. Follow getting started instructions to setup gateware environment.
  2. Enter the gateware environment with ./scripts/enter-env.sh
  3. Set PLATFORM and TARGET correctly - IE “export PLATFORM=mimasv2” if using the MimasV2
  4. Build the gateware with make gateware
  5. Run ./scripts/build-micropython.sh

This will give you an image for your target at ./build/$PLATFORM_$TARGET_lm32/micropython.bin which you can then flash to your board.

Running MicroPython inside QEmu environment

The HDMI2USB LiteX environment provides some limited QEmu emulation of the FPGA gateware, this means you can test your code without needing hardware.

It can be used with the MicroPython image by running ./scripts/build-qemu.sh and then replacing -kernel qemu.bin with -kernel micropython.bin in the last command.

See the TimVideos’ QEmu for LiteX GitHub Repo

More Information


Current Targets

Hardware Targets

Software Targets

These targets don’t need any physical hardware and are good for testing / developing.