Modern embedded framework, using Rust and async. https://embassy.dev
  • Rust 99.8%
  • Linker Script 0.1%
Find a file
2026-09-20 23:08:30 +00:00
.github crypto: add embassy-crypto-test. 2026-09-08 23:31:19 +02:00
.helix Add helix cargo settings overrides 2025-09-24 14:03:41 +02:00
.vscode crypto: merge embassy-crypto-driver into embassy-crypto, split software drivers into embassy-crypto-rustcrypto. 2026-09-08 18:00:42 +02:00
cyw43 net,cyw43: add support for hardware multicast filter. 2026-09-01 23:51:59 +02:00
cyw43-firmware cyw: update write nvrams script 2026-04-21 10:26:52 -05:00
cyw43-pio Merge branch 'embassy-rs:main' into fix-input-sync-bypass-gpiobase 2026-07-27 15:23:41 -04:00
docs ptp-driver: add adjustable clock interface 2026-08-20 16:18:27 +02:00
embassy-ambiq ambiq: Implement IOM and I2C Master driver 2026-08-12 02:38:02 -03:00
embassy-boot Merge pull request #6564 from rgilton/boot-reset 2026-08-19 10:45:44 +00:00
embassy-boot-nrf nrf: align to api guidelines 2026-09-12 01:15:12 +02:00
embassy-boot-rp rp: align to api guidelines 2026-09-10 11:08:05 +02:00
embassy-boot-stm32 Export FirmwareUpdaterError from boot crates 2026-08-27 21:21:29 -04:00
embassy-crypto crypto: one in tree 2026-09-13 16:29:21 -05:00
embassy-crypto-rand crypto: add RNG public API, make it infallible. 2026-09-09 23:51:03 +02:00
embassy-crypto-rustcrypto crypto: add chacha, chachapoly 2026-09-12 00:01:56 +02:00
embassy-crypto-test crypto/test: optimize build.rs 2026-09-18 02:43:35 +02:00
embassy-embedded-hal fix(embassy-embedded-hal): Add missing flush call to BlockingAsync 2026-08-21 23:04:02 +02:00
embassy-executor crypto: merge embassy-crypto-driver into embassy-crypto, split software drivers into embassy-crypto-rustcrypto. 2026-09-08 18:00:42 +02:00
embassy-executor-macros executor: rename platform-cortex-ar to platform-aarch32, add InterruptExecutor support. 2026-09-01 21:57:20 +02:00
embassy-executor-timer-queue crypto: merge embassy-crypto-driver into embassy-crypto, split software drivers into embassy-crypto-rustcrypto. 2026-09-08 18:00:42 +02:00
embassy-futures Edition 2024. 2025-10-06 23:19:53 +02:00
embassy-hal-internal hal_internal: mark reset as unsafe 2026-07-30 12:44:20 +02:00
embassy-imxrt Prepare ETQU 0.3.2 2026-04-21 23:34:07 +02:00
embassy-mcxa Merge pull request #7012 from WangYuanyuan1996/mcxa-spi-unequal-transfer-pr-20260916 2026-09-18 14:19:18 +00:00
embassy-microchip Prepare ETQU 0.3.2 2026-04-21 23:34:07 +02:00
embassy-mspm0 executor: add idle trace hook. 2026-09-02 02:13:23 +02:00
embassy-net net: await stack-wide TX timestamps 2026-09-19 00:15:12 +02:00
embassy-net-adin1110 net: port to new xarxa 2026-08-29 01:52:39 +02:00
embassy-net-driver-channel net: await stack-wide TX timestamps 2026-09-19 00:15:12 +02:00
embassy-net-enc28j60 net: await stack-wide TX timestamps 2026-09-19 00:15:12 +02:00
embassy-net-esp-hosted net: port to new xarxa 2026-08-29 01:52:39 +02:00
embassy-net-nrf91 nrf: make DMA_SIZE a per-peripheral const, derived from the PAC. 2026-09-02 15:14:35 +02:00
embassy-net-ppp net: port to new xarxa 2026-08-29 01:52:39 +02:00
embassy-net-tuntap net: await stack-wide TX timestamps 2026-09-19 00:15:12 +02:00
embassy-net-wiznet net: port to new xarxa 2026-08-29 01:52:39 +02:00
embassy-nrf nrf/cracen: fix rng health test failures. 2026-09-14 01:40:28 +02:00
embassy-nxp embassy-nxp: restructure casper driver layout and bump nxp-pac 2026-09-18 22:05:26 +03:00
embassy-ptp-driver net: port to new xarxa 2026-08-29 01:52:39 +02:00
embassy-rp Merge pull request #6946 from cryptographix/rp-usb-host-interrupt-out 2026-09-11 22:55:49 +00:00
embassy-stm32 stm32/dma: do not use suspf interrupt 2026-09-21 00:46:03 +02:00
embassy-stm32-wpan net: await stack-wide TX timestamps 2026-09-19 00:15:12 +02:00
embassy-sync Merge pull request #6964 from MaxFreedomPollard/fair-semaphore-cancel-wake 2026-09-14 11:42:05 +00:00
embassy-time Update wasm timer dependency 2026-09-02 21:06:59 -06:00
embassy-time-driver embassy-time: add 27 MHz tick rate 2026-07-18 17:02:54 +10:00
embassy-time-queue-utils Prepare ETQU 0.3.2 2026-04-21 23:34:07 +02:00
embassy-usb embassy-usb: add extra fields to MIDI endpoint descriptors 2026-09-19 17:53:24 +02:00
embassy-usb-dfu chore: update changelogs for release 2026-03-12 09:58:32 +01:00
embassy-usb-driver embassy-usb-driver: make endpoint address methods const 2026-07-31 00:59:50 +02:00
embassy-usb-host embassy-usb-host: stop descriptor retries on disconnect 2026-09-19 04:31:08 +08:00
embassy-usb-logger chore: prepare crate releases 2026-03-10 12:28:26 -04:00
embassy-usb-synopsys-otg Modified configuration to allow for software controlled VBUS detection 2026-08-30 02:25:07 -04:00
examples Merge branch 'main' into usb-midi-config-struct 2026-09-19 11:09:28 +02:00
release chore: move tool to separate repo 2025-08-25 19:44:51 +02:00
tests net: await stack-wide TX timestamps 2026-09-19 00:15:12 +02:00
.gitattributes Use merge=union for changelogs to avoid constant conflicts. 2025-09-05 16:27:48 +02:00
.gitignore ignore work 2026-08-21 16:16:25 -05:00
API-GUIDELINES.md nrf: align to api guidelines 2026-09-12 01:15:12 +02:00
ci-nightly.sh net: migrate smoltcp -> xarxa 2026-07-28 14:21:40 +02:00
ci-xtensa.sh net: migrate smoltcp -> xarxa 2026-07-28 14:21:40 +02:00
ci.sh ci: use rm -f on all cmds 2026-09-06 09:22:49 -05:00
CONTRIBUTING.md Add contributor guide. 2026-07-25 22:48:39 +02:00
fmtall.ps1 fmt 2026-05-27 11:05:43 -05:00
fmtall.sh Add a basic "format all" script 2025-12-10 15:32:11 +01:00
LICENSE-APACHE Centralize license and MSRV boilerplate into the repo readme. 2024-01-11 18:18:35 +01:00
LICENSE-CC-BY-SA Explicitly license the book prose CC-BY-SA 2024-05-23 09:57:10 +02:00
LICENSE-MIT Centralize license and MSRV boilerplate into the repo readme. 2024-01-11 18:18:35 +01:00
NOTICE.md Fix spelling and white space mistakes 2024-04-11 19:45:38 +00:00
README.md Merge pull request #6802 from quartiq/pr/network-clock 2026-08-21 19:07:10 +00:00
RELEASE.md docs: fix markdown syntax 2025-07-14 12:02:42 +02:00
rust-toolchain-nightly.toml update nightly. 2026-08-31 23:10:32 +02:00
rust-toolchain.toml Merge pull request #6622 from tianrking/agent/fix-rv32imc-rtos-trace 2026-08-08 08:07:35 +00:00
rustfmt.toml Edition 2024. 2025-10-06 23:19:53 +02:00

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 - API reference - Website - Chat

