Skip to content

Rust on micro:bit

Sam Greenbury edited this page Mar 13, 2023 · 2 revisions

Code

Clone microbit-rs fork providing Rust code and examples:

git clone https://github.com/alan-turing-institute/microbit-rs

Install

  1. Install Rust using Rustup
  2. From the command line, install toolchain required for micro:bit target:
    rustup target add thumbv7em-none-eabihf # for micro:bit V2
    rustup target add thumbv6m-none-eabi    # for micro:bit V1
  3. Install additional dependencies:
    cargo install probe-run flip-link

Example

With a connected micro:bit V2, the following example should run from the root of the microbit-rs repo:

cargo run --release --manifest-path ./examples/display-text-rtic/Cargo.toml --features v2 --target thumbv7em-none-eabihf

For a micro:bit V1:

cargo run --release --manifest-path ./examples/display-text-rtic/Cargo.toml --features v1 --target thumbv6m-none-eabi

Clone this wiki locally