Skip to content
Back to skills

Embassy Knowledge Patch

ASecurity

Embassy

  • 25 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
developmentrustgoapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill embassy-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Embassy Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Embassy Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-embassy-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-embassy-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: embassy-knowledge-patch
description: Embassy
version: "0.10.0"
license: MIT
metadata:
  author: Nevaberry
---


# Embassy compatibility guidance

Load this skill when migrating Embassy dependencies or working on executor tasks,
timer integration, network sockets, USB classes, synchronization, or Nordic, RP,
and STM32 peripheral drivers. Use the quick references for migration points and
the topic files for complete API, behavior, and target-specific guidance.

## Reference index

| Reference | Topics |
| --- | --- |
| [Executor](references/executor.md) | Spawn tokens, task pools, unsafe calls, timer queues, tracing, scheduling, host and processor backends |
| [Networking](references/networking.md) | Stack handles, address types, UDP, ICMP, raw sockets, DNS, TCP, trait compatibility |
| [USB](references/usb.md) | Composite descriptors, BOS, audio, CMSIS-DAP, CDC ACM, HID, DFU |
| [Nordic HAL](references/nrf.md) | Peripheral ownership, PAC, serial buses, GPIO, timers, radio, nRF54, power, RNG |
| [RP HAL](references/rp.md) | DMA, PIO, peripheral types, watchdog, clocks, alarms, multicore, reset |
| [STM32 system](references/stm32-system.md) | Driver types, RCC, GPIO, EXTI, interrupt bindings, low power, RTC |
| [STM32 analog and timers](references/stm32-analog-timers.md) | ADC, DAC, OPAMP, capture, PWM, QEI, HRTIM, comparators, watchdog |
| [STM32 serial and audio](references/stm32-serial-audio.md) | I2C, UART, USART, SPI, I2S, SAI, CAN |
| [STM32 memory and connectivity](references/stm32-memory-connectivity.md) | DMA, flash, UID, SRAM, external memory, SDMMC, Ethernet, USB, crypto, displays |
| [Time](references/time.md) | Shared feature migration, critical sections, crate identity, tick rates, arithmetic, ticker futures |
| [Synchronization](references/synchronization.md) | Channels, pub/sub, wakeups, streams, sinks, locks, guards, lazy values, pipes, trait versions |

## Breaking changes and migration

### Handle spawn failure while creating the task token

In executor 0.10.0, calling a `#[task]` function can fail to create a
`SpawnToken`. Handle that result before 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.

### Remove deleted features and select critical sections explicitly

- Executor 0.8.0 statically allocates task pools on stable Rust. Remove
  `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 to `embassy-time`
  0.2.0 or `embassy-sync` 0.5.0.
- Since executor 0.8.0, `arch-std` leaves `critical-section/std` disabled by
  default. Enable `std` on `critical-section` if relying on its host implementation.
- With `embassy-time` 0.5.0 and `embassy-sync` 0.7.0, either crate's `std`
  feature leaves critical-section implementation selection to the application.
- `embassy-net` 0.6 removes its `std` feature.

### Migrate peripheral handles, driver types, and constructor arguments

- In `embassy-nrf` 0.4.1 and `embassy-rp` 0.5.0, `PeripheralRef` becomes
  `Peri` and the `Peripheral` trait is removed.
- In `embassy-nrf` 0.8.0, drivers drop `T: Instance`. Remove it from stored
  driver types and signatures while still passing the hardware instance to constructors.
- In `embassy-rp` 0.5.0, `Uart` and `BufferedUart` drop `T: Instance`;
  constructors still take the hardware instance.
- Pass pins before interrupt bindings for Nordic `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.
- `embassy-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.
- In `embassy-stm32` 0.5.0, `ExtiInput` requires a concrete pin and interrupt
  binding. Migrate constructors using `AnyPin` or the removed EXTI `AnyChannel`.

### RP watchdog and DMA calls

In `embassy-rp` 0.10.0, pass a duration on every watchdog refresh:

```rust
watchdog.feed(timeout);
```

Use `watchdog.stop()` to stop it. Use the DMA `Channel` driver API to start
transfers: `Channel::regs` is private, and code outside the DMA module can no
longer construct a `Transfer` directly.

| RP DMA operation before 0.10.0 | Replacement in 0.10.0 |
| --- | --- |
| `read_repeated` | `read_discard` |
| `write_repeated` | `write_zeros` |
| `dma_push_repeated` | `dma_push_zeros` |
| `dma_pull_repeated` | `dma_pull_discard` |

### Peripheral startup, shutdown, and transfer behavior

- `embassy-nrf` 0.8.0 adds timer cleanup on drop. Use `persist()` on GPIO,
  GPIOTE, timer, or PPI drivers when configuration needs to survive the handle.
- In `embassy-nrf` 0.11.0, dropping PWM puts its pins in high impedance.
  Account for that state if the connected load needs a defined shutdown signal.
- In `embassy-rp` 0.5.0, PWM enables pin pull-downs on drop. On RP235x it
  enables input mode while active and disables that mode on drop.
- In `embassy-stm32` 0.6.0, RNG initialization panics without a configured
  RNG clock. Configure its clock source before constructing the driver.
- `embassy-stm32` 0.6.0 makes `gpio-init-analog` opt-in. Enable it when
  startup should put GPIO into analog mode.
- In `embassy-stm32` 0.6.0, call I2S `start()` after construction to enable
  I2S and synchronize the first slave frame. Prime SAI with an initial write
  before starting it on 0.2.0 and later.
- In `embassy-stm32` 0.6.0, v2 slave and v1 async slave I2C methods
  `respond_to_write` and `respond_to_read` return actual transfer counts;
  these can be shorter than the supplied buffer.

### Network handles, packet callbacks, and USB defaults

- In `embassy-net` 0.5, `Stack` and `DnsSocket` lose their driver parameter.
  `Stack` is `Copy`; sharing it across tasks requires only one `StaticCell`.
  Drive the network loop with `Runner::run()`.
- `embassy-net` 0.5 uses `core::net` address types. 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 `max_size` as an upper bound; their callbacks
  return the actual number of payload bytes written.
- `embassy-net` 0.8.0 uses `embedded-io` 0.7 and `embedded-nal` 0.9.
  Use matching trait versions for socket and client integrations.
- `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 them explicitly if the host expects other descriptor values.
- In `embassy-usb` 0.6.0, implement `dfu_mode::Handler::start` with a `Result`
  so the standalone DFU class can report a failed start.

