Breaking
November 21, 2024

Making Sense of Real-Time Operating Systems in 2024 Maya Posch | usagoldmines.com

The best part about real-time OS (RTOS) availability in 2024 is that we developers are positively spoiled for choice, but as a corollary this also makes it a complete pain to determine what the optimal choice for a project is. Beyond simply opting for a safe choice like FreeRTOS for an MCU project and figuring out any implications later during the development process, it can pay off massively to invest some time up-front matching the project requirements with the features offered by these various RTOSes. A few years ago I wrote a primer on the various levels of ‘real-time’ and whether you may even just want to forego an RTOS at all and use a simple Big Loop™ & interrupt-based design.

With such design parameters in mind, we can then look more clearly at the available RTOS options available today, which is the focus of this article. Obviously it won’t be an exhaustive comparison, and especially projects like FreeRTOS have seen themselves customized to various degrees by manufacturers like ST Microelectronics and Espressif, among others. This also brings to the forefront less pleasant considerations, such as expected support levels, as illustrated by e.g. Microsoft’s Azure RTOS (formerly ThreadX) recently getting moved to the Eclipse Foundation as the Apache ThreadX open source project. On one hand this could make it a solid open-source licensed RTOS, or it could have been open sourced because Microsoft has moved on to something else and cleared out its cupboard.

Thus without further ado, let’s have a look at RTOSes in 2024 and which ones are worth considering, in my opinion.

Answering Some Questions

A crucial distinction when looking at operating systems for embedded systems is the kind of platform it is. If it’s something along the lines of an x86, Cortex-A ARM or similar, you’re likely looking at a desktop-like system, where a real-time OS such as VxWorks, QNX, a BSD or Linux (with or without real-time patches) is probably the best choice, if only due to hardware support concerns. For situations where hard real-time considerations are the most essential, an FPGA/CPLD-based solution might instead be worth it, but this is of course less flexible than an MCU-based solution.

If at this point an MCU-based solution seems the most sensible one, the next logical question is ‘which one RTOS?’. The answer to this is hidden somewhere in long lists of RTOSes, such as the one found over at Wikipedia, or the one over at the OSRTOS website. Assuming for a moment that we are looking only at open source RTOSes here that are seeing active development, we can narrow it down somewhat to the following list:

Of note is that the popular Mbed project was abandoned in July of 2024, rendering the future of this RTOS highly uncertain. Even with that one taken out of the picture, we are still left with an impressive list. Is NuttX better than ThreadX? What about Zephyr versus RIOT or ChibiOS/RT? Merely reading the bullet points for the features gets one only so far. Perhaps the most important questions here pertain to issues such as:

  • Build system requirements
  • Demands on a specific compiler (version)
  • Programming languages one can use with the OS
  • Whether direct hardware access to peripherals is allowed or require going through a HAL of some description.
  • Support availability when something inevitably doesn’t work as expected.
  • Accessibility of the source code when reading through it (readability, documentation, etc.)

Baseline Expectations

The baseline for the build environment demands and supported features is set here at FreeRTOS. It runs on a wide range of (MCU) platforms, provides a number of schedulers, SMP support, happily compiles with just about any compiler toolchain and is C-based so can be used with any programming language that can cooperate with C APIs. Direct hardware access is the standard way for peripherals and the OS generally gets out of your way beyond scheduling and multi-tasking matters. This ‘stay out of the way’ approach persists with developer tools and configuration, which works as easily in Vim as in any other editor.

ThreadX

As of writing the documentation is a stack of Markdown files on GitHub which are clearly not converted yet from their Azure OS era, and ‘getting started’ refers to connecting to the Microsoft Azure cloud. Building the library is apparently done using CMake, Ninja and the standard ARM GCC toolchain for ARM targets, but where’s a sample project and what about other MCU platforms?

After confusing myself clicking through the ‘documentation’ for a while, I’m sure that I would not pick this RTOS as I am spending far too much time even figuring out the basics.

Contiki-NG

Documentation exists and doesn’t look too bad, but you’re pushed right into using a Docker image for development. Fortunately native installation instructions are provided for Linux and MacOS, but not Windows. It’s clear that this RTOS is focused on Internet of Things projects, while the ability to easily run the code as a native (Linux) process is nifty.

Feels like this RTOS could be nice for network-related projects.

OpenERIKA

Confusing website and the impression is that it’s ‘free’, but do not expect any support unless you’re willing to pay for it. Hard pass.

MicroC/OS

I’m sure that Silicon Labs had good intentions with their Micrium OS site, but it’s too hard to find anything on it, never mind how to get started with the thing, plus it seems locked to Silabs devices. Ditto for the Weston-Embedded website. Hard pass.

RIOT

