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.7.tar.gz (70.2 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.7-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpbuild-0.7.tar.gz
Algorithm Hash digest
SHA256 eba8c4b321af82fac1dd568089e895dc71ed8d05e088121b3050f7a680356a0d
MD5 c55ef660c7c5ad3fe0b7cb7335b84bd9
BLAKE2b-256 acb9f300dc28eb21d3c7262820a94ceeb26683530b3325b3b7f38b0c771ae361

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mpbuild-0.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d812f60e9125be23c1aa5a4f04ddefa1ca38813080d233d1a16f884226f1b345
MD5 fbdf2e0875af9fe95b2afe65291319ca
BLAKE2b-256 7f91f8472b7418233bab7432a09bd4ed57eaeba46ad1eb7c5ace32916b7400cd

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