Framework
embassy-rs/embassy avatar
embassy-rs/embassy

embassy-rs/embassy: async Rust for microcontrollers, without an RTOS

Modern embedded framework, using Rust and async.

10,121 stars1,745 forksRustApache-2.0

At a glance

What is it?
Embassy is an embedded framework that turns async Rust tasks into compile-time state machines, so firmware runs on a single stack with no per-task stack tuning. It is for engineers already comfortable with Rust who want cooperative multitasking, an integrated HAL set and a low-power executor on supported chips.
Who is it for?
Adopt Embassy if your target is one of the maintained HALs (STM32, nRF52/nRF53/nRF54/nRF91, RP2040/RP23xx, MSPM0, MCX-A) and you want async tasking without an RTOS or a heap. Do not adopt it if your chip has no Embassy HAL and no third-party one, or if your team has no Rust experience, because the borrow checker and async traits are not optional here.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • embassy-rs/embassy10,121 ★ · +251
Star history
Repository2026-09-222026-11-15
embassy-rs/embassy9.9k10.1k

251 Stars in the last 54 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What problem Embassy solves, and for whom

Traditional embedded multitasking means picking an RTOS, assigning a stack to every task, and tuning those stack sizes until the hard faults stop. Embassy takes a different route. Its README describes tasks that are transformed at compile time into state machines and run cooperatively, requiring no dynamic memory allocation and running on a single stack, so there is no per-task stack size tuning. That removes two recurring sources of bugs: heap exhaustion and stack overflow.

The audience is narrower than the tagline suggests. You need to be writing Rust already, and you need a chip covered by a HAL. The project maintains embassy-stm32 for all STM32 families, embassy-nrf for the Nordic nRF52, nRF53, nRF54 and nRF91 series, embassy-rp for the RP2040 and RP23xx, embassy-mspm0 for TI MSPM0, and embassy-mcxa for NXP MCX-A. The README also points at HALs outside the project: esp-rs for ESP32, ch32-hal for WCH RISC-V parts, mpfs-hal for Microchip PolarFire SoC, py32-hal for Puya PY32 and ra-hal for Renesas RA. If your part is on none of those lists, Embassy is not the tool for this project, however appealing the async model is.

How the executor, timers and HALs fit together

The core is embassy-executor, which schedules async tasks cooperatively. Because tasks are state machines rather than threads, the scheduler does not switch kernel contexts, which the README contrasts with a traditional RTOS. Real-time behaviour comes from priority rather than preemption inside a single executor: the README states you can create multiple executors with different priorities so higher priority tasks preempt lower priority ones, and points to examples/nrf52840/src/bin/multiprio.rs as the demonstration.

Time is handled by embassy-time, which the README says provides Instant, Duration and Timer types that are globally available and never overflow, so you do not configure hardware timers yourself. Low power is a property of the executor rather than a separate API: it automatically puts the core to sleep when there is no work to do, tasks are woken by interrupts, and there is no busy-loop polling while waiting. That is the mechanism behind the battery-life claim.

Around the core sit optional stacks. embassy-net implements Ethernet, IP, TCP, UDP, ICMP and DHCP. embassy-usb is a device-side USB stack with CDC ACM and HID implementations and a builder API. For Bluetooth there are three paths: the trouble crate is a BLE 4.x and 5.x host running on any controller implementing the bt-hci traits (currently nRF52, nrf54, rp2040, rp23xx, esp32 and serial controllers), nrf-softdevice covers nRF52, and embassy-stm32-wpan covers BLE 5.x on stm32wb. LoRa and LoRaWAN come from the separate lora-rs project. Note the dependency direction: the Bluetooth host is a separate repository, so version compatibility between trouble and your HAL is something you manage.

Installing Embassy and blinking an LED on an nRF52840 DK

There is no installer. Embassy is a set of crates you add to a Cargo project, and the README links the book at embassy.dev/book/index.html as its documentation and tells you to install probe-rs to run the examples. The quickest first use is to clone the repository and run one of the examples, since the examples folder is organised by chip vendor: examples/nrf52840 targets the nrf52840-dk board (PCA10056) but the README says it should be easily adaptable to other nRF52 chips and boards.

The blink example below is the README's own snippet, trimmed to the task and main function. It declares an async task with the embassy_executor::task attribute, spawns it, and then awaits GPIO events in main. The pin type is Peri<'static, AnyPin> and the peripheral is taken from embassy_nrf::init.

rust
use defmt::info;
use embassy_executor::Spawner;
use embassy_time::{Duration, Timer};
use embassy_nrf::gpio::{AnyPin, Input, Level, Output, OutputDrive, Pin, Pull};
use embassy_nrf::{Peri, Peripherals};

#[embassy_executor::task]
async fn blink(pin: Peri<'static, AnyPin>) {
    let mut led = Output::new(pin, Level::Low, OutputDrive::Standard);
    loop {
        led.set_high();
        Timer::after_millis(150).await;
        led.set_low();
        Timer::after_millis(150).await;
    }
}

Main is itself an async task. It initialises the chip, spawns the blink task so it runs in the background, and then waits on a button. The two wait_for calls are where the executor earns its keep: while main is blocked on the button, the blink task still runs, and when nothing is runnable the core sleeps.

rust
#[embassy_executor::main]
async fn main(spawner: Spawner) {
    let p = embassy_nrf::init(Default::default());
    spawner.spawn(blink(p.P0_13.into()).unwrap());

    let mut button = Input::new(p.P0_11, Pull::Up);
    loop {
        button.wait_for_low().await;
        info!("Button pressed!");
        button.wait_for_high().await;
        info!("Button released!");
    }
}

