#micro-controller #cortex-m #hal #nrf #arm

no-std microbit-common

Implementation details for the BBC Micro:bit board support crates

8 releases (5 breaking)

0.15.1 Aug 5, 2024
0.15.0 Jun 19, 2024
0.14.0 Apr 19, 2024
0.13.0 May 24, 2022
0.10.1 May 25, 2021

#1804 in Embedded development

Download history 380/week @ 2024-08-21 335/week @ 2024-08-28 408/week @ 2024-09-04 356/week @ 2024-09-11 364/week @ 2024-09-18 325/week @ 2024-09-25 260/week @ 2024-10-02 310/week @ 2024-10-09 340/week @ 2024-10-16 319/week @ 2024-10-23 305/week @ 2024-10-30 157/week @ 2024-11-06 158/week @ 2024-11-13 258/week @ 2024-11-20 361/week @ 2024-11-27 242/week @ 2024-12-04

1,031 downloads per month
Used in 5 crates (2 directly)

0BSD license

75KB
1K SLoC

microbit

microbit contains everything required getting started using Rust to create firmwares for the fabulous BBC micro:bit microcontroller board. This little board has everything and a kitchen sink built-in, even a capable debugging interface.

Getting started

All you need to start programming this device is:

  • A BBC micro:bit board
  • A computer (macOS and Linux work perfectly, Windows tested as well)
  • A bit of open source software

Know your version

The micro:bit comes in different versions. There is a separate crate for each major board version. See the table below to identify which crate you need to use.

Crate Board version Board image Docs crates.io target
microbit V1 docs.rs crates.io thumbv6m-none-eabi
microbit-v2 V2 docs.rs crates.io thumbv7em-none-eabihf

Install dependencies

The examples make use of some of the fantastic tooling from the knurling and probe-rs projects. In order to run the examples you need to install probe-rs and flip-link.

> cargo install probe-rs-tools flip-link

Run an example

The first thing to try is one of the examples in this repository. Plug in your micro:bit and run one of the commands below.

For micro:bit V1

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

For micro:bit V2

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

You should see a lot of build output, the orange LED on the back of the micro:bit should flash quickly, and a message should appear on the LED display.

Congratulations! You've flashed your first Rust program onto your micro:bit!

Further reading

A guide to embedded development with Rust on the micro:bit using this crate can be found in the MicroRust book.

Other useful resources:

License

0-clause BSD license.

Dependencies

~0–2.3MB
~58K SLoC