Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Embassy Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-embassy-knowledge-patch-nevaberry-plugins)
---
name: embassy-knowledge-patch
description: Embassy
version: "0.10.0"
license: MIT
metadata:
author: Nevaberry
---
# Embassy compatibility guidance
Load this skill when migrating Embassy task spawning, timer integration,
networking, USB, synchronization, or nRF, RP, and STM32 HAL code.
Use the topic references for complete guidance and crate-specific release
attributions.
## Reference index
| Reference | Topics |
| --- | --- |
| [Executor](references/executor.md) | Task tokens, unsafe APIs, timer queues, tracing, scheduling, host and architecture backends |
| [Networking](references/networking.md) | Stack handles, IP types, UDP, ICMP, raw sockets, DNS, DHCP, TCP, trait versions |
| [USB](references/usb.md) | Composite descriptors, BOS, audio, CMSIS-DAP, CDC ACM, HID, DFU |
| [nRF drivers](references/nrf-drivers.md) | Ownership, PAC changes, UARTE, buses, GPIO, PWM, timers, radio, NFC, traits |
| [nRF targets](references/nrf-targets.md) | Chip support, initialization, clocks, UICR, GRTC, RRAM, SAADC, SQSPI, VPR, USB, RNG |
| [RP](references/rp.md) | Watchdog, DMA, PIO, clocks, timers, multicore, ownership, pins, traits |
| [STM32 system](references/stm32-system.md) | Driver types, RCC, interrupts, GPIO startup, low power, RTC, dual core, crypto, displays |
| [STM32 memory and DMA](references/stm32-memory-dma.md) | DMA, flash, UID, backup SRAM, serial memory, SDRAM, SDMMC |
| [STM32 analog and timers](references/stm32-analog-timers.md) | ADC, DAC, OPAMP, analog peripherals, capture, PWM, QEI, HRTIM |
| [STM32 communications](references/stm32-communications.md) | I2C, UART, SPI, I2S, SAI, CAN, Ethernet, USB OTG |
| [Time](references/time.md) | Constructors, arithmetic, tick rates, ticker waits, dependency and critical-section selection |
| [Synchronization](references/synchronization.md) | Locks, lazy initialization, pipes, channels, signals, pub/sub, logging and I/O traits |
## Breaking changes and migration
### Handle spawn failure when creating the task token
Executor 0.10.0 moves failure to the `#[task]` function that creates a
`SpawnToken`. Handle that result before calling the now-infallible
`Spawner::spawn`:
```rust
use embassy_executor::{SpawnError, Spawner};
#[embassy_executor::task]
async fn worker() {}
fn start(spawner: Spawner) -> Result<(), SpawnError> {
spawner.spawn(worker()?);
Ok(())
}
```
In executor 0.8.0, `Spawner::for_current_executor` becomes unsafe. An `unsafe`
task also generates an unsafe function for creating its spawn token.
Executor 0.9.0 removes `TaskRef::dangling`; an empty sentinel can use
`Option<TaskRef>`.
### Remove obsolete features and migrate timer queues
- Executor 0.8.0 allocates task pools statically on stable Rust; remove the
deleted `task-arena-size-*` Cargo features.
- With `embassy-time-driver` 0.2 and `embassy-time` 0.4, the time driver owns the
timer queue. Executor 0.7.0 removes `integrated-timers` and its
`embassy-time-queue-driver` implementation.
- Executor 0.9.0 moves `TimeQueueItem` to `embassy-executor-timer-queue`.
Its `timer-item-size-X-words` features replace `timer-item-payload-size-X`.
- Remove `nightly` and `unstable-traits` when upgrading dependency features to
`embassy-time` 0.2.0 or `embassy-sync` 0.5.0.
- `embassy-net` 0.6 removes its `std` Cargo feature.
Since executor 0.8.0, `arch-std` leaves `critical-section/std` disabled by
default. Enable `std` explicitly on the `critical-section` dependency if
relying on its host implementation. With `embassy-time` 0.5.0 and
`embassy-sync` 0.7.0, either crate's `std` feature leaves the choice of
critical-section implementation to the application.
### Update HAL ownership and stored driver types
In `embassy-nrf` 0.4.1, the `Peripheral` trait is removed and `PeripheralRef`
becomes `Peri`; a concrete handle is `Peri<'_, peripherals::UARTE0>`.
Drivers with separate modes use `Blocking` or `Async`. In 0.8.0, drivers drop
`T: Instance`; keep passing the hardware instance to the constructor.
In `embassy-rp` 0.5.0, migrate `PeripheralRef` to `Peri` and update bounds using
the removed `Peripheral` trait. Remove `T: Instance` from `Uart` and
`BufferedUart` types while still passing the instance to the constructor.
STM32 0.2.0 removes pin parameters from GPIO types, DMA channel parameters
from UART and I2C, and peripheral instance parameters from UART and CAN.
I2C types use mode parameters.
Pass pins before the interrupt binding for nRF `Uarte` and `BufferedUarte`
from 0.3.1, RP `BufferedUart` from 0.4.0 and `Uart` from 0.5.0, and STM32
`BufferedUart` from 0.3.0.
### Migrate RP DMA and watchdog calls
In `embassy-rp` 0.10.0, start DMA transfers through the new `Channel` driver.
`Channel::regs` is private, and code outside the DMA module can no longer
construct a `Transfer` directly. Update operation names:
| Previous operation | Replacement |
| --- | --- |
| `read_repeated` | `read_discard` |
| `write_repeated` | `write_zeros` |
| `dma_push_repeated` | `dma_push_zeros` |
| `dma_pull_repeated` | `dma_pull_discard` |
In the same release, pass a duration each time the watchdog is refreshed:
`watchdog.feed(timeout)`. Use `watchdog.stop()` to stop it.
The `PioBatch` interface also changes in 0.10.0.
### Update STM32 initialization and transfer handling
Since STM32 0.2.0, specify RCC bus dividers and clock source selections
directly; set peripheral kernel clock sources through `config.rcc.mux`.
In 0.6.0, RNG initialization panics if its clock is unset, so configure its
clock source before constructing the driver.
STM32 0.6.0 makes `gpio-init-analog` opt-in. Enable it when startup should put
GPIO into analog mode:
```sh
cargo build --features embassy-stm32/gpio-init-analog
```
In STM32 0.5.0, `ExtiInput` requires a concrete pin and an interrupt binding;
migrate constructors taking `AnyPin` or the removed EXTI `AnyChannel`.
Supply `sample_time` when requesting an ADC conversion from 0.5.0.
In STM32 0.6.0, call I2S `start()` after construction to enable I2S and
synchronize the first slave frame. For v2 I2C slave and v1 async slave
methods, `respond_to_write` and `respond_to_read` return actual transfer
counts, which can be shorter than the supplied buffer. Timer input capture
outputs use the timer's word size; use matching buffer and downstream widths.
### Account for nRF waits and HAL pin state on drop
In nRF 0.9.0, `gpiote::InputChannel::wait()` takes `&mut self` and starts
observing events when called, before its future is polled.
In nRF 0.8.0, the timer driver gains cleanup on drop. Use `persist()` on GPIO,
GPIOTE, timer, or PPI drivers when configuration needs to survive the handle.
Dropping nRF PWM places pins in high impedance from 0.11.0. Account for this
if a connected load needs a defined signal after shutdown. RP PWM instead
enables pin pull-downs on drop in 0.5.0; on RP235x it enables input mode while
active and disables input mode on drop.
### Update network handles and datagram callbacks
In `embassy-net` 0.5, `Stack` and `DnsSocket` lose their driver type parameter.
`Stack` is `Copy`, can be passed by value, and needs only one `StaticCell`
when shared across tasks. Drive the network loop with `Runner::run()`.
IP addresses switch to `core::net` types, and UDP sends take and receives
return `UdpMetadata`, including the remote endpoint.
In `embassy-net` 0.9.0, `UdpSocket::send_to_with` and
`IcmpSocket::send_to_with` take an upper bound as `max_size`; their callbacks
return the actual number of bytes written. Omit the driver type argument from
`RawSocket::new` starting in that release.
Use `embedded-io` 0.7 and `embedded-nal` 0.9 with `embassy-net` 0.8.0.
### Check USB defaults and DFU failure reporting
`embassy-usb` 0.4.0 defaults `composite_with_iads` to `true`, `device_class`
to `0xEF`, `device_sub_class` to `0x02`, and `device_protocol` to `0x01`.
Set these explicitly if the host expects different descriptor values.
Pass a zero-length `bos_descriptor_buf` when the device uses no BOS descriptors.
`embassy-usb` 0.6.0 provides standalone DFU and firmware error reporting.
Implement `dfu_mode::Handler::start` with a `Result` to report a failed start.
HID Boot Protocol Mode supports hosts requesting boot keyboard or mouse
reports; the same release uses `usbd-hid` 0.9.0.
## Task, time, and synchronization features
### Task construction, scheduling, and host execution
Executor 0.8.0 accepts an ordinary `#[task]` function returning
`impl Future<Output = ()>`. Its constructed future must be `Send` when spawned
through a `SendSpawner`. The main macro supports selecting the executor.
Executor 0.10.0 adds optional highest-priority and earliest-deadline-first
scheduling, a task metadata API, and `Executor::run_until` for host workloads
that need the `arch-std` executor loop to return. Enabling `metadata-name`
automatically names the main task `main`.
### Fallible and saturating time operations
`embassy-time` 0.5.0 adds `try_from_*` constructors on `Instant` and `Duration`
for values that may exceed their representable range. `Instant::saturating_add`
and `Instant::saturating_sub` clamp results outside the instant range.
`Duration` implements `Sum`; 0.5.1 fills in missing `as_nanos` and `from_nanos`
conversions and adds `Instant::try_from_nanos`.
Since `embassy-time` 0.1.5, Cargo's `links` key enforces one copy per binary.
Align direct and transitive dependencies on the same crate source and a
compatible version so the time driver and application use the same tick rate.
### Locks, channels, and wake behavior
`embassy-sync` 0.7.0 adds `RwLock` for concurrent readers and exclusive writers;
0.6.1 adds `LazyLock` for first-access initialization. In 0.7.0,
`channel::Receiver` and `channel::Channel` implement `Stream`; in 0.8.0,
`channel::Sender` and `channel::Channel` implement `futures_sink::Sink`.
From 0.7.0, `clear()` wakes senders waiting for space on `Channel`,
`PriorityChannel`, `PubSubChannel`, and `zerocopy_channel::Channel`.
In 0.8.0, `Signal::reset()` preserves registered wakers so an already-waiting
task can wake on the next signal, and `MutexGuard::map` accepts unsized targets.
`embassy-sync` 0.6.0 seals `PubSubBehavior` to crate-provided implementations.
Route direct `publish_immediate` calls through the queue's immediate publisher:
```rust
queue.immediate_publisher().publish_immediate(message);
```