explaingit

embassy-rs/embassy

9,224RustAudience · developerComplexity · 4/5Setup · hard

TLDR

Embassy is a Rust framework for writing firmware that runs directly on microcontrollers, letting multiple tasks run concurrently with async/await without a traditional operating system, which saves memory and extends battery life.

Mindmap

mindmap
  root((repo))
    What it does
      Async firmware
      No OS required
      Low power usage
    Hardware support
      STM32 chips
      Nordic nRF chips
      RP2040 and RP2350
    Networking
      TCP and UDP stack
      Bluetooth Low Energy
      USB device stack
    Getting started
      Rust toolchain
      probe-rs flasher
      Example programs
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build firmware for an IoT sensor that monitors data and sends it over Bluetooth, running multiple tasks concurrently without draining the battery.

USE CASE 2

Create a USB device like a custom keyboard that handles input while also managing other hardware features simultaneously.

USE CASE 3

Write networking firmware for a Raspberry Pi Pico that handles TCP connections and supports over-the-air firmware updates with rollback.

Tech stack

RustSTM32nRFRP2040probe-rs

Getting it running

Difficulty · hard Time to first run · 1h+

Requires physical microcontroller hardware plus the Rust toolchain and the probe-rs flashing tool configured for your specific chip.

No license information was mentioned in the explanation.

In plain English

Embassy is a framework for writing software that runs directly on microcontrollers, the small chips found inside embedded devices like sensors, IoT gadgets, and custom electronics. It is built with the Rust programming language and uses a feature called async/await, which makes it possible to run multiple tasks at the same time without needing a traditional operating system or a separate real-time kernel. The way async/await works in this context is that tasks are converted at compile time into small state machines that take turns running. There is no need to allocate memory for each task separately, and the processor can sleep automatically when there is nothing to do, which helps battery-powered devices last much longer. This approach is described by the project as faster and smaller than traditional real-time operating systems. Embassy includes hardware support libraries for a range of popular microcontroller families, including STM32 chips, Nordic Semiconductor nRF chips, Raspberry Pi RP2040 and RP2350 chips, Texas Instruments MSPM0, and others. These libraries give you safe, readable ways to control hardware features like GPIO pins, timers, and communication buses without writing low-level register code directly. Beyond the core hardware support, Embassy ships with a set of additional components: a time system that works globally without needing per-task configuration, a networking stack covering Ethernet, TCP, UDP, and DHCP, Bluetooth Low Energy support for several chip families, a USB stack for building USB devices, and a bootloader that supports safe over-the-air firmware updates with rollback capability. The project provides many example programs organized by chip family, and getting started requires the Rust toolchain plus a flashing tool called probe-rs. Documentation, an API reference, and a community chat room are available on the project website.

Copy-paste prompts

Prompt 1
Using Embassy for Rust on an RP2040, write firmware that blinks an LED every second while simultaneously reading a temperature sensor over I2C and printing values via USB serial.
Prompt 2
Help me set up Embassy on an STM32F4 board. Show me how to structure a project with two async tasks: one managing UART communication and one driving PWM output.
Prompt 3
Using Embassy's networking stack on an nRF52840, write code that connects over Bluetooth Low Energy, receives a command, and controls a GPIO pin accordingly.
Prompt 4
Explain how Embassy's async/await model works for embedded Rust. How does it differ from using an RTOS like FreeRTOS, and when should I choose Embassy?
Open on GitHub → Explain another repo

← embassy-rs on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.