talira

Real-Time Interrupt-driven Concurrency: the hardware accelerated Rust RTOS

open sourceMIT OR Apache-2.0self-hostablefree

RTIC (Real-Time Interrupt-driven Concurrency) is an open source Rust framework for building real-time embedded systems on microcontrollers. Tasks are the unit of concurrency: hardware tasks run in response to interrupts and software tasks are spawned by the application, with message passing, priorities and preemptive multitasking. It uses the interrupt controller to do most of the scheduling, so overhead is minimal, all tasks share one call stack and no heap allocator is needed. Resources are shared through priority-based critical sections that are free of data races, and deadlock-free execution is guaranteed at compile time. A timer queue and monotonic timers let tasks be delayed or run periodically, and the task model suits worst-case execution time and scheduling analysis. It fully supports all ARM Cortex-M devices and most RISC-V devices, and is dual-licensed MIT or Apache-2.0.

Problems it solves

  • a real-time operating system for Rust on a microcontroller
  • run concurrent tasks on an ARM Cortex-M chip in Rust
  • share data between interrupt handlers without data races or deadlocks
  • an RTOS with minimal overhead that uses the hardware interrupt controller for scheduling
  • schedule periodic tasks in embedded Rust firmware
  • preemptive multitasking with priorities on a RISC-V microcontroller
  • an embedded concurrency framework that works without a heap allocator

Features

  • hardware tasks triggered by interrupts and software tasks spawned on demand
  • message passing to software tasks
  • timer queue for delayed and periodic tasks
  • task priorities and preemptive multitasking
  • data-race-free resource sharing through priority-based critical sections
  • deadlock freedom guaranteed at compile time
  • hardware-accelerated scheduling with minimal overhead
  • single shared call stack, no dynamic memory allocator needed
  • all Cortex-M devices supported, most RISC-V devices
  • task model suited to WCET and scheduling analysis

Limitations

  • Supports most RISC-V devices, not all, and its RISC-V backends have their own limitations1

Alternatives

The same job

These do what RTIC does.

  1. Embassy The next-generation framework for embedded applications

Compare RTIC with the top 3