Seems to use basic tools and the standard platform toolchains per the ‘getting started‘ documentation. Build system is GNU Make-based, which is very flexible and should integrate with other build systems with little issue. Quite a lot of documentation to dig through, and might be worth scratching an itch with that FreeRTOS doesn’t cover?

NuttX, Zephyr, ChibiOS/RT

RTOSes which have lots of bullet points are kinda fancy, but demanding the use of KConfig with NuttX, the insistence on setting up a special Python-based development with Zephyr and the seemingly hard requirement to use the special IDE with ChibiOS/RT all makes for problematic choices that will make developing with these either impossible — KConfig on Windows — or integrating with other build systems impossible to tedious.

While I’m not a Python hater, my experiences with Python-based build environments and tools are very negative, and I’d rather avoid such unnecessary dependencies in a development workflow. If you’re a Python fan, you might want to look more seriously at Zephyr.

With that said, the remaining RTOSes in the list are fairly small and can probably be skipped safely.

FreeRTOS

Back in my original 2021 article I covered getting started with FreeRTOS, which at the time was focused mostly on STM32 and similar ARM-based MCUs. Since then I have extensively expanded my use of FreeRTOS in the form of Espressif ESP32 development, both on the base ESP32 MCU and the ESP32-S3. This provided a range of interesting perspectives, also since I was porting significant amounts of cross-platform C and C++ code to these MCUs.

An important aspect of FreeRTOS is that it is commonly included in MCU SDKs, as is the case with Espressif’s ESP-IDF. It supports three different versions of FreeRTOS: the single-core ‘vanilla’ FreeRTOS, the Espressif (SMP) version and Amazon’s SMP FreeRTOS. Espressif’s version is optimized for the dual-core design of the ESP32 and ESP32-S3 and the default choice. What this demonstrates clearly is that the strength of FreeRTOS lies in its flexibility. You can slot in any custom scheduler, heap allocation algorithm, and pile on additions that are optimized for the target platform.

ESP-IDF provides partial POSIX compatibility, which uses FreeRTOS primitives internally. In order to port projects based on the cross-platform PoCo libraries, I added FreeRTOS support to these in the compatible NPoCo project. With this approach I can use virtually all of the features provided by the PoCo libraries also with (ESP-IDF) FreeRTOS, while allowing for the exact same code to compile on desktop platforms. The only platform-specific elements (e.g. start-up and peripheral use) are handled by compile-time preprocessor inclusions.

Drawing Conclusions

Although there are many ways to go about developing a project and advocating a particular approach is the best way to end up forever shunned by friends & colleagues, looking at a different approach can be enlightening. Over my own career I have gravitated strongly towards simplicity and reducing potential pain points. A big part of this is finding the optimal ways to do as little work as possible, which is where my own approach to MCU-based RTOSes comes from. I really don’t want to write more code than absolutely necessary, also because new code has new bugs.

As software is incredibly flexible, the real value in an (RT)OS lies in the scheduler, heap allocator and similar elements which provide the primitives on which other features can be built. While many RTOSes seem to go out of their way to (incompatibly) replicate the scope of the entire Linux kernel space & userspace in miniature, this to me at least seems restrictive. What I personally appreciate in FreeRTOS is that you can have as much or as little FreeRTOS in your code as you want, making it extremely hackable.

For others their priorities may be completely different, in which case any of the other RTOSes may work better, which is also perfectly fine. As long as the project is completed on time, within budget and no keyboards were thrown through the room, there are no wrong choices.

 

This articles is written by : Nermeen Nabil Khear Abdelmalak

All rights reserved to : USAGOLDMIES . www.usagoldmines.com

You can Enjoy surfing our website categories and read more content in many fields you may like .

Why USAGoldMines ?

USAGoldMines is a comprehensive website offering the latest in financial, crypto, and technical news. With specialized sections for each category, it provides readers with up-to-date market insights, investment trends, and technological advancements, making it a valuable resource for investors and enthusiasts in the fast-paced financial world.

Recent:

