// the find
rtic-rs/rtic
Real-Time Interrupt-driven Concurrency (RTIC) framework for ARM Cortex-M microcontrollers
RTIC is a concurrency framework for Cortex-M (and increasingly RISC-V) microcontrollers that replaces a traditional RTOS with a priority-based interrupt model backed by the Stack Resource Policy algorithm. Tasks are async Rust functions dispatched by hardware interrupts; shared state access is mediated by priority-based critical sections that the compiler verifies are deadlock-free. It's for embedded Rust developers who want structured concurrency without the overhead of a thread scheduler.
Deadlock freedom and data-race freedom are compile-time guarantees, not runtime checks — the macro system generates the priority ceiling analysis so you can't write a lock inversion. Single shared call stack means RAM usage is predictable and minimal; a typical RTOS per-thread stack reservation disappears entirely. The async executor is hardware-driven: task wakeups map directly to interrupt pending bits, so context switching is just NVIC priority arbitration with no software trampoline. CI runs examples under QEMU for multiple targets (lm3s6965, hifive1, ESP32-C3) with expected output files checked in, so regressions in generated code are caught automatically.
The proc-macro approach that makes correctness guarantees possible also makes debugging generated code miserable — when something goes wrong at compile time the error messages point into macro-expanded code that doesn't map to what you wrote. RISC-V support is explicitly partial with documented limitations and target-specific gotchas, so if you're not on Cortex-M you're a second-class citizen. There's no built-in way to share state between RTIC and an embassy async executor running on the same chip; the book acknowledges this but the interop story is immature. The task capacity system (bounded channels for software tasks) requires compile-time sizing, which means any dynamic spawn pattern needs you to pre-size queues correctly or get a runtime spawn error — not a panic, just a silent discard unless you check the return value.