Curated list of resources for Embedded and Low-level development in the Rust programming language
Go to file
2020-09-01 01:54:19 +02:00
.github set up CI 2019-03-06 19:00:01 +01:00
.travis.yml set up CI 2019-03-06 19:00:01 +01:00
CODE_OF_CONDUCT.md README: mention the CoC and who maintains this repo 2018-08-07 00:36:02 -05:00
Code-of-Conduct.md Mention EWG as point of contact 2018-04-21 10:38:20 +03:00
CONTRIBUTING.md Clean up contribution guidelines 2018-04-21 10:38:20 +03:00
LICENSE-CC0 initial commit 2018-04-01 23:17:28 +02:00
README.md Add static-bytes crate link 2020-09-01 01:54:19 +02:00
rust-embedded-logo-256x256.png Add logo 2018-04-06 18:03:26 +02:00

Embedded Rust

Awesome

This is a curated list of resources related to embedded and low-level programming in the programming language Rust, including a list of useful crates.

This project is developed and maintained by the Resources team.

Don't see something you want or need here? Add it to the Not Yet Awesome Embedded Rust list!

Table of contents

Community

In 2018 Rust community has created an embedded workgroup to help drive adoption in the Rust ecosystem.

Books, blogs and training materials

  • The Embedded Rust Book - An introductory book about using the Rust Programming Language on "Bare Metal" embedded systems, such as Microcontrollers.
  • 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 to embedded development but new to embedded Rust.
  • Exploring Rust on Teensy by @branan — Beginner set of articles on getting into embedded dev in Rust.
  • Pragmatic Bare Metal Rust A starter article about starting Rust development on STM32 microcontrollers (cubeMX + FFI).
  • Using Rust in an Embedded Project: A Simple Example Article and some links on setting up Rust cross-compiling.
  • Robigalia general purpose robust operating system in Rust running on secure seL4 microkernel.
  • intermezzOS A small teaching operating system in Rust. A book with some explanations is also included.
  • Raspberry Pi Bare Metal Programming with Rust
  • Fearless concurrency by @japaric — How to easily develop Rust programs for pretty much any ARM Cortex-M microcontroller with memory-safe concurrency.
  • 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.
  • Internet of Streams A video series by @jamesmunns building a bare metal IoT Sensor Node Platform from (nearly) scratch in Rust
  • 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.

Tools

  • xargo Rust package manager with support for non-default std libraries — build rust runtime for your own embedded system.
    • xargo is great but it's in maintenance mode, cargo-xbuild is catching up as intended replacement.
  • svd2rust Generate Rust structs with register mappings from SVD files.
  • μtest unit testing for microcontrollers and other no-std systems.
  • embedded-hal-mock Mock implementation of embedded-hal traits for testing without accessing real hardware. - crates.io
  • bindgen Automatically generates Rust FFI bindings to C and C++ libraries. - crates.io
  • cortex-m semihosting Semihosting for ARM Cortex-M processors
  • bobbin-cli A Rust command line tool to simplify embedded development and deployment.
  • cargo-fel4 A Cargo subcommand for working with feL4 projects. - crates.io

Real-time

Real-time Operating System (RTOS)

  • Drone OS An Embedded Operating System for writing real-time applications in Rust.
  • FreeRTOS.rs Rust interface for the FreeRTOS API
  • Tock An embedded operating system designed for running multiple concurrent, mutually distrustful applications on low-memory and low-power microcontrollers

Real-time tools

  • RTFM v0.5 Real-Time For the Masses — A concurrency framework for building real time systems:

Peripheral Access Crates

Register definition for microcontroller families. Usually generated using svd2rust. - crates.io

Peripheral Access Crates were also called Device Crates.

NOTE You may be able to find even more peripheral access crates by searching for the svd2rust keyword on crates.io!