Measuring the Mighty Roar of SpaceX’s Starship Rocket Tom Nardi | usagoldmines.com
Simple Hydrogen Generator Makes Bubbles and Looks Cool Lewin Day | usagoldmines.com
Simple Stack of Ferrites Shows How Fluxgate Magnetometers Work Dan Maloney | usagoldmines.com
Stepping On LEGO For Science Kristina Panos | usagoldmines.com
A Tube Stereo Amplifier, From Scratch Jenny List | usagoldmines.com
A Cyberpunk Pocketwatch Navarre Bartz | usagoldmines.com
If Life Gives You Lemons, Build this Lemontron Heidi Ulrich | usagoldmines.com
FLOSS Weekly Episode 810: Pi4J – Stable and Boring on the Raspberry Pi Jonathan Bennett | usagoldmin...
With Core ONE, Prusa’s Open Source Hardware Dream Quietly Dies Tom Nardi | usagoldmines.com
FreeCAD Version 1.0 Released Maya Posch | usagoldmines.com
Boss Byproducts: Calthemites Are Man-Made Cave Dwellers Kristina Panos | usagoldmines.com
An Animated Walkthrough of How Large Language Models Work Donald Papp | usagoldmines.com
Junk Box Build Helps Hams with SDR Dan Maloney | usagoldmines.com
Most Extreme Hypergravity Facility Starts Up in China With 1,900 Times Earth’s Gravity Maya Posch | ...
Alleged Corrupt Los Angeles Police Officers Implicated in Crypto ‘Godfather’ Extortion Scheme Daily ...
Batteries Not Included: Navigating the Implants of Tomorrow Heidi Ulrich | usagoldmines.com
Dial-up Internet Using the Viking DLE-200B Telephone Line Simulator Maya Posch | usagoldmines.com
Raspberry Pi Compute Module 5 Seen in the Wild Elliot Williams | usagoldmines.com
Supercon 2024 SAO Petal KiCad Redrawing Project Chris Lott | usagoldmines.com
The Vecdec Cyberdeck is More than a Pretty Case Tom Nardi | usagoldmines.com
Supercon 2024 SAO Petal KiCad Redrawing Project Chris Lott | usagoldmines.com
The Great Redbox Cleanup: One Company is Hauling Away America’s Last DVD Kiosks Lewin Day | usagoldm...
Power Supply With Benchtop Features Fits In Your Pocket Donald Papp | usagoldmines.com
The Barcode Beast Likes Your CDs Jenny List | usagoldmines.com
Tearing Down A SLA Printer With The Engineers Who Built It Danie Conradie | usagoldmines.com
Hacking Haptics: The 19-Sensor Patch Bringing Touch to Life Heidi Ulrich | usagoldmines.com
A Very Fast Camera Slider For The Glam Shot Danie Conradie | usagoldmines.com
Crowdsourcing Ionosphere Data with Phones Al Williams | usagoldmines.com
Gloriously Impractical: Overclocking the Raspberry Pi 5 to 3.6 GHz Maya Posch | usagoldmines.com
Do You Dream in Color? Al Williams | usagoldmines.com
Exploring the Gakken FX Micro-Computer Alexander Rowsell | usagoldmines.com
Keebin’ with Kristina: the One With the Typo Kristina Panos | usagoldmines.com
The Laser Shadow Knows Al Williams | usagoldmines.com
Ruined 1993 ThinkPad Tablet Brought Back From The Brink Lewin Day | usagoldmines.com
Analog Shift Register Revealed Al Williams | usagoldmines.com
Completing the UE1’s Paper Tape Reader and First Squiggles Maya Posch | usagoldmines.com
Hackaday Links: November 17, 2024 Dan Maloney | usagoldmines.com
US’s UFO-Hunting Aerial Surveillance System Detailed In Report Maya Posch | usagoldmines.com
Schooling ChatGPT on Antenna Theory Misconceptions Dan Maloney | usagoldmines.com
ESP32 hosts a USB keyboard in this Typewriter Adam Fabio | usagoldmines.com
A Handheld Gaming PC With Steam Deck Vibes Bryan Cockfield | usagoldmines.com
Classic LED Bubble Displays Ride Again Dan Maloney | usagoldmines.com
Register Renaming: The Art of Parallel Processing Heidi Ulrich | usagoldmines.com
Open Source Universal ROM Programmer Grows Up Al Williams | usagoldmines.com
Nearly One-Third of All Customers at US Banks Have Experienced Fraud in Last 12 Months: Study Alex R...
Ethernet From First Principles Bryan Cockfield | usagoldmines.com
World’s First Virtual Meeting: 5,100 Engineers Phoned In Heidi Ulrich | usagoldmines.com
$500,000 Drained From American Bank Accounts As Insider Allegedly Steals Customers’ Sensitive Inform...
Playing Chess Against LLMs and the Mystery of Instruct Models Maya Posch | usagoldmines.com
Hackers, Patents, and 3D Printing Elliot Williams | usagoldmines.com
Spotted at Supercon: Glowtape Wearable Display Tom Nardi | usagoldmines.com
WiFi Status Indicator Keeps Eye on the Network Tom Nardi | usagoldmines.com
It’s a Soldering Iron! It’s A Multimeter! Relax! It’s Both! Al Williams | usagoldmines.com
BASIC Co-Inventor Thomas Kurtz Has Passed Away Jenny List | usagoldmines.com
Six US Banks Issue Urgent Debit Card Alerts, Forcing Mandatory Replacements for Many, After Third-Pa...
RISC-V Pushes 400 Million Forth Words Per Second Al Williams | usagoldmines.com
Bypassing Airpods Hearing Aid Georestriction With a Faraday Cage Maya Posch | usagoldmines.com
I Want To Believe: How To Make Technology Value Judgements Jenny List | usagoldmines.com
Hackaday Podcast Episode 296: Supercon Wrapup with Tom and Al, The 3DP Brick Layering Controversy, a...
This Week in Security: Hardware Attacks, IoT Security, and More Jonathan Bennett | usagoldmines.com
Homebrew pH Meter Uses Antimony Electrode Dan Maloney | usagoldmines.com
Desert Island Acetylene from Seashells and Driftwood Dan Maloney | usagoldmines.com
Retro Calculator Build Proves the Space Age Isn’t What It Used to Be Dan Maloney | usagoldmines.com
Nebraskan Farmers Were Using Wind Turbines Before Environmentalism Was Invented Jenny List | usagold...
Repairing The Questionable £25,000 Tom Evans Audiophile Pre-Amp Maya Posch | usagoldmines.com
Bluetooth Dongle Gives Up Its Secrets with Quick Snooping Hack Dan Maloney | usagoldmines.com
US DOE Sets New Nuclear Energy Targets Navarre Bartz | usagoldmines.com
Microfluidic Motors Could Work Really Well For Tiny Scale Tasks Lewin Day | usagoldmines.com
Retrotechtacular: The TV Bombs of WWII Dan Maloney | usagoldmines.com
The Life Cycle of Nuclear Fission Fuel: From Stars to Burn-Up Maya Posch | usagoldmines.com
Smart Thermostats Pitched for Texas Homes to Relieve Stressed Grid Maya Posch | usagoldmines.com
Building a Reproduction Apple I Al Williams | usagoldmines.com
Laser Sound Visualizations Are Not Hard To Make Lewin Day | usagoldmines.com
AI Face Anonymizer Masks Human Identity in Images Donald Papp | usagoldmines.com
Man Set Up and Extorted of $500,000 Worth of USDT by Criminals in Hotel Room: Report Daily Hodl Staf...
Open Cardiography Signal Measuring Device Navarre Bartz | usagoldmines.com
Landscape Motif Makes This E-Ink Weather Display Easy to Understand Dan Maloney | usagoldmines.com
FLOSS Weekly Episode 809: Pi4J – Stable and Boring on the Raspberry Pi Jonathan Bennett | usagoldmin...
A Vintage Radiator Core, From Scratch Jenny List | usagoldmines.com
A Teletype by Any Other Name: The Early E-mail and Wordprocessor Al Williams | usagoldmines.com
NASA Announces New Trials for In-Space Laser Welding Maya Posch | usagoldmines.com
Intuition about Maxwell’s Equations Al Williams | usagoldmines.com
Remember the Tri-Format Floppy Disk? Lewin Day | usagoldmines.com
The End of Ondsel and Reflecting on the Commercial Prospects for FreeCAD Maya Posch | usagoldmines.c...
WAV2VGM Plays Audio Via OPL3 Synthesis Lewin Day | usagoldmines.com
Founder of Security Firm SlowMist Warns Against Copy-and-Pasting Sensitive Crypto Information Daily ...
Teaching Computers to Read — Sort Of Al Williams | usagoldmines.com
A Brief History of Cyrix, or How to Get Sued By Intel a Lot Maya Posch | usagoldmines.com
Retrotechtacular: Color TV Al Williams | usagoldmines.com
You Wouldn’t Download a Chair…But You Could Lewin Day | usagoldmines.com
Ubiquitous Successful Bus: Version 3 Arya Voronova | usagoldmines.com
Minuteman ICBM Launch Tests Triple Warheads Maya Posch | usagoldmines.com
Z80 Testing the 80s Way Al Williams | usagoldmines.com
A Handheld Replica Sound Voltex Game Lewin Day | usagoldmines.com
Britain’s Oldest Satellite on the Move: a Space Curiosity Heidi Ulrich | usagoldmines.com
Automated Weed Spraying Drone Needs No Human Intervention Danie Conradie | usagoldmines.com
Thermoelectric Blaster Flings Ice Projectiles Lewin Day | usagoldmines.com
Making a Unique Type Of Wind Gauge For Home Assistant Use Lewin Day | usagoldmines.com
Retrogadgets: Oscilloscope Cameras Al Williams | usagoldmines.com
Videonics: The Dawn of Home Video Editing, Revisited Heidi Ulrich | usagoldmines.com

Leave a Reply