Rust is a systems programming language that places an emphasis on memory and concurrency safety. Because of these factors, it is gaining traction in the embedded community.
Table of Contents:
Books
- Official Rust Programming Book [free online]
- This book is approachable and worth spending a few hours reading and working through it.
- Embedded Rust Book [free online] is meant for embedded developers learning rst.
- Discovery is a variant intended for those also learning embedded at the same time.
- Programming Rust: Fast, Safe Systems Development
- Rust Atomics and Locks: Low-Level Concurrency in Practice by Mara Bos (Book)
- Awesome Embedded Rust collection
From Around the Web
- Cliffle: Prefer Rust to C/C++ for New Code
- Dion analyzes the state of Rust for embedded development as of September 2023.
Learning Rust
- Rust by Example
- Learn Rust the Dangerous Way – Cliffle
- Learning Rust for Embedded Systems by Steve Branam
- Niko’s intro_rust – screencasts for learning Rust
- Cheatsheet for Confusing Rust Terms
- Ferrous Systems: Rust Training Material
- Rust ownership, the hard way – an article by Chris Morgan
- Stratify Labs shared an extensive comparison between C++ and Rust, which will be useful learning shortcut for any C++ developer that’s making a foray into Rust land.
- A Firehose of Rust for People Who Know C++ (video)
Code Analysis
- This series, from Ferrous Systems, describes the performance improvement work done on
rustls. - Lock-free ring buffer implementation for maximum throughput | Maya’s Programming & Electronics Blog
Rust for Embedded
-
Embedded Rust Book [free online]
-
Accessing Hardware in Rust by Ferrous Systems
-
Rust embedded-hal v1.0 was released in 2024
-
repository, the API documentation and the migration guide
The
embedded-halcrates provide traits (interfaces) for using peripherals commonly available in microcontrollers such as GPIO, UART, SPI or I2C. They allow writing drivers (for sensors, displays, actuators, network adapters, etc.) in a generic way, so they work on any microcontroller with anembedded-halimplementation without modifying them. It’s a central piece of the Embedded Rust ecosystem, ensuring interoperability throughout.The 1.0 release has been in the works since 2020. Now that it’s out, we consider all traits in it to be stable. The plan is to extend
embedded-halwith more traits in future 1.x releases, not doing more breaking changes (i.e. there are no plans for a 2.0 release). This will provide a stable base for building HALs and drivers.
-
Safety-Critical Rust
Ferrous Systems has been working on qualifying Rust for safety-critical system development with its Ferrocene toolchain.
Rust Patterns
- Cliffle: The Typestate Pattern in Rust
- Using
mem::taketo reduce heap allocations - Brave new I/O | Embedded in Rust
- Memory safe DMA transfers | Embedded in Rust
Mixing Languages
- Mixing C++ and Rust for Fun and Profit: Part 1 by Loren Burkholder
- Deploying Rust in Existing Firmware Codebases, by Ivan Lozano and Dominik Maier, Android Team, describes a strategy for gradually integrating rust components.
« Back to Glossary Index
