Quick answer
Choose bare-metal for the simplest, most deterministic and lowest-power devices; an RTOS such as FreeRTOS or Zephyr when you need concurrency with real-time guarantees on a microcontroller; and embedded Linux when you need rich networking, filesystems, UI or complex software on a more capable processor.
Bare-metal firmware
A single loop and interrupts, with no operating system. It is smallest, simplest and easiest to reason about for timing, and suits single-purpose sensors and tiny low-power devices. It becomes hard to manage as features and concurrency grow.
RTOS (FreeRTOS, Zephyr)
A real-time operating system adds tasks, scheduling, queues and timers while keeping deterministic response on a microcontroller. It suits devices that juggle sensors, communication and control with hard timing requirements. Zephyr adds a broad hardware and connectivity ecosystem; FreeRTOS is lightweight and widely used.
Embedded Linux (Yocto, Raspberry Pi class boards)
Linux brings a full networking stack, filesystems, security tooling, containers and a huge software ecosystem. It needs a more capable processor and more memory and power, and it is not hard real-time by default. It suits gateways, cameras, HMIs and edge AI devices.
How to decide
- Timing: hard real-time control favours bare-metal or an RTOS.
- Resources and power: battery-powered, low-cost devices favour microcontrollers.
- Connectivity and software richness: TLS, OTA, web UIs, AI inference and containers favour Linux.
- Team and lifetime: consider available skills, security patching and the product's support horizon.
- Hybrid designs are common: a microcontroller handles real-time control while a Linux gateway handles connectivity and analytics.
Process matters as much as platform
Whatever you choose, plan board bring-up, hardware-in-the-loop testing, OTA updates and long-term maintenance early. These decide whether a device stays reliable in the field.
Frequently asked questions
When should I use an RTOS instead of bare-metal?
Use an RTOS when the firmware must handle several concurrent activities with deterministic timing, which becomes unwieldy in a single bare-metal loop.
Is Linux real-time?
Standard embedded Linux is not hard real-time. Real-time variants exist, but hard real-time control is usually handled by a microcontroller running an RTOS or bare-metal firmware.
Which is better, FreeRTOS or Zephyr?
FreeRTOS is lightweight and widely adopted. Zephyr offers broader hardware support and built-in connectivity stacks. The better choice depends on the target hardware and required features.