TL;DR

Embassy is an open-source embedded framework built around Rust's async/await, aiming for safety, efficiency, and low-power operation. It provides hardware abstraction layers, networking, Bluetooth, LoRa, USB stacks, a bootloader, and examples for many microcontrollers.

What happened

Embassy presents itself as a next-generation framework for embedded software that leverages Rust and its async features to simplify concurrent programming on microcontrollers. Tasks are compiled into state machines that run cooperatively on a single stack without dynamic allocation, a model the project says removes the need for a traditional RTOS and reduces code size and latency. The project bundles libraries and hardware abstraction layers (HALs) for multiple families — including STM32, Nordic nRF series, Raspberry Pi RP2040, Espressif chips, and others — and adds stacks for networking (embassy-net), USB device operation, Bluetooth host and controller support, LoRa, and a lightweight bootloader for safe firmware upgrades. The repository includes examples per chip family plus guidance for running samples with probe-rs and configuring Rust Analyzer. Embassy's minimum supported Rust version is 1.75, and the code is available under dual Apache-2.0/MIT licensing.

Why it matters

  • Putting async/await at the core can reduce complexity of concurrent embedded code and eliminate dependence on a full RTOS for many use cases.
  • A single-stack, no-heap execution model helps avoid dynamic allocation issues common in constrained devices and can simplify resource planning.
  • Integrated support for networking, wireless protocols, USB and bootloading shortens the path from prototype to functioning device firmware.
  • Broad HAL coverage across popular microcontroller families makes porting and hardware reuse easier for engineers targeting multiple platforms.

Key facts

  • Embassy is an embedded framework built on Rust and its async/await model.
  • Tasks are compiled into state machines that run cooperatively on a single stack and require no dynamic memory allocation.
  • embassy-time offers globally available time types (Instant, Duration, Timer) intended to avoid hardware timer management.
  • embassy-net implements Ethernet/IP-level functionality including TCP, UDP, ICMP and DHCP.
  • Bluetooth support is provided via multiple crates: trouble (BLE Host), nrf-softdevice (BLE for nRF52), and embassy-stm32-wpan (BLE 5.x for stm32wb).
  • LoRa support is available through the lora-rs project, and USB device-side stacks are provided by embassy-usb with common class implementations.
  • embassy-boot provides a lightweight, power-fail-safe bootloader with trial boots and rollback support.
  • The project maintains HALs for many chips: embassy-stm32, embassy-nrf, embassy-rp, embassy-mspm0, esp-rs/esp-hal (Espressif support development), ch32-hal, mpfs-hal, and py32-hal.
  • Minimum supported Rust version (MSRV) is stable Rust 1.75 and up.
  • The repository shows an active project with thousands of stars and forks, and open issues and pull requests indicating ongoing development.

What to watch next

  • Embassy HAL support and Async Wi‑Fi, Bluetooth and ESP‑NOW work for Espressif chips is being developed in the esp-rs/esp-hal repository (confirmed in the source).
  • not confirmed in the source

Quick glossary

  • async/await: Language features that let code express asynchronous operations as sequential-looking code, commonly compiled to state machines that can be suspended and resumed.
  • HAL (Hardware Abstraction Layer): A library layer that provides safe, hardware-agnostic APIs so code can interact with microcontroller peripherals without manual register manipulation.
  • RTOS (Real-Time Operating System): An operating system designed to run time-sensitive tasks with defined scheduling and context switching; some embedded frameworks aim to replace or avoid RTOS use.
  • crate: A Rust package or library distributed through Cargo; crates can provide functionality ranging from device drivers to full protocol stacks.
  • MSRV (Minimum Supported Rust Version): The oldest Rust compiler version on which a project guarantees it will successfully build.

Reader FAQ

What is Embassy?
Embassy is an embedded framework that uses Rust and async/await to build safe, efficient firmware libraries and applications.

Do I need a traditional RTOS to use Embassy?
The project positions its async executor as an alternative to a traditional RTOS for many use cases, running cooperative tasks without per-task stacks.

Which microcontrollers and HALs are supported?
Supported or maintained HALs include families such as STM32, Nordic nRF52/nRF53/nRF54/nRF91, Raspberry Pi RP2040/RP23xx, Texas Instruments MSPM0, Espressif chips (esp-rs/esp-hal in development), WCH CH32V, Microchip PolarFire, and Puya PY32.

What networking and protocol stacks are included?
Embassy provides an IP-level network stack (embassy-net), Bluetooth crates for host and controller functionality, an async LoRa/LoRaWAN stack via lora-rs, and a USB device stack (embassy-usb).

What is the license and Rust version requirement?
Embassy is dual-licensed under Apache-2.0 and MIT, and guarantees compilation on stable Rust 1.75 and newer.

Embassy Embassy is the next-generation framework for embedded applications. Write safe, correct, and energy-efficient embedded code faster, using the Rust programming language, its async facilities, and the Embassy libraries. Documentation…

Sources

Related posts

By

Leave a Reply

Your email address will not be published. Required fields are marked *