FreeRTOS and Zephyr Firmware Engineering for Product Teams
For embedded teams whose firmware has outgrown a super loop or whose RTOS design has become unstable, EmbedCrest designs and builds FreeRTOS and Zephyr RTOS firmware with deterministic task models, robust drivers, power management and secure updates, so the product meets its deadlines and stays maintainable as features are added.
Who this is for
- Engineering Manager or Embedded Lead
- CTO or VP Engineering at an OEM
- MedTech Product or R&D Lead
- Product Founder or Hardware Startup
Outcomes we work towards
- Timing that meets real time deadlines under load
- Fewer intermittent crashes, stack overflows and deadlocks
- Clear structure new engineers can extend safely
- An RTOS choice that fits the hardware and team
Bare metal, FreeRTOS or Zephyr: and why RTOS firmware fails in the field
Firmware usually starts as a bare metal loop and adds features until timing becomes unpredictable. Moving to an RTOS helps only if tasks, priorities, interrupts and shared data are designed deliberately. Common failures include priority inversion, unbounded interrupt handlers, stack overflows, blocking calls in the wrong context and watchdogs that hide faults instead of exposing them. Picking between FreeRTOS and Zephyr also affects drivers, build system, licensing and long term maintenance.
What We Design, Build and Hand Over
- Bare metal versus RTOS decision with timing and memory analysis
- Task, priority, interrupt and inter task communication design
- FreeRTOS kernel configuration, ports and middleware integration
- Zephyr board definitions, device tree, Kconfig and driver development
- Power management, tickless idle and wake source design
- Fault handling, watchdog strategy, crash logging and stack monitoring
- Bootloader integration, including MCUboot with Zephyr, and OTA updates
- Trace based timing analysis, unit tests and hardware in the loop tests
Bare metal vs FreeRTOS vs Zephyr
| Factor | Bare metal | FreeRTOS | Zephyr |
|---|---|---|---|
| Scope | Super loop plus interrupts | Small kernel; add libraries as needed | Full RTOS with drivers, networking and BLE |
| Footprint | Smallest | Very small | Larger, configurable via Kconfig |
| Hardware model | Hand written drivers | Vendor SDK drivers | Device tree and Zephyr driver model |
| Licence | Your own code | MIT | Apache 2.0 |
| Best fit | Simple, single purpose devices | Vendor SDK based products, tight memory | Connected products, multi board families |
Where Teams Use This
Stabilising an unstable RTOS product
Trace based analysis of an existing FreeRTOS product that resets or hangs in the field, followed by fixes to priorities, shared resource locking, stack sizes and watchdog handling.
Zephyr for a BLE wearable
Zephyr based firmware on a Nordic or similar BLE SoC with sensor drivers, power management, Bluetooth LE services and MCUboot updates, structured for a regulated product's documentation needs.
Migrating a super loop to an RTOS
Refactoring legacy bare metal firmware into tasks with defined priorities and message queues, preserving existing behaviour, verified by regression tests, while making room for new communication protocols and features.
One code base across several boards
Using Zephyr device tree and Kconfig to support multiple hardware variants from one repository, reducing duplicated drivers, divergent product branches and the effort of adding the next hardware variant.
How the Work Runs
Timing and resource analysis
List events, deadlines, interrupt rates, memory and power constraints to decide between bare metal, FreeRTOS and Zephyr.
Concurrency design
Define tasks, priorities, queues, mutexes and interrupt deferral, and document why each priority is set the way it is.
Implementation
Develop drivers, middleware and application tasks with coding standards, static analysis and unit tests running in continuous integration.
Timing verification
Measure worst case response, CPU load and stack usage with trace tools on target hardware under realistic load.
Release and support
Deliver signed releases, update procedures and documentation, and support field issue analysis using crash logs.
What You Receive
- RTOS selection note with timing and memory budget
- Concurrency and task design document
- Firmware source with CI build and tests
- Zephyr board files or FreeRTOS port configuration
- Timing, CPU load and stack usage report
- Fault handling and crash logging design
- Release notes and update procedure
Related Case Studies
Medical Grade Wearable for Continuous Cardiac Monitoring
ECG and SpO2 wearable on nRF5340 with Zephyr RTOS, on device arrhythmia classification and BLE 5.3, with firmware built in the client's IEC 62304 process.
Firmware Modernization for Legacy Industrial Control Systems
Legacy PIC assembly PLC firmware migrated to STM32F4 and FreeRTOS across product variants, adding Ethernet, TLS 1.3, secure boot and HIL equivalence testing.
Smart Manufacturing IoT Platform for an Auto Parts Maker
STM32H7 edge nodes with TinyML connect legacy CNC machines over OPC UA and Modbus RTU to AWS IoT Greengrass dashboards for an auto parts maker.
Have a similar challenge?
Share a short brief; an engineer replies within one business day. How engagements work
Prefer a fixed scope start? Firmware Health and Security Audit
Related Pages
- Firmware Engineering
- FreeRTOS vs Zephyr RTOS: Which RTOS Should You Choose for Your Firmware?
- Real Time Operating Systems Explained: Scheduling, Priorities, and Deadlines
- Embedded Linux vs RTOS: When to Use Each Operating System
- Glossary: RTOS
- Glossary: Bare Metal Firmware
- Bare Metal vs RTOS Firmware: What Is the Difference?
Questions About FreeRTOS and Zephyr
What is the difference between bare metal firmware and RTOS based firmware?
Bare metal firmware runs a single main loop with interrupt handlers and no scheduler, which is simple and small but hard to keep responsive as features grow. RTOS based firmware splits work into prioritised tasks managed by a real time operating system (RTOS) scheduler, with queues and semaphores for communication. An RTOS adds some overhead but makes timing and structure easier to manage.
When should a product use FreeRTOS or Zephyr?
Use FreeRTOS when you rely on a silicon vendor SDK, memory is tight and you mainly need a scheduler with a few libraries. Use Zephyr when you want a full platform with portable drivers, networking, Bluetooth LE, device tree and a built in update path, especially across several boards. Team experience and vendor support for your chip matter as much as features.
Is Zephyr ready for commercial products?
Yes, Zephyr is used in commercial products and is backed by the Linux Foundation and several silicon vendors, with long term support releases for products that need a stable base. The trade off is a steeper learning curve than FreeRTOS: device tree, Kconfig and the west tool take time to learn, which we account for in planning.
Why does our RTOS firmware reset or freeze randomly?
Random resets and freezes usually come from stack overflow, heap fragmentation, priority inversion, deadlocks, blocking calls inside interrupts or an aggressive watchdog. We diagnose them by enabling stack and heap checks, capturing fault registers and crash logs, and recording scheduler traces on target hardware, then fixing the root cause rather than lengthening timeouts.
Can you port our firmware from FreeRTOS to Zephyr?
Yes. A port starts with an audit of how deeply the code depends on FreeRTOS APIs and vendor drivers. Application logic is usually moved behind a thin operating system abstraction, drivers are reworked to the Zephyr driver model and device tree, and behaviour is verified with the same tests before and after the move.
Ready to Scope FreeRTOS and Zephyr?
Share your product or plant context. An engineer reviews it and replies with questions, a proposed approach and next steps.
Discuss Your RTOS Firmware