Build MicroPython firmware with ease!
Project description
mpbuild
Build MicroPython firmware with ease!
mpbuild builds MicroPython firmware in containers so you don't need to install any compiler toolchains or development tools. It knows which containers to use for each board so the appropriate build tools are used.
Table of Contents
Usage
mpbuild is intended to be executed in the root of a MicroPython repository. Help text (accessed with adding --help) is extensive and documents advanced options.
[!NOTE] Note that there are some special builds.
unix,webassemblyandwindowscan all be specified asBOARDs but their target isn't a microcontroller. See the MicroPython documentation for details.
[!WARNING] Currently mpbuild is tested on Linux (specifically Ubuntu 24.04 on WSL on Windows 11) but it's intended to work on any platform that supports Docker.
Build a board, with optional variant:
mpbuild build BOARD [VARIANT]
Remove build artifacts:
mpbuild clean BOARD [VARIANT]
List the available boards, optionally filter by the port name.
Displays the board names (as a clickable link), variants and number of boards per port:
mpbuild list [PORT]
Advanced Usage
Validate the state of all images referenced in board definitions:
mpbuild check_images
Use as a Module
[!CAUTION] This is very much a work-in-progress and the API is subject to change.
mpbuild can also be used from Python as a module. This allows it to easily be integrated into other tools.
Example:
import mpbuild
mpbuild.build("RPI_PICO")
mpbuild.list()
Installation
uv tool install mpbuild
Or use pipx, pip etc.
After installation, you may want to also install command-line tab completion for your shell (bash, zsh, fish and PowerShell are supported). Tab completion includes the various mpbuild commands as well as the board names and variants:
mpbuild --install-completion
Prerequisites
A clone of MicroPython (or a fork):
git clone git@github.com:micropython/micropython.git
Docker is currently necessary for managing containers and must be installed and available on your system path.
Examples
$ mpbuild build RPI_PICO
# Downloads appropriate containers and builds firmware for the Raspberry Pi Pico
$ mpbuild list rp2
๐ MicroPython Boards
โโโ rp2 19
โโโ ADAFRUIT_FEATHER_RP2040
โโโ ADAFRUIT_ITSYBITSY_RP2040
โโโ ADAFRUIT_QTPY_RP2040
โโโ ARDUINO_NANO_RP2040_CONNECT
โโโ GARATRONIC_PYBSTICK26_RP2040
โโโ NULLBITS_BIT_C_PRO
โโโ PIMORONI_PICOLIPO FLASH_16M
โโโ PIMORONI_TINY2040 FLASH_8M
โโโ POLOLU_3PI_2040_ROBOT
โโโ POLOLU_ZUMO_2040_ROBOT
โโโ RPI_PICO
โโโ RPI_PICO2 RISCV
โโโ RPI_PICO_W
โโโ SIL_RP2040_SHIM
โโโ SPARKFUN_PROMICRO
โโโ SPARKFUN_THINGPLUS
โโโ W5100S_EVB_PICO
โโโ W5500_EVB_PICO
โโโ WEACTSTUDIO FLASH_2M, FLASH_4M, FLASH_8M
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpbuild-0.5.tar.gz.
File metadata
- Download URL: mpbuild-0.5.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc1e1d78bb1709fdb5d1b51a853c0e36495d92359631e8b6ca4151dd289df6ea
|
|
| MD5 |
689e203cc62e46de53f0e074dfaa3662
|
|
| BLAKE2b-256 |
6ceb2af3fdb1e244c0096a4fa53cd5369c6207ec17ceb7be47256a04956d7925
|
File details
Details for the file mpbuild-0.5-py3-none-any.whl.
File metadata
- Download URL: mpbuild-0.5-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5778f6c1f8f048546c5e68c0c41ae9c30bdd4a3edd4fda01d2d8d5481dd2f25d
|
|
| MD5 |
efb8a520d2be3d267159873c7be57405
|
|
| BLAKE2b-256 |
2646fda1cedb90f6dc52d0d40e9c228c24ded1907d44415c21b450a68ed11439
|