Skip to main content

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, webassembly and windows can all be specified as BOARDs 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

mpbuild-0.6.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpbuild-0.6-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file mpbuild-0.6.tar.gz.

File metadata

  • Download URL: mpbuild-0.6.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for mpbuild-0.6.tar.gz
Algorithm Hash digest
SHA256 649172aea833591d291d405cb5dc75378419bc059113bd614792d96bbb77295e
MD5 78b1e48cfb4d7935b7f79596c262fb0f
BLAKE2b-256 392a3c60de094b2c23ecbd46b3718836255f9c2f9ecb179c85800c00d8620a5f

See more details on using hashes here.

File details

Details for the file mpbuild-0.6-py3-none-any.whl.

File metadata

  • Download URL: mpbuild-0.6-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.2

File hashes

Hashes for mpbuild-0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0cbd8788199e43b61858713ec3f084d4cc544dede32e1c26575de77d03260e7f
MD5 af6491a431b648177a986b72615f96af
BLAKE2b-256 b325dbc7e1d9bb193aad594cc393dc66a9e597c9737159f25542133e6097e21e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page