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 Rtic Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-rtic-knowledge-patch)
---
name: rtic-knowledge-patch
description: RTIC
version: "2.4.0"
license: MIT
metadata:
author: Nevaberry
---
# RTIC compatibility guidance
Load this skill when updating RTIC task definitions, executor code, resource
locking, synchronization primitives, or monotonic timers. Use the topic
references for crate-specific versions and the full compatibility details.
## Reference index
| Reference | Topics |
| --- | --- |
| [Task definitions and builds](references/tasks-and-macros.md) | Local tasks, resource bounds, context lifetimes, task attributes, external definitions, backend features, stable Rust |
| [Executors and resource locks](references/runtime-and-locks.md) | Executor storage and removed APIs, wakers, mutex handles, interrupt masks, BASEPRI, monotonic priority |
| [Synchronization](references/synchronization.md) | Watch, Signal, channels, bus sharing, macros, defmt, atomics |
| [Time APIs](references/time-api.md) | Monotonic and timer-queue traits, delay traits, v1 counter helpers, duration delays, queue deadlines |
| [Timer backends](references/timer-backends.md) | Tick rates, SysTick, nRF, Silicon Labs, ESP32, RP2040/RP235x, i.MX RT, STM32, generated types |
## Breaking changes and deprecations
### Executor storage and removed APIs
RTIC 2.4.0 puts each async software-task executor in static storage; account
for its RAM under `.bss`. The release removes:
- `init::Context::executors_size`.
- The executor-allocation stack-overflow check in `init`.
- `AsyncTaskExecutorPtr`.
- The `AsyncTaskExecutor::new_N_args` and
`AsyncTaskExecutor::from_ptr_N_args` method families for pointer-based access.
### Backend feature selection
When upgrading to RTIC 2.3.1, remove `cortex-m`, `esp32c3`, `esp32c6`, `riscv`,
and `riscv-slic` from the `rtic` feature list and select the target backend.
Also remove the deleted `test-critical-section` feature.
The macro crate drops its shared `riscv-slic` feature used by `riscv-clint`
and `riscv-mecall`; its build script checks that exactly one implementation
is selected.
### Synchronization feature and splitting changes
The formerly unstable APIs become stable in `rtic-sync` 1.3.0. Remove
`unstable` from the dependency's Cargo feature list when upgrading.
Starting in `rtic-sync` 1.5.0, a `Signal` can be split only once. In 1.4.0,
`Channel::split()` stops panicking immediately on repeat calls. Dropping a
`Receiver` drops items still queued in its channel.
### nRF91 feature migration
In `rtic-monotonics` 2.2.0, choose the `-s` feature for a secure build or
`-ns` for a non-secure build. Replace the deprecated `nrf9160` alias with
`nrf9160-ns` to keep the non-secure configuration. The complete feature
pairs are in [Timer backends](references/timer-backends.md).
### Time API changes
In `rtic-time` 2.0.0, application code uses `Monotonic`. A hardware backend
implements `TimerQueueBackend` in ticks and uses `TimerQueueBasedMonotonic`
to translate ticks into the `Instant` and `Duration` types exposed through
`Monotonic`.
For v1 custom code, `rtic-time` 1.2.0 changes the signature of
`half_period_counter::calculate_now` to fix a race; update custom callers
when upgrading. It also deprecates `Monotonic::should_dequeue_check`.
## Task constraints and definitions
### Local tasks and resource bounds
RTIC 2.3.0 adds `#[task(local_task = true)]` for arguments that are `!Send`
or `!Sync`. Only the same executor can spawn a local task. With
`rtic-macros` 2.3.1, arguments can use patterns and `local_task = true`
can appear anywhere in the task attribute.
```rust
#[task(local_task = true, priority = 1)]
async fn read(_cx: read::Context<'_>, (_port, _pin): (u8, u8)) {}
```
RTIC 2.3.0 requires `Send` for `Local` resources initialized by `init`,
including those used by local tasks. The macro also accounts for task-local
external resources when deciding which resources require `Send`.
Generated shared-resource mutex handles are `!Send` in `rtic-macros` 2.3.0.
Keep the handles in the task that uses them.
### Context and executor lifetimes
RTIC 2.1.3 supports software tasks returning `!` and gives them a `'static`
context. In 2.3.1, a non-diverging task declared in an `extern "Rust"`
block must use a non-static context lifetime such as `task_name::Context<'_>`.
Starting in RTIC 2.1.3, the executor used for spawning must be `'static`.
Custom code that constructs an executor must give it static storage.
### Waking and configuring tasks
RTIC 2.2.0 exposes a public executor `waker` constructor, and `rtic-macros`
2.2.0 generates a `waker` getter for software tasks. Use the getter when
another async component needs to wake a software task.
Since RTIC 2.0.1, use `priority = 0` for the lowest async task priority.
RTIC and `rtic-macros` 2.3.0 correctly apply `#[cfg]` to hardware and
software tasks, allowing a feature or target condition to exclude a task
from the generated app. They also forward outer app-module attributes to
generated code, so module-level attributes affect generated items.
## Synchronization quick reference
### Latest-value sharing
`rtic-sync` 1.5.0 adds `Watch`: once initialized, it returns the latest
value on every read and retains it for later reads.
### Bus initialization and async sharing
`rtic-sync` 1.4.0 adds `BlockingArbiterDevice` in both
`rtic_sync::arbiter::i2c` and `rtic_sync::arbiter::spi`. Use the blocking
`embedded-hal` traits in RTIC `init`, then convert to an async
`ArbiterDevice` when initialization is complete.
```rust
let async_device = blocking_device.into_non_blocking();
```
The I2C and SPI `ArbiterDevice` types share buses through
`embedded-hal-async` traits starting in `rtic-sync` 1.1.0. Starting in
1.2.0, match the bus and driver to `embedded-hal` 1.0.
### Channel types and capacity
Since `rtic-sync` 1.2.0, `make_channel!` accepts any Rust type expression,
including a tuple:
```rust
let (sender, receiver) = rtic_sync::make_channel!((u8, u16), 4);
```
`rtic-sync` 1.5.0 correctly evaluates the compile-time check that a
`channel::Channel` has a capacity below 256.
## Timer configuration and interrupt behavior
### Tick rates and driver delays
`rtic-monotonics` 2.0.0 ports timers to the new `rtic-time` API and lets
you choose the tick rate for most timers. In `rtic-monotonics` 2.2.0, an
STM32 prescaler outside the hardware range causes a panic; choose a tick
rate that keeps the resulting prescaler within range for the timer's input
clock.
`rtic-time` 1.3.0 and `rtic-monotonics` 1.5.0 adopt stable `embedded-hal`
1.0. Use the corresponding 1.0 delay traits when passing these monotonics
to drivers.
For v1 custom `Monotonic` implementations, `rtic-time` 1.1.0 requires
`const TICK_PERIOD` so duration-based delays wait at least the requested
duration. The corresponding supplied-timer fix is in `rtic-monotonics`
1.4.0.
### Lock and monotonic interrupt behavior
In RTIC 2.4.0, exiting a source-mask lock leaves the enable state of
interrupts outside the lock's mask alone. Shared accesses protected by a
`BASEPRI` resource lock stay inside the critical section.
When the device has a spare priority level, RTIC 2.4.0 sets
`RTIC_ASYNC_MAX_LOGICAL_PRIO` above the highest software-task priority.
This allows a monotonic timer interrupt to preempt a blocking software task.