Embedded Rust
This is a curated list of resources related to embedded and low-level programming in the Rust programming language, including a selection of useful crates.
This project is developed and maintained by the [Resources team][team].
Don't see something you want or need here? Add it to the Not Yet Awesome Embedded Rust list!
Table of Contents
- Embedded Rust
- Table of Contents
- Community
- Books, blogs, and training materials
- Tools
- Real-time
- Peripheral Access Crates
- HAL implementation crates
- Architecture support crates
- Board support crates
- Component abstraction crates
- Driver crates
- no-std crates
- Firmware projects
- Old books, blogs, and training materials
- License
- Code of Conduct
Community
In 2018, the Rust community created an embedded working group to help drive adoption in the Rust ecosystem.
- Embedded WG, including newsletters with progress updates.
Community Chat Rooms
- You can usually find community members (including embedded WG members) in the official
#rust-embedded:matrix.org
Matrix room. - #rust-embedded-space:matrix.org Most Embedded Rust related Matrix rooms are in the Rust Embedded Space
- embedded.rs-wasm-iot - English Telegram chat about Rust and WASM for microcontrollers and IoT
- embedded.rs - Telegram chat about Rust for microcontrollers in the Russian language.
- #avr-rust:gitter.im - For discussion of using Embedded Rust on AVR devices
- #esp-rs:matrix.org - For discussion of using Embedded Rust on Espressif devices
- #nrf-rs:matrix.org - For discussion of using Embedded Rust on Nordic Semiconductor devices
- #probe-rs:matrix.org - For discussion of the Probe-rs debugging toolkit
- #rp-rs:matrix.org - For discussion of using Embedded Rust on RP2040 based devices
- #rtic-rs:matrix.org - For discussion of the Real-Time Interrupt-driven Concurrency framework
- #rust-embedded-graphics:matrix.org - For discussion of the
embedded-graphics
crate and ecosystem - #stm32-rs:matrix.org - For discussion of using Embedded Rust on STM32 based devices
- #atsamd-rs:gitter.im - For discussions of using Embedded Rust on ATSAMD devices
- #ethercrab:matrix.org - For discussion of general EtherCAT and the Rust implementation, EtherCrab
- rust-embedded:QQ group - Chinese community for Rust embedded
Books, blogs, and training materials
Free and public materials
These materials are available publicly, typically under permissive licenses.
- The Embedded Rust Book - An introductory book about using the Rust Programming Language on "Bare Metal" embedded systems, such as Microcontrollers.
- The Rust on ESP Book - This book aims to provide a comprehensive guide on using the Rust programming language with Espressif SoCs and modules.
- Embedded Rust (no_std) on Espressif - Training for Rust using no_std approach development on ESP32-C3.
- Embedded Rust (std) on Espressif - Training for Rust using std approach development on ESP32-C3 by Ferrous Systems.
- Discovery by @rust-embedded — this book is an introductory course on microcontroller-based embedded systems that uses Rust as the teaching language. Original author: @japaric
- Cortex-M Quickstart by @japaric – a template and introduction to embedded Rust, suitable for developers familiar with embedded development but new to embedded Rust.
- Writing an OS in Rust A blog series creating a small operating system in Rust
- MicroRust Introductory book for embedded development in Rust on the micro:bit.
- Physical Computing With Rust A (WIP) guide to physical computing with Rust on the Raspberry Pi.
- Writing an embedded OS in Rust on the Raspberry Pi A set of tutorials that give a guided, step-by-step tour of how to write a monolithic Operating System kernel for an embedded system from scratch. Runs on the Raspberry Pi 3 and the Raspberry Pi 4.
- Writing embedded drivers in Rust isn't that hard A guide to building an embedded-hal driver. Part 2
- Ferrous Systems' Embedded Training Courses: 2020-current edition A hands-on training course for beginner and advanced learners of Embedded Rust, based on Nordic Semiconductor's nRF52840 hardware. This training was given at Oxidize Conferences and by Ferrous Systems to corporate customers.
- Ferrous Systems' Knurling Sessions are hands-on embedded projects that explore specific concepts using generally available hardware, building full systems and components using microcontrollers, sensors, and actuators.
- DSP on STM32F407G-DISC1 Unofficial oxidization of the Digital Signal Processing using Arm Cortex-M based Microcontrollers: Theory and Practice book. The book isn't necessary to enjoy the examples and learn a functional DSP Rust coding style.
- Building a sailing starter board with Rust (RTIC) A step-by-step story/guide to build STM32-based PCB and program it with Rust for fun and games.
- STM32F4xx with Embedded Rust at the HAL A blog containing a series of tutorials demonstrating the use of several peripherals through simple examples leveraging the stm32f4xx-hal crate.
- Embedded Rust programming playlist Various livestreams with Embedded Rust live coding
- ESP32-C3 Rust Tutorials Short videos and Github project implementing various peripherals of the ESP32-C3 with the end goal of creating a complete data logger application.
- Tweede golf's workshop - A full workshop about Rust and embedded Rust. The embedded parts use the nRF52840-DK and a LIS3DH breakout board. (github source)
Paid and commercially available materials
These materials are available for purchase. They have been reviewed for relevancy, but are not specifically endorsed or reviewed for accuracy or quality by the Embedded Working Group.
- Simplified Embedded Rust: Standard Library Edition - This book provides a quick path to start learning embedded Rust with minimal setup. Book is based on ESP devices and the Wokwi Simulator. This edition uses the standard library development approach which is based on the ESP-IDF framework.
- Simplified Embedded Rust: Core Library Edition - This book provides a quick path to start learning embedded Rust with minimal setup. Book is based on ESP devices and the Wokwi Simulator. This edition uses the core library development approach for bare metal development.
Tools
- xargo Rust package manager with support for non-default std libraries — build Rust runtime for your embedded system.
- xargo is great, but since it's in maintenance mode, cargo-xbuild is catching up as its intended replacement.
- svd2rust Generate Rust structs with register mappings from SVD files.
- edc2svd Generate SVD files for PIC32 devices from EDC files. -
- [embedded-hal-mock] Mock implementation of
embedded-hal
traits for testing without accessing real hardware. - - bindgen Automatically generates Rust FFI bindings to C and C++ libraries. -
- cortex-m semihosting Semihosting for ARM Cortex-M processors
- bobbin-cli A Rust command line tool to simplify embedded development and deployment.
- ferros A Rust-based userland which also adds compile-time assurances to seL4 development.
- cargo-flash A small cargo subcommand to download your binary to your target chip. -
- cargo-embed A superset of cargo-flash with additional useful features like configuration file support, an RTT terminal, or a GDB server. -
- cargo-hf2 A small cargo subcommand to download cargo builds to Microsoft UF2 bootloaders via HID USB . -
- cargo-bloat Find out what takes most of the space in your executable.
- cargo-call-stack Static, whole program stack usage analyzer.
- cargo-dfu Cargo extension for flashing embedded rust programs via DFU.
- espflash Serial flasher utility for Espressif SoCs and modules. -
- espup Tool for installing and maintaining Espressif Rust ecosystem. -
- uf2 Converts binary files to Microsoft's UF2 format for copying over to mass storage device uf2 bootloaders -
- Knurling Tools are developed by Ferrous Systems to ease the development process for building, debugging, and testing embedded Rust systems. These tools include:
- Probe Run: a cargo runner to flash and run