embedded-battery-pack
A battery pack for embedded Rust — curates HALs, concurrency frameworks, drivers, and no_std utilities from the awesome-embedded-rust ecosystem.
Quick start
cargo bp new embedded
This scaffolds a project with your chosen HAL, concurrency model, and peripherals already wired up.
To add embedded crates to an existing project instead:
cargo bp add embedded -F stm32f4 -F embassy -F panic-probe -F defmt-logging
Learn more
This battery pack is inspired by and draws from the awesome-embedded-rust list. For more about the embedded Rust ecosystem and how to get involved, visit the Embedded Rust Working Group.
Battery pack contents
Concurrency Framework (pick at most one)
Pick your async/RTOS model (mutually exclusive)
| Name | Description |
|---|---|
embassy | Embassy — async/await runtime for embedded |
Crates: embassy-executor, embassy-sync, embassy-time | |
rtic | RTIC — interrupt-driven real-time concurrency |
Crates: cortex-m, cortex-m-rt, critical-section, rtic |
Display & Graphics
Screens, LEDs, and 2D drawing
| Name | Description |
|---|---|
display-ssd1306 | SSD1306 OLED display (I2C/SPI, 128x64) |
Crates: embedded-graphics, ssd1306 | |
display-st7789 | ST7789 color LCD (SPI, used in PineTime) |
Crates: embedded-graphics, st7789 | |
embedded-graphics | 2D drawing library for any embedded display |
Popular Drivers
Platform-agnostic peripheral/sensor drivers via embedded-hal
| Name | Description |
|---|---|
display-ssd1306 | SSD1306 OLED display (I2C/SPI, 128x64) |
Crates: embedded-graphics, ssd1306 | |
display-st7789 | ST7789 color LCD (SPI, used in PineTime) |
Crates: embedded-graphics, st7789 | |
sensor-bme280 | BME280 temperature/humidity/pressure (I2C/SPI) |
sensor-lis3dh | LIS3DH 3-axis accelerometer (I2C/SPI) |
usb-device | USB device stack (CDC-ACM serial, HID) |
Crates: usb-device, usbd-serial |
Hardware Abstraction Layer (pick at most one)
Pick the HAL for your target chip family (mutually exclusive)
| Name | Description |
|---|---|
atsamd | Microchip SAMD (Cortex-M0+/M4, Adafruit boards) |
Crates: atsamd-hal, cortex-m, cortex-m-rt, critical-section, embedded-hal | |
esp32 | ESP32 (Xtensa, WiFi + BT, via esp-hal no_std) |
Crates: embedded-hal, esp-hal | |
esp32c3 | ESP32-C3 (RISC-V, WiFi + BLE, via esp-hal no_std) |
Crates: embedded-hal, esp-hal | |
esp32s3 | ESP32-S3 (Xtensa, WiFi + BLE, via esp-hal no_std) |
Crates: embedded-hal, esp-hal | |
nrf52832 | Nordic nRF52832 (Cortex-M4F, BLE) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, nrf52832-hal | |
nrf52840 | Nordic nRF52840 (Cortex-M4F, BLE + USB) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, nrf52840-hal | |
nrf9160 | Nordic nRF9160 (Cortex-M33, LTE-M/NB-IoT) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, nrf9160-hal | |
rp2040 | RP2040 (Dual Cortex-M0+, Raspberry Pi Pico) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, rp2040-hal | |
stm32f0 | STM32F0xx family (Cortex-M0) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32f0xx-hal | |
stm32f1 | STM32F1xx family (Cortex-M3, e.g. Blue Pill) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32f1xx-hal | |
stm32f3 | STM32F3xx family (Cortex-M4F) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32f3xx-hal | |
stm32f4 | STM32F4xx family (Cortex-M4F, e.g. F4 Discovery) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32f4xx-hal | |
stm32f7 | STM32F7xx family (Cortex-M7) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32f7xx-hal | |
stm32h7 | STM32H7xx family (Cortex-M7, high-performance) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32h7xx-hal | |
stm32l0 | STM32L0xx family (ultra-low-power Cortex-M0+) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32l0xx-hal | |
stm32l4 | STM32L4xx family (low-power Cortex-M4F) |
Crates: cortex-m, cortex-m-rt, critical-section, embedded-hal, stm32l4xx-hal |
Logging & Debugging
Device logging and diagnostic tools
| Name | Description |
|---|---|
defmt-logging | defmt — efficient deferred formatting for constrained devices |
Crates: defmt, defmt-rtt | |
rtt-target | RTT (Real-Time Transfer) output channel |
Networking
no_std networking stacks and protocols
| Name | Description |
|---|---|
smoltcp-stack | smoltcp — no_std TCP/IP stack |
Panic Handler (pick at most one)
Choose how panics are surfaced on the device (mutually exclusive)
| Name | Description |
|---|---|
panic-halt | Halt the processor on panic |
Crates: defmt, defmt-rtt, panic-halt | |
panic-probe | Log panic via probe-rs debugger |
Crates: defmt, defmt-rtt, panic-probe | |
panic-rtt | Log panic via RTT (SEGGER/probe-rs) |
Crates: defmt, defmt-rtt, panic-rtt-target | |
panic-semihosting | Print panic via semihosting (Cortex-M only) |
Portable Ecosystem
Trait abstractions and utilities that work across any HAL
| Name | Description |
|---|---|
critical-section-impl | critical-section — cross-platform mutex primitive |
heapless-alloc | Static-friendly Vec, String, and data structures (no heap) |
embedded-hal | Trait abstractions for embedded I/O (v1.0) |
embedded-io | Read/Write traits for embedded byte streams |
embedded-storage | Traits for NOR flash and other storage |
Storage & Memory
Flash, EEPROM, and filesystem support
| Name | Description |
|---|---|
embedded-sdmmc | SD/MMC card with FAT16/FAT32 filesystem |
spi-flash | Generic SPI NOR flash driver |
Dev Tools
Testing, flashing, and development utilities
| Name | Description |
|---|---|
embedded-hal-mock | Mock embedded-hal traits for host-side testing |
embedded-test | On-device test harness (unit + integration tests) |
Dependencies
| Name | Description |
|---|---|
embedded-hal-mock | |
embedded-sdmmc | |
embedded-test | |
rtt-target |
Templates
| Name | Description |
|---|---|
blinky | Minimal blinky LED example for your chosen HAL + concurrency model |