Rust + async ❤️ embedded

The Rust programming language is blazingly fast and memory-efficient, with no runtime, garbage collector, or OS. It catches a wide variety of bugs at compile time, thanks to its full memory- and thread-safety, and expressive type system.

Rust's async/await allows for unprecedentedly easy and efficient multitasking in embedded systems. Tasks get transformed at compile time into state machines that get run cooperatively. It requires no dynamic memory allocation and runs on a single stack, so no per-task stack size tuning is required. It obsoletes the need for a traditional RTOS with kernel context switching, and is faster and smaller than one!

Batteries included

  • Hardware Abstraction Layers

    • HALs implement safe, idiomatic Rust APIs to use the hardware capabilities, so raw register manipulation is not needed. The Embassy project maintains HALs for select hardware, but you can still use HALs from other projects with Embassy.
    • embassy-stm32, for all STM32 microcontroller families.
    • embassy-nrf, for the Nordic Semiconductor nRF52, nRF53, nRF54 and nRF91 series.
    • embassy-rp, for the Raspberry Pi RP2040 and RP23xx microcontrollers.
    • embassy-mspm0, for the Texas Instruments MSPM0 microcontrollers.
    • embassy-mcxa, for NXP's MCX-A series of microcontrollers.
    • esp-rs, for the Espressif Systems ESP32 series of chips.
      • Embassy HAL support for Espressif chips, as well as Async Wi-Fi, Bluetooth, and ESP-NOW, is being developed in the esp-rs/esp-hal repository.
    • ch32-hal, for the WCH 32-bit RISC-V(CH32V) series of chips.
    • mpfs-hal, for the Microchip PolarFire SoC.
    • py32-hal, for the Puya Semiconductor PY32 series of microcontrollers.
    • ra-hal, for the Renesas RA family of microcontrollers.
  • Time that Just Works - No more messing with hardware timers. embassy_time provides Instant, Duration, and Timer types that are globally available and never overflow.

  • Real-time ready - Tasks on the same async executor run cooperatively, but you can create multiple executors with different priorities so that higher priority tasks preempt lower priority ones. See the example.

  • Low-power ready - Easily build devices with years of battery life. The async executor automatically puts the core to sleep when there's no work to do. Tasks are woken by interrupts, there is no busy-loop polling while waiting.

  • Networking - The embassy-net network stack implements extensive networking functionality, including Ethernet, IP, TCP, UDP, ICMP, and DHCP. Async drastically simplifies managing timeouts and serving multiple connections concurrently. embassy-ptp-driver provides a network-stack-independent interface for reading and adjusting PTP hardware clocks.

  • Bluetooth

    • The trouble crate provides a Bluetooth Low Energy 4.x and 5.x Host that runs on any microcontroller implementing the bt-hci traits (currently nRF52, nrf54, rp2040, rp23xx and esp32 and serial controllers are supported).
    • The nrf-softdevice crate provides Bluetooth Low Energy 4.x and 5.x support for nRF52 microcontrollers.
    • The embassy-stm32-wpan crate provides Bluetooth Low Energy 5.x support for stm32wb microcontrollers.
  • LoRa - The lora-rs project provides an async LoRa and LoRaWAN stack that works well on Embassy.

  • USB - embassy-usb implements a device-side USB stack. Implementations for common classes such as USB serial (CDC ACM) and USB HID are available, and a rich builder API allows building your own.

  • Bootloader and DFU - embassy-boot is a lightweight bootloader supporting firmware application upgrades in a power-fail-safe way, with trial boots and rollbacks.

