Getting Started

Set up the toolchain, build the firmware, flash the robot, and run the test suite.

Getting Started

This is the short path from a fresh clone to a running robot. For the full detail — toolchain links, Docker, Yotta, IntelliSense — see the repository README.

Prerequisites

  • GNU Arm Embedded Toolchain (gcc-arm-embedded)
  • Git, CMake, Python 3
  • uv for Python environments

On macOS, the clean setup is:

brew install --cask gcc-arm-embedded
brew install uv

(See the README for the symlink fix if arm-none-eabi-gcc isn’t on PATH.)

Python setup

From the repo root:

uv venv
uv sync

Build the firmware

uv run python3 build.py        # produces MICROBIT.hex in the repo root

Flash the robot — mbdeploy

mbdeploy is the standalone deploy tool. Install it once:

pipx install --editable ./mbdeploy      # or: just mbd-install

Then:

mbdeploy list                  # show connected micro:bit devices
mbdeploy deploy                # auto-detect the robot and flash MICROBIT.hex
mbdeploy deploy --build 1      # build, then flash device #1

A target can be an enum (1), a 5-char board name (ZUVUB), a serial path, or a full pyOCD UID. The deployer reads each device’s DEVICE: type so it never flashes the radio relay.

Tip: always do a --clean build before bench-flashing. Stale incremental builds can flash binaries that compile and pass tests but read garbage at runtime.

Run the tests

The full suite (firmware-logic + host library, ~1000 tests, about a second):

uv run --with pytest python -m pytest -q

Drive the robot

Talk to the robot through the host library / rogo CLI rather than ad-hoc scripts:

uv run rogo --help

The closed-loop linear calibration tool (bench, hardware required):

uv run python tests/calibrate/calibrate_linear.py

Where to go next