Microchip

  • atsamd11 Peripheral access API for Microchip (formerly Atmel) SAMD11 microcontrollers. This git repo hosts both the peripheral access crate and the hal.
  • atsamd21 Peripheral access API for Microchip (formerly Atmel) SAMD21 microcontrollers. This git repo hosts both the peripheral access crate and the hal.
  • atsamd51 Peripheral access API for Microchip (formerly Atmel) SAMD51 microcontrollers. This git repo hosts both the peripheral access crate and the hal.
  • atsame54 Peripheral access API for Microchip (formerly Atmel) SAME54 microcontrollers. This git repo hosts both the peripheral access crate and the hal.
  • avr-device Peripheral access API for Microchip (formerly Atmel) AVR microcontroller family.
  • sam3x8e Peripheral access API for Atmel SAMD3X8E microcontrollers (generated using svd2rust) - crates.io

Nordic

  • nrf51 Peripheral access API for nRF51 microcontrollers (generated using svd2rust) - crates.io
  • nrf52810-pac - Peripheral access API for the nRF52810 microcontroller (generated using svd2rust) - crates.io
  • nrf52832-pac - Peripheral access API for the nRF52832 microcontroller (generated using svd2rust) - crates.io
  • nrf52840-pac - Peripheral access API for the nRF52840 microcontroller (generated using svd2rust) - crates.io

NXP

SiFive

Silicon Labs

  • efm32pg12-pac - Peripheral access API for Silicon Labs EFM32PG12 microcontrollers - crates.io

STMicroelectronics

The stm32-rs project has peripheral access APIs for most STM32 microcontrollers (generated using svd2rust):

Texas Instruments

  • tm4c123x Peripheral access API for TM4C123x microcontrollers (generated using svd2rust)
  • tm4c129x Peripheral access API for TM4C129x microcontrollers (generated using svd2rust)

MSP430

Ambiq Micro

  • ambiq-apollo3-pac Peripheral access API for Ambiq Apollo3 microcontrollers (generated using svd2rust)

GigaDevice

  • gd32vf103-pac Peripheral access API for GD32VF103 RISC-V microcontrollers (generated using svd2rust) - crates.io

XMC

Peripheral access crates for the different XMC4xxx families of microcontrollers

HAL implementation crates

Implementations of embedded-hal for microcontroller families and systems running some OS. - crates.io

NOTE You may be able to find even more HAL implementation crates by searching for the embedded-hal-impl and embedded-hal keywords on crates.io!

OS

  • bitbang-hal software protocol implementations for microcontrollers with digital::OutputPin and digital::InputPin
  • ftdi-embedded-hal for FTDI FTx232H chips connected to Linux systems via USB
  • linux-embedded-hal for embedded Linux systems like the Raspberry Pi. - crates.io

Microchip

  • atsamd-hal - HAL for SAMD11, SAMD21, SAMD51 and SAME54 - crates.io
  • 'avr-hal' - HAL for AVR microcontroller family and AVR-based boards

Nordic

NXP

Also check the list of NXP board support crates!

SiFive

STMicroelectronics

Also check the list of STMicroelectronics board support crates!

Texas Instruments

Espressif

Silicon Labs

  • tomu-hal
    • HAL implementation targeted for Tomu USB board with EFM32HG309F64 ARMv6-M core. Has support to configure tomu bootloader directly from application via toboot_config macro.

XMC

GigaDevice

  • gd32vf103xx-hal - cratex.io
    • HAL for GD32VF103xx microcontrollers
  • gd32vf103-hal - crates.io
    • (WIP) Hardware abstract layer (HAL) for the GD32VF103 RISC-V microcontroller

Architecture support crates

Crates tailored for general CPU architectures.

ARM

  • cortex-a Low level access to Cortex-A processors (early state) - crates.io
  • cortex-m Low level access to Cortex-M processors - crates.io

RISC-V

  • riscv Low level access to RISC-V processors - crates.io

MIPS

  • mips Low level access to MIPS32 processors - crates.io

Board support crates

Crates tailored for specific boards.

Adafruit

Arduino

  • avr-hal - Board support crate for several AVR-based boards including the Arduino Uno and the Arduino Leonardo

Nordic

NXP

SeeedStudio

SiFive

Sipeed

Sony

  • prussia - SDK for the PlayStation 2.

