Bare Metal, RTOS or Embedded Linux: Choosing a Software Foundation

An embedded product can run a single loop with no operating system, a real-time operating system that schedules tasks, or a full Linux system. The three differ by orders of magnitude in the memory they need, the features they bring and the effort to maintain them. The choice shapes the processor, the bill of materials and the development schedule, so it should be made from requirements rather than from familiarity.

At a glance

Bare metal
One program, no operating system. Smallest, fastest to start, simplest to reason about.
RTOS
Tasks with priorities and deterministic timing, on a microcontroller.
Linux
A full operating system with networking, filesystems and a large software ecosystem.
MMU
Linux requires a processor with a memory management unit; most microcontrollers have none.

The problem

A product that starts as a simple loop tends to grow: a second sensor, a network stack, a display. Without a scheduler, the loop becomes a tangle of state machines and timing dependencies that is hard to change safely.

The opposite mistake is as costly. Choosing Linux for a job a microcontroller could do adds a larger processor, external memory, a longer boot time and a continuing obligation to apply security updates.

Choose the smallest foundation that meets the requirements, then leave room for the features you already know are coming.

How to decide

Stay on bare metal when the device does one or two things with simple timing. Move to an RTOS when several activities must run concurrently with different deadlines, or when a network or wireless stack is involved.

Choose Linux when the product needs a rich user interface, substantial networking, large storage or third-party software that assumes an operating system. Hard real-time work can then be given to a companion microcontroller.

What good looks like

List the functions the product must perform concurrently and the tightest timing requirement among them.

Check which requirements need operating-system services: networking, filesystems, graphics, or software that only runs on Linux.

Choose the foundation, then the processor to match, and confirm boot time and power consumption against the product requirements.

Three foundations compared
Bare metalRTOSEmbedded Linux
ProcessorAny microcontrollerMicrocontrollerApplication processor with MMU
Memory footprintKilobytesTens of kilobytes upwardTens of megabytes upward
Start-up timeMillisecondsMillisecondsSeconds
TimingDeterministic if simpleDeterministicNot hard real-time by default
EcosystemVendor librariesMiddleware and stacksVery large
Typical orders of magnitude. Actual figures depend on the processor and the application.

A decision path

  1. One simple job: Bare metal
  2. Concurrent tasks: RTOS
  3. Network stack: RTOS or Linux
  4. Rich UI or storage: Linux
  5. Hard real time too: Linux plus a microcontroller
Stop at the first step that describes your product.

What it changes

Right-Sized Hardware

The processor and memory match the software, with no excess on every unit built.

Predictable Timing

Real-time requirements are met by design rather than by tuning.

Maintainability

The structure can absorb new features without a rewrite.

Security Posture

The update obligation is understood and planned for from the outset.

Where to go next

Whatever the foundation, plan for firmware updates in the field. It affects memory layout from the first build.

If you choose Linux, decide early how the system image will be built and maintained, for example with Yocto or Buildroot.

Problems this prevents

  • A super-loop that can no longer be changed safely
  • Linux chosen for a job a microcontroller could do
  • Missed deadlines discovered during integration
  • No plan for security updates in the field

Discuss your project

Email support@aavico.com or use Get in Touch when the website finishes loading.