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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpbuild-0.8.tar.gz
Algorithm Hash digest
SHA256 6df4959320fdc36ebb50f903d7d98c60ee1204c9cf6b2f747945b9374013e377
MD5 9524200098cb6621523999d7a457f7e3
BLAKE2b-256 33832983c9b863c6c19bf5b5e361bcb2d0d16fe3fb0136b1c09c7527e8d9e6c5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mpbuild-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 184664658a528533565edff41f102a275d76c073535137af8b158a9af14c4d2f
MD5 cf27203ecbb98aa52f4eeb87361d0e5d
BLAKE2b-256 9e53bae1017df5148180ff7e9bb2061cc17234bc7eff1a3233e1afa648e18a85

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