STMicroelectronics

Texas Instruments

  • monotron - A 1980s home-computer style application for the Texas Instruments Stellaris Launchpad. PS/2 keyboard input, text output on a bit-bashed 800x600 VGA signal. Uses menu, vga-framebuffer and pc-keyboard.
  • stellaris-launchpad - For the Texas Instruments Stellaris Launchpad and Tiva-C Launchpad crates.io

Special Purpose

  • betafpv-f3 - For the BetaFPV F3 drone flight controller

Component abstraction crates

The following crates provide HAL-like abstractions for subcomponents of embedded devices which go beyond what is available in embedded-hal:

  • accelerometer - Generic accelerometer support, including traits and types for taking readings from 2 or 3-axis accelerometers and tracking device orientations - crates.io
  • embedded-graphics: 2D drawing library for any size display - crates.io
  • radio - Generic radio transceiver traits, mocks, and helpers - crates.io
  • smart-leds: Support for addressable LEDs including WS2812 and APA102

Driver crates

Platform agnostic crates to interface external components. These crates use the embedded-hal interface to support all the devices and systems that implement the embedded-hal traits.

The list below contains drivers developed as part of the Weekly Driver initiative and that have achieved the "released" status (published on crates.io + documentation / short blog post).

  1. AD983x - SPI - AD9833/AD9837 waveform generators / DDS - Intro blog post - crates.io
  2. adafruit-alphanum4 - I2C - Driver for Adafruit 14-segment LED Alphanumeric Backpack based on the ht16k33 chip - crates.io
  3. ADS1x1x - I2C - 12/16-bit ADCs like ADS1013, ADS1015, ADS1115, etc. - Intro blog post - crates.io
  4. ADXL343 - I2C - 3-axis accelerometer - crates.io
  5. AT86RF212 - SPI - Low power IEEE 802.15.4-2011 ISM RF Transceiver - Intro blog post - crates.io
  6. BlueNRG - SPI - driver for BlueNRG-MS Bluetooth module - Intro post crates.io
  7. BNO055 - I2C - Bosch Sensortec BNO055 9-axis IMU driver - Intro post crates.io
  8. DS1307 - I2C - Real-time clock driver - Intro blog post - crates.io
  9. EEPROM24x - I2C - 24x series serial EEPROM driver - Intro blog post - crates.io
  10. embedded-sdmmc - SPI - SD/MMC Card Driver with MS-DOS Partition and FAT16/FAT32 support - Intro post crates.io
  11. ENC28J60 - SPI - Ethernet controller - Intro blog post - crates.io
  12. HTS221 - I2C - Humidity and temperature sensor - Intro blog post - crates.io
  13. keypad - GPIO - Keypad matrix circuits - Intro post - crates.io
  14. KXCJ9 - I2C - KXCJ9/KXCJB 3-axis accelerometers - Intro blog post - crates.io
  15. L3GD20 - SPI - Gyroscope - Intro blog post - crates.io
  16. LSM303DLHC - I2C - Accelerometer + compass (magnetometer) - Intro blog post - crates.io
  17. MCP3008 - SPI - 8 channel 10-bit ADC - Intro blog post - crates.io
  18. MCP3425 - I2C - 16-bit ADC - Intro blog post - crates.io
  19. MCP794xx - I2C - Real-time clock / calendar driver - Intro blog post - crates.io
  20. MMA7660FC - I2C - 3-axis accelerometer - Intro blog post
  21. OPT300x - I2C - Ambient light sensor family driver - Intro blog post - crates.io
  22. pwm-pca9685 - I2C - 16-channel, 12-bit PWM/Servo/LED controller - Intro blog post - crates.io
  23. rotary-encoder-hal - GPIO - A rotary encoder driver using embedded-hal - Intro blog post - crates.io
  24. SGP30 - I2C - Gas sensor - Intro blog post - crates.io
  25. SH1106 - I2C - Monochrome OLED display controller - Intro post crates.io
  26. shared-bus - I2C - utility driver for sharing a bus between multiple devices - Intro post crates.io
  27. shift-register-driver - GPIO - Shift register - Intro blog post - crates.io
  28. Si4703 - I2C - FM radio turner (receiver) driver - Intro blog post - crates.io
  29. SSD1306 - I2C/SPI - OLED display controller - Intro blog post - crates.io
  30. Sx127x - SPI - Long Range Low Power Sub GHz (Gfsk, LoRa) RF Transceiver - Intro blog post - crates.io
  31. Sx128x - SPI - Long range, low power 2.4 GHz (Gfsk, Flrc, LoRa) RF Transceiver - Intro blog post - crates.io
  32. TMP006 - I2C - Contact-less infrared (IR) thermopile temperature sensor driver - Intro post crates.io
  33. TMP1x2 - I2C - TMP102 and TMP112x temperature sensor driver - Intro blog post crates.io
  34. TSL256X - I2C - Light Intensity Sensor - Intro blog post - crates.io
  35. VEML6030/VEML7700 - I2C - Ambient light sensors - Intro blog post - crates.io
  36. VEML6075 - I2C - UVA and UVB light sensor - Intro blog post - crates.io