The README marks this block as rust,ignore, meaning it is illustrative rather than compiled as a doctest, so expect to adjust imports when you paste it into a project.

Where Embassy is the wrong choice

The clearest boundary is hardware support. Embassy's own HALs cover a defined set of vendors, and the README lists the third-party HALs it considers usable. A chip outside that set means writing a HAL against embassy-hal-internal before you write any application code, which is a large project in itself.

Cooperative scheduling is the second boundary. Tasks on one executor run cooperatively, so a task that blocks without awaiting starves everything else on that executor. Priority executors mitigate this, but they are a design decision you make up front, not a safety net. If your workload is dominated by long synchronous computation, or you need strict preemptive guarantees with per-task stacks, an RTOS remains the more direct fit.

Tooling is the third. Embassy depends on Rust's async facilities and on hardware-specific build and flash tooling such as probe-rs. The repository has no published releases, so GitHub has no release notes to tell you what changed between commits. Teams that need a versioned upgrade path with published notes will find that gap uncomfortable. Finally, the bootloader story is partial: embassy-boot is described as a lightweight bootloader supporting firmware upgrades in a power-fail-safe way with trial boots and rollbacks.

Embassy against an RTOS and against bare-metal interrupt code

The obvious alternative is an RTOS such as FreeRTOS or Zephyr. The difference is not stylistic. An RTOS gives each task its own stack and preempts on a timer tick; Embassy gives all tasks one stack and switches only at await points. That is why Embassy needs no per-task stack sizing and why it can idle the core without a tick. The README links a comparison arguing async Rust is faster and smaller than an RTOS, which is the project's own position rather than a neutral measurement.

The second alternative is bare-metal code driven by interrupts and a superloop. That is simpler and has no framework dependency, but every blocking operation has to be restructured by hand into a state machine. Embassy makes the compiler do that restructuring, which is the whole point of the async/await mapping described above. If your firmware is one loop with a couple of interrupts, the superloop is less machinery.

Within Rust, Embassy also coexists with other HALs rather than replacing them: the README states you can still use HALs from other projects with Embassy. So the realistic comparison is not Embassy versus everything, it is Embassy's executor and time model versus whatever scheduling your current HAL expects.

Maintenance, licensing and upgrade cost

The repository is not archived, and the last push was on 2026-11-02. That is a working repository, but it has no published releases, so there are no version numbers to pin and no release notes to read. Practically, that means tracking the main branch or pinning a commit hash, and reading RELEASE.md in the repository root for whatever release process the maintainers document there. The repository also carries API-GUIDELINES.md and CONTRIBUTING.md, which is a signal about how changes are expected to be shaped.

Licensing is mixed and worth reading before you vendor anything. The repository contains LICENSE-APACHE and LICENSE-MIT at the root, which is the usual dual-licence arrangement for Rust crates, and the project metadata lists Apache-2.0. There is also a LICENSE-CC-BY-SA file, which typically covers documentation rather than code, and a NOTICE.md. Which licence applies to a given file is a question for those files, not for this article, and I am not giving legal advice. The cyw43-firmware directory is another thing to check: firmware blobs often carry terms different from the surrounding source. Verify each before redistribution.

Upgrade cost is dominated by the HALs rather than the executor. embassy-stm32 covers many STM32 families, so a single crate version spans a lot of chips, and API changes there ripple into your board support. Because the repository has no published releases, you cannot diff versions from what is published; you would diff commits.

Editorial conclusion

Adopt Embassy if your target is one of the maintained HALs (STM32, nRF52/nRF53/nRF54/nRF91, RP2040/RP23xx, MSPM0, MCX-A) and you want async tasking without an RTOS or a heap. Do not adopt it if your chip has no Embassy HAL and no third-party one, or if your team has no Rust experience, because the borrow checker and async traits are not optional here. Before committing, check the embassy-stm32 or embassy-nrf API reference for the peripherals you need, confirm your board appears under examples/ (for instance examples/nrf52840 for the nrf52840-dk), and read the bootloader documentation for embassy-boot if you plan over-the-air updates. The last push to the repository was on 2026-11-02 and the repository has no published releases, so pin a specific commit or git revision rather than an assumed version tag.

Frequently asked questions

Does embassy-rs/embassy require dynamic memory allocation?

No. The README states that tasks are transformed at compile time into state machines that run cooperatively, requiring no dynamic memory allocation, and that they run on a single stack. That is also why no per-task stack size tuning is needed.

Which microcontrollers does embassy-rs/embassy support?

The project maintains HALs for STM32 families, Nordic nRF52/nRF53/nRF54/nRF91, Raspberry Pi RP2040 and RP23xx, TI MSPM0 and NXP MCX-A. The README also lists third-party HALs for ESP32, WCH CH32V, Microchip PolarFire SoC, Puya PY32 and Renesas RA.

How does embassy-rs/embassy save power when there is no work to do?

The README says the async executor automatically puts the core to sleep when there is no work to do, and that tasks are woken by interrupts rather than by busy-loop polling while waiting. That behaviour is what the project cites for multi-year battery life.

Can embassy-rs/embassy tasks preempt each other?

Within one executor, tasks run cooperatively. The README states you can create multiple executors with different priorities so that higher priority tasks preempt lower priority ones, and points to examples/nrf52840/src/bin/multiprio.rs as an example.

Official sources

  1. embassy-rs/embassy on GitHub
  2. Issues
  3. License: Apache-2.0
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/embassy-rs-embassy.svg)](https://hysenlabs.com/projects/embassy-rs-embassy)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/embassy-rs-embassy.svg)](https://hysenlabs.com/projects/embassy-rs-embassy)

Was this useful?