Rust on Circuit Playground Express

Rust support for embedded systems is evolving very fast. There are many resources available if you want to start using rust for your next embedded system project.

The embedded rust book explains how rust can be used with various peripherals available on embedded platforms.

The awesome embedded rust repo contains various resources and crates available for using rust on embedded systems. This repo also has exhaustive list of boards on which rust is supported.

rust blink example

Last weekend I thought I will just give it a shot and try run it on Adafruit express board. It just took couple of minutes to run the rust blink example on circuit playground express board.

Embedded rust setup

First we need install rust itself, go to rustup and run the rustup-init executable, it will setup your rust environment. Then run the following commands to setup cross compile toolchain and to clone the example git repo

rustup target add thumbv6m-none-eabi
cargo install cargo-hf2 
git clone https://github.com/atsamd-rs/atsamd.git
cd atsamd/boards/circuit_playground_express

Flashing rust blink example

To flash the example to express board, we need to put the board in bootloader mode (press the reset button twice). Run the following command from playground express example code directory to flash the code.

cargo hf2 --release --example blinky_basic
embedded rust on circuit playground express
One Comment

Add a Comment

Your email address will not be published. Required fields are marked *