ChibiOS/RT on the Raspberry Pi
FreeReal-time OS port for Raspberry Pi with device drivers
FreeFree tier
About ChibiOS/RT on the Raspberry Pi
ChibiOS/RT on the Raspberry Pi is a port of the ChibiOS/RT real-time operating system to the Raspberry Pi single-board computer. Created by Steve Bate, this port provides an efficient, preemptive kernel alternative to Linux for applications requiring low latency and predictable real-time behavior. It includes device drivers for GPIO, Serial, General-Purpose Timer (GPT), I2C, SPI, and PWM, with example projects for sensors like TMP102, MCP3008 ADC, MCP4725 DAC, and DS1307 RTC. The port is designed for learning about embedded OS concepts such as cross compilation, thread context switching, concurrency control, interrupt processing, and device driver development.
Key Features
Efficient and portable preemptive kernel with best-in-class context switch performance
Static architecture with compile-time allocation, optional dynamic extensions
Rich set of primitives: threads, virtual timers, semaphores, mutexes, condition variables, messages, mailboxes, event flags, queues
Hardware Abstraction Layer (HAL) supporting abstract device drivers (Port, Serial, ADC, CAN, EXT, GPT, I2C, ICU, MAC, MMC, PWM, RTC, SDC, SPI, UART, USB, USB-CDC)
Support for external components: uIP, lwIP, FatFs
Extensive test suite with benchmarks
C++ application support
Raspberry Pi-specific drivers: GPIO, Serial, GPT, I2C, SPI, PWM
Example projects for external sensors and devices
Pros & Cons
Pros
- Much smaller codebase than Linux, easier to understand and approach
- Portable to other hardware platforms (e.g., Arduino) that do not support Linux
- Real-time performance with deterministic behavior
- Comprehensive set of synchronization primitives and device drivers
- Active community and extensive documentation for ChibiOS/RT core
Cons
- Requires a separate development computer with ARM cross-compiler (not self-hosted on Pi)
- Setup involves toolchain installation and configuration which may be non-trivial for beginners
- Limited to Raspberry Pi models supported by the port (primarily first generation Pi based on content)
- Some drivers (e.g., MAC, USB) not yet implemented for Raspberry Pi in this port
Best For
Embedded applications requiring low latency and predictable real-time responseLearning about RTOS concepts, cross compilation, and device driver developmentPrototyping with Raspberry Pi alongside sensors (temperature, ADC, DAC, RTC)Alternative to Linux for resource-constrained embedded projects
FAQ
What is ChibiOS/RT on the Raspberry Pi?
It is a port of the ChibiOS/RT real-time operating system to the Raspberry Pi, allowing developers to run a lightweight RTOS instead of Linux for real-time embedded applications.
What hardware is supported?
The port currently provides drivers for GPIO, Serial, General-Purpose Timer (GPT), I2C, SPI, and PWM. Example projects exist for TMP102, MCP3008, MCP4725, and DS1307.
Do I need Eclipse to develop with ChibiOS/RT?
No, Eclipse is optional. The author uses command-line tools (Vi/Emacs) and GNU make. Eclipse CDT can be used if preferred.
Can I compile directly on the Raspberry Pi?
Theoretically possible but not effective. A separate development computer (Linux, OS X, or Windows) with an ARM cross-compiler is recommended.