Embedded Rust in Fifteen Minutes

Embedded Rust in Fifteen Minutes

James Munns

@bitshiftmask

james.munns@ferrous-systems.com

2019-03-16

Before We Start…

What is Rust

A Systems Language

Based on LLVM

2006

Just a personal project

2009

Official Mozilla Project

2015

Stable 1.0 Release

2018

Stable Embedded Systems Support

Stability in Rust

Don’t Break Userspace

What Does the Language Want?

Focused on Safety

But Also Developer Convenience

But Also Performance

Fast, Reliable, Productive: Pick Three

It Doesn’t Have to be Hard to Write

It Doesn’t Have to be Hard to Get Right

Toolchain Setup

Install Rust

https://rustup.rs

Out of the Box

Rustup, Cargo, and Rustc

Cross Compiling to Embedded?

rustup target add thumbv7em-none-eabihf

Cargo

A build system and package manager

$ tree .
.
├── Cargo.toml
└── src
    └── main.rs
[package]
name = "sensor-node"
version = "0.1.0"
authors = ["James Munns <james.munns@ferrous-systems.com>"]
edition = "2018"

[dependencies]
panic-ramdump   = "0.1.0"
nb              = "0.1.1"
cortex-m-rtfm   = "0.4.1"
nrf52832-pac    = "0.6.0"

Blinking a light

2019

A 1.0 Ecosystem

Thank you!

Plugs

icon by Freepik from flaticon.com

Ferrous Systems

ferrous-systems.com

Embedded Rust in Fifteen Minutes

James Munns

@bitshiftmask

james.munns@ferrous-systems.com

https://github.com/ferrous-systems/rust-in-fifteen-mins