NOTE You may be able to find even more driver crates by searching for the embedded-hal-driver keyword on crates.io!

WIP

Work in progress drivers. Help the authors make these crates awesome!

  1. AFE4400 - SPI - Pulse oximeter
  2. APDS9960 - I2C - Proximity, ambient light, RGB and gesture sensor - crates.io
  3. AS5048A - SPI - AMS AS5048A Magnetic Rotary Encoder
  4. AXP209 - I2C - Power management unit
  5. BH1750 - I2C - ambient light sensor (lux meter)
  6. BME280 - A rust device driver for the Bosch BME280 temperature, humidity, and atmospheric pressure sensor and the Bosch BMP280 temperature and atmospheric pressure sensor. crates.io
  7. bme680 - I2C - Temperature / humidity / gas / pressure sensor - crates.io
  8. BMP280 - A platform agnostic driver to interface with the BMP280 pressure sensor crates.io
  9. CC1101 - SPI - Sub-1GHz RF Transceiver - crates.io
  10. CCS811 - I2C - Gas and VOC sensor driver for monitoring indoor air quality.
  11. DS3231 - I2C - real time clock
  12. DS3234 - SPI - Real time clock
  13. DS323x - I2C/SPI - Real-time clocks (RTC): DS3231, DS3232 and DS3234 - crates.io
  14. DW1000 - SPI - Radio transceiver for communication based on IEEE 802.15.4 and position tracking - crates.io
  15. eink-waveshare - SPI - driver for E-Paper Modules from Waveshare
  16. embedded-nrf24l01 - SPI+GPIO - 2.4 GHz radio
  17. GridEYE - I2C - Rust driver for Grid-EYE / Panasonic AMG88(33) - crates.io
  18. HC-SR04 - DIO - Ultrasound sensor
  19. HD44780-driver - GPIO - LCD controller - crates.io
  20. HD44780 - Parallel port - LCD controller
  21. HM11 - USART - HM-11 bluetooth module AT configuration crate - crates.io
  22. hub75 - A driver for rgb led matrices with the hub75 interface - crates.io
  23. hzgrow-r502 - UART capacitive fingerprint reader - crates.io
  24. iAQ-Core - I2C - iAQ-Core-C/iAQ-Core-P Gas and VOC sensor driver for monitoring indoor air quality.
  25. ILI9341 - SPI - TFT LCD display
  26. INA260 - I2C - power monitor - crates.io
  27. LM75 - I2C - Temperature sensor and thermal watchdog - crates.io
  28. LS010B7DH01 - SPI - Memory LCD
  29. LSM303C - A platform agnostic driver to interface with the LSM303C (accelerometer + compass) crates.io
  30. MAG3110 - I2C - Magnetometer
  31. MAX17048/9 - I2C - LiPo Fuel guage, battery monitoring IC - crates.io
  32. MAX31855 - SPI - Thermocouple digital converter -crates.io
  33. MAX31865 - SPI - RTD to Digital converter - crates.io
  34. MAX44009 - I2C - Ambient light sensor - crates.io
  35. MAX7219 - SPI - LED display driver - crates.io
  36. MCP49xx - SPI - 8/10/12-bit DACs like MCP4921, MCP4922, MCP4801, etc. - crates.io
  37. MCP9808 - I2C - Temperature sensor - crates.io
  38. MFRC522 - SPI - RFID tag reader/writer
  39. motor-driver - Motor drivers: L298N, TB6612FNG, etc.
  40. MPU6050 - I2C - no_std driver for the MPU6050 crates.io
  41. MPU9250 - no_std driver for the MPU9250 (and other MPU* devices) & onboard AK8963 (accelerometer + gyroscope + magnetometer IMU) crates.io
  42. NRF24L01 - SPI - 2.4 GHz wireless communication
  43. OneWire - 1wire - OneWire protocol implementation with drivers for devices such as DS18B20 - crates.io
  44. PCD8544 - SPI - 48x84 pixels matrix LCD controller
  45. PCD8544_rich - SPI - Rich driver for 48x84 pixels matrix LCD controller - crates.io
  46. PCF857x - I2C - I/O expanders: PCF8574, PCF8574A, PCF8575 crates.io
  47. radio-at86rf212 - SPI - Sub GHz 802.15.4 radio transceiver crates.io
  48. RFM69 - SPI - ISM radio transceiver
  49. RN2xx3 - Serial - A driver for the RN2483 / RN2903 LoRaWAN modems by Microchip
  50. SCD30 - I2C - CO₂ sensor - crates.io
  51. SHT2x - I2C - temperature / humidity sensors
  52. SHT3x - I2C - Temperature / humidity sensors
  53. SI5351 - I2C - clock generator
  54. SI7021 - I2C - Humidity and temperature sensor
  55. spi-memory - SPI - A generic driver for various SPI Flash and EEPROM chips - crates.io
  56. SSD1322 - SPI - Graphical OLED display controller - crates.io
  57. SSD1351 - SPI - 16bit colour OLED display driver - crates.io
  58. SSD1675 - SPI - Tri-color ePaper display controller - crates.io
  59. st7032i - I2C - Dot Matrix LCD Controller driver (Sitronix ST7032i or similar). - crates.io
  60. ST7735-lcd - SPI - An embedded-graphics compatible driver for the popular lcd family from Sitronix crates.io
  61. stm32-eth - MCU - Ethernet
  62. SX1278 - SPI - Long range (LoRa) transceiver
  63. SX1509 - I2C - IO Expander / Keypad driver
  64. TCS3472 - I2C - RGB color light sensor - crates.io
  65. TPA2016D2 - I2C - A driver for interfacing with the Texas Instruments TPA2016D2 Class-D amplifier - crates.io
  66. VEML6040 - I2C - RGBW color light sensor - crates.io
  67. VEML6070 - I2C - UVA light sensor - crates.io
  68. vesc-comm - A driver for communicating with VESC-compatible electronic speed controllers crates.io
  69. VL53L0X - A platform agnostic driver to interface with the vl53l0x (time-of-flight sensor) crates.io
  70. w5500 - SPI - Ethernet Module with hardwired protocols : TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE - crates.io
  71. xCA9548A - I2C - I2C switches/multiplexers: TCA9548A, PCA9548A - crates.io

