.cargo | ||
.vscode | ||
src | ||
.envrc | ||
.gitignore | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
COPYING | ||
flake.lock | ||
flake.nix | ||
memory.x | ||
nrf52833.svd | ||
README.md | ||
rust-toolchain.toml | ||
screenshot.jpg |
Micro-Rust
A sample project for rust and embassy on a micro:bit.
It uses the buttons to cycle through predefined led patterns.
Building
The recommended way is to use nix with nix flakes. It still is not for the faint of heart but worth the investment.
Otherwise, rustup and other tools can be installed manually.
Nix
Install nix and enable nix flakes.
Enter the dev environment with nix develop
. From there on the usual rust
commands work.
Manual Way
Install rustup, probe-rs and
flip-link. When running rust
commands (such as cargo build
), rustup should pull in the specified toolchain.
Usage
Connect the micro:bit to the computer and verify that it is listed when running
probe-rs list
(if multiple probes are recognized, add -- --probe <ID>
to
subsequent cargo run
calls <ID>
being the relevant probe id).
Using the normal cargo run
command, will build the project, flash it onto the
microcontroller and run it.
Use the buttons to cycle through the different patterns.
License
Licensed as GPLv3 (apart from nrf52833.svd which is BSD-3-Clause and only used for debugging).