Why are more embedded systems moving from bare-metal to RTOS/OS (Linux, FreeRTOS)

Hi everyone,

I’ve observed a growing trend in modern embedded systems development: many applications are increasingly built using an RTOS (e.g., FreeRTOS) or even a full-fledged OS like Linux, rather than relying on traditional bare-metal programming—even in cases where bare-metal could technically meet the requirements.

Is this shift primarily driven by long-term maintenance benefits? Or are there other key factors?

The use of a simple OS allows partitioning the program into seperate operations, that make the design more scalable. The “Bare-metal” design method helps to optimize resource usage at the cost of needing to think of the full system as a monlith. Since processor resources are growing, the need to be ultra-efficient in your resource usage is less important, and a much more important aspect becomes the cost to create the program.

Thus, except in the cases of very mass markets with very cost sensitive markets, (which shifts the design to wanting bare minimal hardware, and can pay more for software development to do that, since the software cost gets divided over more units) it is cost effective to use a more structured designed.

2 Likes

My take on Linux vs FreeRTOS is it’s more about available drivers and the ability to use gpl code without license issues. However, there are tradeoffs, if you’ve ever used yocto you’ll understand. IMO you move it from an individual developer level to a team.

Software is a living entity, even the embedded software.

There often comes a point where bare-metal software can no longer keep up with the growing complexity of an application. It doesn’t scale at the same rate, and over time, the project can devolve into an unmanageable mess.

In the early days, microcontrollers were heavily constrained in terms of resources—limited FLASH, RAM, clock speeds, and so on. But that’s no longer the case. Today, for just a couple of dollars, you can get a microcontroller with 512 KB of FLASH and 32 KB of RAM, running at 64 MHz or more. Pretty amazing, right? And if you spend a little more, you can get a powerhouse of a microcontroller.

Back then, these limitations made it difficult to integrate an operating system—it simply wouldn’t fit in memory. But with modern MCUs offering plenty of headroom, we as developers can focus more on application design rather than obsessing over every byte or CPU cycle. Twenty years ago, that kind of optimization was the norm. I remember it well: you’d write a procedure in assembly and then count the bytes and cycles it used. Just look at the old COP8 datasheets for a reminder!

Today, operating systems with small footprints—like FreeRTOS—can easily fit on most modern microcontrollers without consuming excessive resources. Linux and RTLinux, on the other hand, are suited for a different class of embedded systems. Linux is a full-featured OS and is overkill unless your application truly requires its capabilities.

Why using a RTOS is a good idea?

An RTOS like FreeRTOS provides a structured framework for your application: tasks, inter-task communication, synchronization mechanisms, and more. This structure allows applications to scale more easily than traditional bare-metal designs. Of course, using any framework requires careful planning before writing code—but that’s actually a benefit, not a drawback.

Even better, combining FreeRTOS with C++ unlocks additional advantages. While most RTOSes are written in C and typically used that way, C++ brings higher-level abstractions such as templates and interfaces, which can make your code more expressive, modular, and maintainable.

In short RTOSs, and in particularly FreeRTOS, promote better structure, scalability, and maintainability for new projects where long-term growth, reliability, and clarity are essential even when one thinks only in the first version of the application (and that it will be the only :roll_eyes:).