Table of Contents
RT vs NIL Comparison and Performance
RT and NIL are the two RTOSes part of the ChibiOS families, they share most of the API and are very compatible but the internal solutions are entirely different and driven by different requirements:
RT
RT is meant to be a very complete embedded RTOS focused on:
- Very complete features set, it has to offer a very comprehensive API.
- High performance, no compromises in this area.
- Compact as possible given the first two requirements.
NIL
NIL is wholly different beast focusing on different requirements:
- As compact as possible.
- Compatible with RT as long this does not impact code size.
Features Comparison
This table summarizes the differences in features, note that a - marks a missing feature, a + is a compatible feature available in OSLIB.
Feature | RT | NIL | LIB | Notes |
---|---|---|---|---|
Weak-SMP | yes | no | - | Support for multiple cores running isolated OS instances. |
Full-SMP | yes | no | - | Support for multiple symmetric cores running cooperating OS instances. |
Integrity check (FuSa) | yes | no | - | Self-diagnostic capability. |
RFCU (FuSa) | yes | no | - | Runtime Faults Collection Unit. |
System Time | yes | yes | - | 16 or 32 bits system time counter. |
High Resolution Time | yes | no | - | System time, timers and delays at very high resolutions. |
Time Stamps | yes | no | - | High resolution 64 bits time stamps. |
Real Tick-less Mode | yes | yes | - | There is no periodic system tick for optimal power management. |
Critical Sections | yes | yes | - | Critical sections abstraction. |
IRQ Management | yes | yes | - | ISRs abstraction. |
Zero Latency Interrupts | yes | yes | - | IRQs unaffected by the kernel and with no kernel-related added latency. |
Virtual Timers | yes | no | - | Unlimited software one-shot/continuous timers with no IRQ overhead. |
Timeouts | yes | yes | yes | Wait primitives with time-out specification. |
Time Measurement | yes | no | - | Execution time measurement with clock-cycle precision. |
Full Threads Paradigm | yes | yes | - | Threads create/join functionality. |
Threads Registry | yes | yes | - | Runtime tasks state structure for debuggers. |
Preemption | yes | yes | - | Fully preemptive scheduling. |
Round Robin Scheduling | yes | no | - | Round robin scheduling for threads at equal priority. |
Messages | yes | yes | - | Inter-thread synchronous messages. |
Mailboxes | + | + | yes | Message queues. |
Pipes | + | + | yes | Characters pipes. |
Counter Semaphores | yes | yes | - | Semaphores with resources counter. |
Binary Semaphores | + | + | yes | Semaphores with boolean state. |
Mutexes | yes | no | - | Mutexes implementing the Priority Inheritance algorithm. |
Condition Variables | yes | no | - | Condition Variables and Monitors. |
Events | yes | yes | - | Events, Event Flags, Event Sources. |
Dynamic Threading | + | - | yes | Dynamic threading. |
Memory Allocators | + | + | yes | Various memory allocators (core, pools, heaps). |
Objects FIFOs | + | + | yes | FIFOs of generic objects. |
Objects Factory | + | + | yes | Handling of dynamic reference-counted objects accessible by a readable name. |
Runtime Statistics | yes | no | - | Execution times of critical code paths with clock cycle resolution. |
System State Checker | yes | yes | - | Development time call protocols check. |
Parameter Checks | yes | yes | - | Development time function parameters checks. |
Assertions | yes | yes | - | Development time kernel consistency checks. |
Trace Buffer | yes | no | - | Storage for the latest N context switch events. |
Stack Overflows Check | yes | yes | - | Runtime stack overflow checks. |
Stack Fill | yes | yes | - | Stack pattern fill for usage measurement. |
CMSIS RTOS | yes | no | - | CMSIS RTOS emulation layer. |
NASA OSAL | yes | no | - | NASA OSAL emulation layer. |
Performance Table
The benchmark is: number of thread-to-thread context switches per second.
RT
RT has excellent performance across the board.
No FPU | FPU | |||||
---|---|---|---|---|---|---|
Platform | GCC | IAR | Keil | GCC | IAR | Keil |
STM32F303 (M4 72MHz) | 894.264 | 688.856 | 856.976 | 628.696 | 519.728 | 610.024 |
STM32G0 (M0+ 64MHz) | 591.904 | - | - | - | - | - |
STM32G4 (M4 170MHz) | 2.566.024 | - | - | 1.730.272 | - | - |
STM32H7 (M7 480MHz) | 7.164.080 | - | - | 5.338.384 | - | - |
NIL
The difference with RT is not much but it is clear that RT is more performance-oriented, NIL is optimized for code size.
No FPU | FPU | |||||
---|---|---|---|---|---|---|
Platform | GCC | IAR | Keil | GCC | IAR | Keil |
STM32F303 (M4 72MHz) | 671.272 | - | 509.688 | - | - | |
STM32G0 (M0+ 64MHz) | 540.648 | - | - | - | - | - |
STM32G4 (M4 170MHz) | 2.124.984 | - | - | 1.491.216 | - | - |
STM32H7 (M7 480MHz) | 8.135.512 | - | - | 5.680.392 | - | - |
Benchmarks
Full performance data is available as test reports. Note that those reports can be generated by any ChibiOS demo.
21.6 branch
- nil-stm32f3-72mhz-gcc-fpu.txt, 12.1 KiB
- nil-stm32f3-72mhz-gcc.txt, 12.1 KiB
- nil-stm32g0-64mhz-gcc.txt, 12.1 KiB
- nil-stm32g4-170mhz-gcc-fpu.txt, 12.1 KiB
- nil-stm32g4-170mhz-gcc.txt, 12.1 KiB
- nil-stm32h7-480mhz-gcc-fpu.txt, 12.2 KiB
- nil-stm32h7-480mhz-gcc.txt, 12.2 KiB
- rt-rp2040-125mhz-gcc.txt, 16.9 KiB
- rt-stm32f3-72mhz-gcc-fpu.txt, 16.9 KiB
- rt-stm32f3-72mhz-gcc.txt, 16.9 KiB
- rt-stm32f3-72mhz-iar-fpu.txt, 11.1 KiB
- rt-stm32f3-72mhz-iar.txt, 11.1 KiB
- rt-stm32f3-72mhz-keil-fpu.txt, 11.1 KiB
- rt-stm32f3-72mhz-keil.txt, 11.1 KiB
- rt-stm32g0-64mhz-gcc.txt, 17.0 KiB
- rt-stm32g4-170mhz-gcc-fpu.txt, 17.0 KiB
- rt-stm32g4-170mhz-gcc.txt, 17.0 KiB
- rt-stm32h7-480mhz-gcc-fpu.txt, 17.0 KiB
- rt-stm32h7-480mhz-gcc.txt, 17.0 KiB
20.3 branch
- nil-stm32f3-72mhz-gcc-fpu.txt, 12.2 KiB
- nil-stm32f3-72mhz-gcc.txt, 12.2 KiB
- nil-stm32g0-64mhz-gcc.txt, 12.2 KiB
- nil-stm32g4-170mhz-gcc-fpu.txt, 12.2 KiB
- nil-stm32g4-170mhz-gcc.txt, 12.2 KiB
- nil-stm32h7-480mhz-gcc-fpu.txt, 12.2 KiB
- nil-stm32h7-480mhz-gcc.txt, 12.2 KiB
- rt-stm32f3-72mhz-gcc-fpu.txt, 16.7 KiB
- rt-stm32f3-72mhz-gcc.txt, 16.7 KiB
- rt-stm32f3-72mhz-iar-fpu.txt, 10.8 KiB
- rt-stm32f3-72mhz-iar.txt, 10.8 KiB
- rt-stm32f3-72mhz-keil-fpu.txt, 10.8 KiB
- rt-stm32f3-72mhz-keil.txt, 10.8 KiB
- rt-stm32g0-64mhz-gcc.txt, 16.8 KiB
- rt-stm32g4-170mhz-gcc-fpu.txt, 16.8 KiB
- rt-stm32g4-170mhz-gcc.txt, 16.8 KiB
- rt-stm32h7-480mhz-gcc-fpu.txt, 16.8 KiB
- rt-stm32h7-480mhz-gcc.txt, 16.8 KiB