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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpbuild-0.9.tar.gz
Algorithm Hash digest
SHA256 4dbce8d5474d52f500c068a570ef7b5002125feb767b9974b9d7f9162bea9a48
MD5 eb99ed54bdabba9b2dc79b1f80dfc2c0
BLAKE2b-256 35881d2db0941d76989ffe0a166647e98f09a8ef1f64c78c5ba7124b6ecb4050

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for mpbuild-0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 ece1df6bf9b0c242645fcf78117b9a7ae031a7db5abb34a3a0c913681c43e77c
MD5 2c5c5708d88fc05047aca09d93f2537a
BLAKE2b-256 c991187e2864c7db812f13a5af541921f145f64db2bdf7707431869c9d633488

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