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.

Technically reviewed by the EmbedCrest engineering teamUpdated

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.

Scope

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
Comparison

Bare metal vs FreeRTOS vs Zephyr

Bare metal vs FreeRTOS vs Zephyr
FactorBare metalFreeRTOSZephyr
ScopeSuper loop plus interruptsSmall kernel; add libraries as neededFull RTOS with drivers, networking and BLE
FootprintSmallestVery smallLarger, configurable via Kconfig
Hardware modelHand written driversVendor SDK driversDevice tree and Zephyr driver model
LicenceYour own codeMITApache 2.0
Best fitSimple, single purpose devicesVendor SDK based products, tight memoryConnected products, multi board families
Use Cases

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.

Process

How the Work Runs

  1. Timing and resource analysis

    List events, deadlines, interrupt rates, memory and power constraints to decide between bare metal, FreeRTOS and Zephyr.

  2. Concurrency design

    Define tasks, priorities, queues, mutexes and interrupt deferral, and document why each priority is set the way it is.

  3. Implementation

    Develop drivers, middleware and application tasks with coding standards, static analysis and unit tests running in continuous integration.

  4. Timing verification

    Measure worst case response, CPU load and stack usage with trace tools on target hardware under realistic load.

  5. Release and support

    Deliver signed releases, update procedures and documentation, and support field issue analysis using crash logs.

Deliverables

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

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

Discuss Your RTOS Firmware
FAQ

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
Discuss Your RTOS Firmware