### Pub/sub publishing and dependency alignment

`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);
```

From `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.

## Task, I/O, and synchronization features

### Task construction, scheduling, and host execution

Executor 0.8.0 accepts ordinary `#[task]` functions returning
`impl Future<Output = ()>`. The constructed future must be `Send` when spawned
through a `SendSpawner`. The main macro can select the entry-point executor.

Executor 0.10.0 adds optional highest-priority and earliest-deadline-first
scheduling, task metadata, and `Executor::run_until` for host workloads that
need the executor loop to return. Enabling `metadata-name` names the main task
`main`. See [executor integration](references/executor.md) for timer-queue waker
hooks, fallible task lookup, tracing, and processor backend migration.

### Socket buffers and USB classes

`embassy-net` 0.5 adds `recv_from_with` and `send_to_with` for direct queued
packet-buffer access. Since 0.7, an oversized UDP send fails instead of waiting
indefinitely; 0.7 also adds ICMP sockets and ping with configurable `rate_limit`.

`embassy-usb` 0.5.0 adds CDC ACM `embedded-io-async` implementations and a
CMSIS-DAP v2 class. In 0.6.0, dropping a pending `BufferedReceiver` future and
starting another read no longer replays data. HID Boot Protocol Mode is supported
in 0.6.0, which uses `usbd-hid` 0.9.0.

### Time arithmetic and channel wakeups

`embassy-time` 0.5.0 adds fallible `try_from_*` constructors for `Instant` and
`Duration`, saturating instant arithmetic, and `Sum` for durations. Version
0.5.1 adds `Instant::try_from_nanos` and missing nanosecond conversions.

`embassy-sync` 0.7.0 adds `RwLock`, queued-message inspection with `peek`, and
`Stream` for channel receivers and channels. Version 0.8.0 adds
`futures_sink::Sink` for channel senders and channels, preserves registered
wakers in `Signal::reset()`, and lets `MutexGuard::map` target unsized values.

Since `embassy-sync` 0.7.0, `clear()` wakes senders waiting for space on
`Channel`, `PriorityChannel`, `PubSubChannel`, and `zerocopy_channel::Channel`.
The zero-copy channel can satisfy `Send` and `Sync` when its types permit them.

### Peripheral configuration and data paths

`embassy-nrf` 0.9.0 adds `gpiote::InputChannel` high/low waits. Its `wait()`
takes `&mut self` and observes events when called, before its future is polled.
`SimplePwm` accepts configuration at construction and supports configurable
pin idle states, inverted duty-cycle polarity, and updating all channels at once.

`embassy-rp` 0.10.0 exposes PIO FIFO pointers and DMA request selectors,
adds a PIO clock generator, and supports explicit PIO I2S start and stop.
See [RP peripherals](references/rp.md) for PIO bus drivers and multicore behavior.

In `embassy-stm32` 0.5.0, supply `sample_time` when requesting an ADC conversion.
In 0.6.0, ring-buffered ADC reads align to scan sequence length and
`RingBufferedAdc` exposes `set_alignment()`. All timer input capture outputs use
the timer's word size, so use buffers and downstream values of matching width.

Files in this skill

  • SKILL.md10.5 KB
  • coverage.json871 B
  • references/executor.md3.5 KB
  • references/networking.md2.6 KB
  • references/nrf.md6.1 KB
  • references/rp.md4.7 KB
  • references/stm32-analog-timers.md2.7 KB
  • references/stm32-memory-connectivity.md2.9 KB
  • references/stm32-serial-audio.md2.6 KB
  • references/stm32-system.md3.9 KB
  • references/synchronization.md3.1 KB
  • references/time.md2 KB
  • references/usb.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.