Welcome to MicroPython on FPGAs
Gateware is the name we use for the hardware code that is loaded onto the FPGA that MicroPython runs on.
- Ewen wrote detailed instructions for the MimasV2
Developing in MicroPython environment
- get lm32 toolchain
- git clone https://github.com/upy-fpga/micropython.git
- cd litex
- Download prebuilt gateware + headers using
- Compile micropython
- Load micropython
Developing in HDMI2USB LiteX environment
- Follow getting started instructions to setup gateware environment.
- Enter the gateware environment with ./scripts/enter-env.sh
- Set PLATFORM and TARGET correctly - IE “export PLATFORM=mimasv2” if using the MimasV2
- Build the gateware with
- 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.
MimasV2 - $50 USD, Spartan 6 board with DDR memory.
These targets don’t need any physical hardware and are good for testing / developing.