no-std crates

#![no_std] crates designed to run on resource constrained devices.

  1. atomic: Generic Atomic wrapper type. crates.io
  2. bbqueue: A SPSC, statically allocatable queue based on BipBuffers suitable for DMA transfers - crates.io
  3. bitmatch: A crate that allows you to match, bind, and pack the individual bits of integers. - crates.io
  4. biquad: A library for creating second order IIR filters for signal processing based on Biquads, where both a Direct Form 1 (DF1) and Direct Form 2 Transposed (DF2T) implementation is available. crates.io
  5. bit_field: manipulating bitfields and bitarrays - crates.io
  6. bluetooth-hci: device-independent Bluetooth Host-Controller Interface implementation. crates.io
  7. bounded-registers A high-assurance memory-mapped register code generation and interaction library. bounded-registers provides a Tock-like API for MMIO registers with the addition of type-based bounds checking. - crates.io
  8. combine: parser combinator library - crates.io
  9. console-traits: Describes a basic text console. Used by menu and implemented by vga-framebuffer. crates.io
  10. cmim, or Cortex-M Interrupt Move: A crate for Cortex-M devices to move data to interrupt context, without needing a critical section to access the data within an interrupt, and to remove the need for the "mutex dance" - crates.io
  11. dcmimu: An algorithm for fusing low-cost triaxial MEMS gyroscope and accelerometer measurements crates.io
  12. gcode: A gcode parser for no-std applications - crates.io
  13. heapless: provides Vec, String, LinearMap, RingBuffer backed by fixed-size buffers - crates.io
  14. ieee802154: Partial implementation of the IEEE 802.15.4 standard - crates.io
  15. infrared: infrared remote control library for embedded rust - crates.io
  16. intrusive-collections: intrusive (non-allocating) singly/doubly linked lists and red-black trees - crates.io
  17. irq: utilities for writing interrupt handlers (allows moving data into interrupts, and sharing data between them) - crates.io
  18. managed: provides ManagedSlice, ManagedMap backed by either their std counterparts or fixed-size buffers for #![no_std]. - crates.io
  19. menu: A basic command-line interface library. Has nested menus and basic help functionality. crates.io
  20. micromath: Embedded Rust math library featuring fast, safe floating point approximations for common arithmetic operations, 2D and 3D vector types, and statistical analysis - crates.io
  21. nalgebra: general-purpose and low-dimensional linear algebra library - crates.io
  22. nom: parser combinator framework - crates.io
  23. null-terminated: generic null-terminated arrays - crates.io
  24. num-format: Crate for producing string representations of numbers, formatted according to international standards, e.g. "1,000,000" for US English - crates.io
  25. panic-persist: A panic handler crate inspired by panic-ramdump that logs panic messages to a region of RAM defined by the user, allowing for discovery of panic messages post-mortem using normal program control flow. - crates.io
  26. pc-keyboard: A PS/2 keyboard protocol driver. Transport (bit-banging or SPI) agnostic, but can convert Set 2 Scancodes into Unicode. crates.io
  27. qei : A qei wrapper that allows you to extend your qei timers from a 16 bit integer to a 64 bit integer. - crates.io
  28. qemu-exit: Quit a running QEMU session with user-defined exit code. Useful for unit or integration tests using QEMU. - crates.io
  29. register-rs: Unified interface for MMIO and CPU registers. Provides type-safe bitfield manipulation. register-rs is Tock registers with added support for CPU register definitions using the same API as for the MMIO registers. This enables homogeneous interfaces to registers of all kinds. - crates.io
  30. scroll: extensible and endian-aware Read/Write traits for generic containers - crates.io
  31. smoltcp: a small TCP/IP stack that runs without alloc. crates.io
  32. static-bytes: Help work with buffers without dynamic allocation. Implement traits from bytes crate. crate.io
  33. tinybmp: No-std, no-alloc BMP parser for embedded systems. Introductory blog post - crates.io
  34. vga-framebuffer: A VGA signal generator and font renderer for VGA-less microcontrollers. Used by Monotron to generate 48 by 36 character display using 3 SPI peripherals and a timer. crates.io
  35. wyhash: A fast, simple and portable hashing algorithm and random number generator. - crates.io

WIP

Work in progress crates. Help the authors make these crates awesome!

  • light-cli: a lightweight heapless cli interface crates.io
  • OxCC: A port of Open Source Car Control written in Rust
  • Rubble: A pure-Rust embedded BLE stack crates.io

Rust forks

AVR

  • AVR Rust Fork of Rust with AVR support.

Firmware projects

License

This list is licensed under

Code of Conduct

Contribution to this crate is organized under the terms of the Rust Code of Conduct, the maintainer of this crate, the Resources team, promises to intervene to uphold that code of conduct.