Rust demos running on the BBC micro:bit
leds- Blinking LED patternserial_buttons- Sends button state over serialserial_buttons_interrupt- Sends button state over serial, interrupts on button press/releaseserial_echo- Echos any serial data receivedserial_random- Generates random bytes and sent over serialsnake- Classic snake game
snake.mp4
rustup target add thumbv6m-none-eabiarm-none-eabi-gdb- GDB debugger for Armopenocd- Open On-Chip Debuggerpicocomorminicom- Terminal emulator
The Installation guide in The Embedded Rust Book has tips to install some of these tools on different platforms.
Connect BBC micro:bit via USB and flash a given demo.
bin/flash demo_nameThe micro:bit will automatically reboot and start running the demo.
Some demos communicate over serial. For these demos start a console session in a
separate terminal window. The provided shell script expects the USB console
device at /dev/ttyACM0, update this if required. On macOS this may be something like /dev/cu.usbmodem14412.
bin/consoleTo debug a program on the micro:bit first start the debug server.
bin/debug_serverStart a GDB session for a given demo.
bin/debug demo_nameLicensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.