Sneak peek

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};

// Declare async tasks
#[embassy_executor::task]
async fn blink(pin: Peri<'static, AnyPin>) {
    let mut led = Output::new(pin, Level::Low, OutputDrive::Standard);

    loop {
        // Timekeeping is globally available, no need to mess with hardware timers.
        led.set_high();
        Timer::after_millis(150).await;
        led.set_low();
        Timer::after_millis(150).await;
    }
}

// Main is itself an async task as well.
#[embassy_executor::main]
async fn main(spawner: Spawner) {
    let p = embassy_nrf::init(Default::default());

    // Spawned tasks run in the background, concurrently.
    spawner.spawn(blink(p.P0_13.into()).unwrap());

    let mut button = Input::new(p.P0_11, Pull::Up);
    loop {
        // Asynchronously wait for GPIO events, allowing other tasks
        // to run, or the core to sleep.
        button.wait_for_low().await;
        info!("Button pressed!");
        button.wait_for_high().await;
        info!("Button released!");
    }
}

Examples

Examples are found in the examples/ folder separated by the chip manufacturer they are designed to run on. For example:

  • examples/nrf52840 run on the nrf52840-dk board (PCA10056) but should be easily adaptable to other nRF52 chips and boards.
  • examples/nrf5340 run on the nrf5340-dk board (PCA10095).
  • examples/stm32xx for the various STM32 families.
  • examples/rp are for the RP2040 and RP235x chips.
  • examples/mcxa2xx run on the FRDM-MCXA266 board.
  • examples/std are designed to run locally on your PC.

Running examples

  • Install probe-rs following the instructions at https://probe.rs.
  • Change directory to the sample's base directory. For example:
cd examples/nrf52840
  • Ensure Cargo.toml sets the right feature for the name of the chip you are programming. If this name is incorrect, the example may fail to run or immediately crash after being programmed.

  • Ensure .cargo/config.toml contains the name of the chip you are programming.

  • Run the example

For example:

cargo run --release --bin blinky

For more help getting started, see Getting Started and Running the Examples.

Developing Embassy with Rust Analyzer-based editors

The Rust Analyzer is used by Visual Studio Code and others. Given the multiple targets that Embassy serves, there is no Cargo workspace file. Instead, the Rust Analyzer must be told of the target project to work with. In the case of Visual Studio Code, please refer to the .vscode/settings.json file's rust-analyzer.linkedProjectssetting.

Minimum supported Rust version (MSRV)

Embassy is guaranteed to compile on latest stable Rust. It might compile with older versions, but that may change in any new patch release.

Why the name?

EMBedded ASYnc! :)

License

Embassy is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.