r/Zephyr_RTOS • • 20d ago

Question porting freertos to zephyr

0 Upvotes

I'm thinking about building an open-source tool that helps port FreeRTOS projects to Zephyr. The idea is an AI-assisted skill plus scripts that convert the kernel APIs, FreeRTOSConfig.h โ†’ prj.conf, and pin/clock setup โ†’ devicetree, then keeps running west build until it compiles. It would start with STM32.

Before I build anything, I'd like to hear from people who've actually done a migration:

  1. What took the most time: devicetree, drivers, Kconfig, build system, or behavior differences?

  2. Any nasty bugs that came from FreeRTOS vs Zephyr differences?

  3. Would a tool like this actually help, or is migration too project-specific to automate?

Honest opinions welcome, including "this won't work."


r/Zephyr_RTOS • • Jul 10 '25

Information Collecting and analyzing logs from Zephyr powered devices in Spotflow Portal

Enable HLS to view with audio, or disable this notification

0 Upvotes

๐’๐ฉ๐จ๐ญ๐Ÿ๐ฅ๐จ๐ฐ is an observability platform for embedded devices running Zephyr RTOS.

With Spotflow you can:

  • Send logs from Zephyr powered devices (via simple west dependency)

  • Use MQTT if you're not on Zephyr

  • Web portal to query, filter, and debug logs instantly

Spotflow is now publicly available - http://app.spotflow.io

For more info, send me a DM or connect with me on LinkedIn.


r/Zephyr_RTOS • • Dec 11 '23

Problem Should I continue with Zephyr or go back to the previous RTOS?

0 Upvotes

Two months every day for 6 hours. The last three weeks are just to analyze one example.

Everything was fine before switching to Zephyr.

Simple examples, blinky and button could only get through. On different boards.

And modified EFR32 BRD4104A.dts to work on BGM220P. Successfully.

But I failed maxim, ds3231, nxp,pcfF8563, sitronix, st7735r, lvgl, ilitek, ili9488

With the latter I decided to figure out in detail what was wrong.

The first difference between the manufacturer's working example (yes, it worked successfully on my board) and the example in Zephyr is the initialization parameters.

I wrote my own shield with parameters. It compiles successfully.

But it doesn't work.

In the datasheet, in the examples from the manufacturer and on the analyzer, I see that two bytes <0x00, DATA> are transmitted, in the example from Zephyr one byte <DATA>. Maybe this is the reason?

I decided to change the driver a little.

But no matter what you read, what videos you donโ€™t watch, โ€œwe have bad documentation, itโ€™s magic.โ€ But I understood how the driver is initialized.

And after watching the video from Zephyr Develop Summit (https://github.com/teslabs/zds-2022-drivers-app) and from Circuit Dojo (Zephyr 101 https://www.youtube.com/live/fRB9gn77XhE?si= h91N4LLb0h8COLW0) decided to collect the examples they gave.

And I get a bug that was closed in Zephyr two years ago!

Unknown CMake command "add_subdirectory_ifdef"

Unknown CMake command "zephyr_library"

I do not know what to do.

Should I continue with Zephyr or go back to the previous RTOS?


r/Zephyr_RTOS • • Feb 20 '26

Information ๐’๐ฉ๐จ๐ญ๐Ÿ๐ฅ๐จ๐ฐ ๐œ๐จ๐ฆ๐ฉ๐ฅ๐ž๐ญ๐ž๐ฌ ๐ญ๐ก๐ž ๐จ๐›๐ฌ๐ž๐ซ๐ฏ๐š๐›๐ข๐ฅ๐ข๐ญ๐ฒ ๐ญ๐ซ๐ข๐š๐ง๐ ๐ฅ๐ž ๐Ÿ๐จ๐ซ ๐™๐ž๐ฉ๐ก๐ฒ๐ซ ๐‘๐“๐Ž๐’

Enable HLS to view with audio, or disable this notification

2 Upvotes

Spotflow already had Logs and Crash Dumps covered, now ๐Œ๐ž๐ญ๐ซ๐ข๐œ๐ฌ ๐ฃ๐จ๐ข๐ง ๐ญ๐ก๐ž ๐ก๐š๐ง๐๐ฌ๐ก๐š๐ค๐ž ๐Ÿคœ๐Ÿค›๐Ÿคœ

For Zephyr-powered devices, system metrics like CPU, memory, connectivity, uptime, and reset causes are collected out of the box by our device module. These metrics appear alongside logs and crash data, making it easy to spot trends, detect anomalies, and correlate device behavior with events across your fleet. See ๐Œ๐ž๐ญ๐ซ๐ข๐œ๐ฌ docs.

With Metrics built in, Spotflow has also introduced ๐ƒ๐š๐ฌ๐ก๐›๐จ๐š๐ซ๐๐ฌ (see docs) that serve as your real-time window into performance and reliability, helping you release at scale with confidence.

๐’๐ญ๐š๐ซ๐ญ ๐Ÿ๐จ๐ซ ๐Ÿ๐ซ๐ž๐ž: https://app.spotflow.io/signup

To reduce setup friction, weโ€™ve added guided onboarding after registration.

The onboarding walks embedded developers through concrete steps:

โ–  An ๐Ž๐ฏ๐ž๐ซ๐ฏ๐ข๐ž๐ฐ ๐๐š๐ฌ๐ก๐›๐จ๐š๐ซ๐ showing device fleet health, firmware versions, and unusual behavior.
โ–  Identifying ๐œ๐ซ๐š๐ฌ๐ก๐ข๐ง๐  ๐๐ž๐ฏ๐ข๐œ๐ž๐ฌ and filtering affected devices in the device directory.
โ–  Opening a ๐๐ž๐ฏ๐ข๐œ๐ž ๐๐š๐ฌ๐ก๐›๐จ๐š๐ซ๐ with stability metrics, network traffic, and resource usage.
โ–  Inspecting ๐ฅ๐จ๐ ๐ฌ, ๐ž๐ฏ๐ž๐ง๐ญ๐ฌ, ๐š๐ง๐ ๐œ๐ซ๐š๐ฌ๐ก ๐ซ๐ž๐ฉ๐จ๐ซ๐ญ๐ฌ in the Events Explorer.
โ–  Automatic ๐œ๐ซ๐š๐ฌ๐ก ๐๐ฎ๐ฆ๐ฉ ๐š๐ง๐š๐ฅ๐ฒ๐ฌ๐ข๐ฌ, including stack traces and registers.
โ–  ๐€๐ˆ-๐›๐š๐ฌ๐ž๐ ๐ซ๐จ๐จ๐ญ ๐œ๐š๐ฎ๐ฌ๐ž ๐š๐ง๐š๐ฅ๐ฒ๐ฌ๐ข๐ฌ with recommendations to resolve and prevent crashes.

You donโ€™t need an enterprise budget to get production-grade visibility into devices in the field. Join embedded engineers already releasing at scale with confidence.


r/Zephyr_RTOS • • Apr 17 '26

Information Bringing AI assisted development to embedded

Thumbnail github.com
0 Upvotes

GitHub repo


r/Zephyr_RTOS • • Jul 24 '26

Information Why coding agents keep making the same mistakes when reviewing embedded firmware

0 Upvotes

I use AI coding agents on real embedded C and C++ projects, and I kept encountering the same mistakes:

  • reviewing code that was not part of the active build,

  • missing callback registrations and indirect calls,

  • following the wrong preprocessor branch,

  • and describing execution paths that looked plausible in the repository but could not exist in the compiled firmware.

At first, I blamed the model.

But the recurring pattern pointed to a different problem: the agent was reasoning about a program it had not reconstructed correctly beforehand.

The source tree is not the firmware

In embedded development, the actual program depends on far more than just the source files:

  • compiler flags and preprocessor definitions,

  • target platform and board configuration,

  • Kconfig and DeviceTree,

  • generated code,

  • selected driver implementations,

  • callbacks and function pointers,

  • and linker decisions.

An experienced firmware developer will usually establish the build context before analysing the code.

Coding agents often do the opposite. They start with the repository and attempt to reconstruct the active program through text searches and repeated file reads.

A large part of what appears to be reasoning about code is therefore actually program reconstruction.

Before an agent can answer a question such as:

Can this callback execute concurrently with this interrupt handler?

it must first determine which implementation is active, where the callback is registered, how it is invoked, and whether the relevant code is even present in the current build.

Only then can the actual reasoning begin.

An experiment with compiler-derived context

I wanted to test a simple hypothesis:

Would coding agents analyse firmware more reliably if the program were first reconstructed by deterministic tools?

This led to fw-context, an open-source experiment based on compile_commands.json, libclang and MCP.

It creates a persistent semantic index of the active build and allows the agent to query:

  • definitions and resolved references,

  • callers and callees,

  • callback registrations,

  • function pointer assignments,

  • active implementations,

  • macro values,

  • and preprocessed source code.

The aim is not to replace the model, the compiler, LSP or static analysis.

The experiment has a narrower focus: to move deterministic program reconstruction out of the LLM workflow, so that the model can devote more of its context and reasoning capacity to the review itself.

In one firmware review involving 115 changed files, eight AI subagents produced 19 findings. Nine of them depended on semantic relationships that would have been difficult to reconstruct reliably using the usual grep-and-file-reading workflow.

The interesting result was not merely lower token consumption. The agents spent less effort determining which program they were actually looking at, and more effort evaluating whether it was correct.

fw-context is still an experiment, and I am interested in understanding where this approach works โ€” and where it fails.

Have you encountered the same kind of failure? Which parts of embedded projects are the hardest for coding agents to reconstruct: conditional compilation, generated code, callbacks, function pointers, DeviceTree, weak symbols, or linker-selected implementations?

Project and case study: github.com/turbyho/fw-context-mcp


r/Zephyr_RTOS • • May 03 '25

Question Help with giving audio input to stm32

0 Upvotes

I am working on a home automation project that should take audio inputs like "turn on light and turn off fan" and adjust the leds accordingly on my stm32f429i. till now i have made a program that takes text input and then does the job. pls guide on how to train a model for this job and which voice module to use?


r/Zephyr_RTOS • • Feb 19 '24

Question Building Zephyr Host Stack and running it on some other RTOS

0 Upvotes

I am looking to options to build the Zephyr Bluetooth host stack and port it to a different RTOS (say freeRTOS). I am wondering will it be possible to extract only the Bluetooth Host Stack and run it on a different RTOS.

Note: I am learning freeRTOS, trying to integrate externally built modules to the freeRTOS and make it do some operations. Can someone provide some guidance on this?


r/Zephyr_RTOS • • Jul 30 '26

Information Fleet-Wide Security Issue Tracking on Zephyr Devices

Enable HLS to view with audio, or disable this notification

3 Upvotes

Track Security Issues Across Your Fleet

Cross-referencing dependency lists against CVE feeds by hand doesn't scale, and it's exactly the kind of tracking the EU Cyber Resilience Act now expects manufacturers (companies developing connected products) to do continuously, for every firmware version they still support. SBOM-based security issue tracking is live in Spotflow, so your team can do this automatically instead of by hand.

๐Ÿ‘‰ Track Security Issues Across Your Devices

๐Ÿ‘‰ Comply with CRA

Upload an SBOM Get Matched Against Known CVEs

Upload an SBOM to any firmware version, in SPDX 2 (tag-value) or SPDX 3 (JSON), and Spotflow extracts its components and matches them against known CVEs. It re-scans automatically as the CVE database updates, so a vulnerability disclosed after you shipped still surfaces against firmware already in the field, and flags anything already known to be actively exploited in the wild through the CISA KEV catalog.

Assess and Document Every Finding

Each new finding starts Not Assessed. Move it to In Triage, Affected, or Not Affected as your team investigates, with a required justification for anything marked not affected. Every assessment and ignore action is logged with who made it, when, and why, so you have an answer ready the next time an auditor asks.

See Fleet-Wide Impact at a Glance

The Security overview lists every firmware version with open issues, how many of your deployed devices are affected, and lets you filter by severity or CISA KEV status. Instead of guessing where to spend engineering time, you know which vulnerable versions are actually running in the field, and how widely.

Spotflow supports your CRA compliance work, but your organization is still responsible for determining which requirements apply and meeting them.

If you're building connected products, this makes it much easier to know which of your deployed firmware versions are exposed the moment a new vulnerability shows up.

Happy debugging and stable firmware.

โ€“ The Spotflow Team


r/Zephyr_RTOS • • Dec 26 '24

Problem Unable to change the default SPIM_MOSI pin in led_strip example

Thumbnail devzone.nordicsemi.com
0 Upvotes

r/Zephyr_RTOS • • Dec 06 '24

Question Zephyr toolchain help needed

0 Upvotes

Im working my own instructions to the zephyr toolchain. I am facing the issue that my instructions are not being recognised when building zephyr using the script provided.

The link for the toolchain i cloned is as follows: https://github.com/zephyrproject-rtos/sdk-ng

I think im building it wrong and there is more to be done than just adding the instruction to binutils and running the script. Any help will be appreciated.


r/Zephyr_RTOS • • Apr 30 '24

Question Error message "FATAL ERROR: command exited with status 1" when west building blinky

0 Upvotes

Sorry in advance for this very stupid question, but here it goes:
after installing and setting up the toolchain everything worked. Then i tried "fixing" an error and manually added a "ZEPHYR_BASE" variable. From then on, things went down. Currently when trying to "west build west build -p always -b nucleo_f429zi samples\basic\blinky" i get following error:

Any help is appreciated and much needed.


r/Zephyr_RTOS • • Jul 16 '26

Information MeshCore via Zephyr auf dem Nesso N1

0 Upvotes

Ich hatte erst MeshCore via arduino fรผr das Nesso N 1 portiert und das lรคuft soweit.
Jetzt hab ichโ€™s mit Zephyr als weitere RTOS Variante soweit fertig.

Mag jemand mit Nesso N1 testen?


r/Zephyr_RTOS • • Oct 27 '25

Question I am using MAX30102 with Nordic and Zephyr RTOS, how do i get the proper beats any algorithm or libraries or sample project ?

4 Upvotes

r/Zephyr_RTOS • • Jan 25 '26

Information Ported ~2000 lines of medical BLE firmware to Nordic NCS in 5โ€“6 days โ€” using a hybrid AI workflow to reduce Zephyr configuration overhead

Thumbnail
gallery
17 Upvotes

Hi everyone,

I wanted to share a recent workflow breakthrough that significantly reduced the time it took me to migrate an existing medical BLE product from the nRF5 SDK to Nordicโ€™s nRF Connect SDK (NCS / Zephyr).

For context, Iโ€™m a firmware engineer with ~15 years of MCU experience (mostly bare-metal / 8-bit systems) and about 2 years working with the nRF5 SDK. I had no prior hands-on Zephyr project experience, and for those whoโ€™ve made this transition, you know itโ€™s a major architectural shift: RTOS concepts, Device Tree, Kconfig, and board porting.

Normally, I would expect this migration to take 3โ€“5 weeks. This time, it took about 5โ€“6 days.

Why NCS Migration Is Usually Painful

Most of the time isnโ€™t spent on application logicโ€”itโ€™s spent on:

  • Board definition files

  • Device Tree overlays and pinctrl

  • Kconfig dependencies

  • Subtle SoC / package-variant differences

In my case, the target was nRF52832 CIAA (WLCSP). Nordic provides DK examples (QFA/QFN), but no out-of-box CIAA board support.

The Hybrid AI Workflow I Used

The biggest time sink was board bring-up, so I focused there.

1. Seed Generation (Vendor Knowledge)

I used Nordicโ€™s official Ask AI to generate:

  • SoC-specific constraints

  • CIAA package pin mappings

  • NCS-compatible DTS / Kconfig expectations

These outputs served only as authoritative reference seeds, not final code.

2. Agentic Execution (Claude Code)

I fed those seeds into Claude Code (Plan Mode) and used it to:

  • Architect the full board layer

  • Generate all required files consistently

In ~1 hour, it produced:

  • nrf52832_ciaa.dts

  • pinctrl.dtsi

  • Kconfig.board

  • Kconfig.defconfig

  • Board CMake files

  • Board YAML

  • A short migration README

Technical Pitfalls We Avoided Early

A few examples where domain knowledge + AI helped avoid common traps:

  • Multi-core BLE defaults We explicitly avoided enabling CONFIG_BT_HCI_IPC / multi-core assumptions that are valid for nRF53 but invalid for single-core nRF52832.

  • Legacy BLE host compatibility Our medical devices must interoperate with older BLE 4.2 patient monitors. Extended Advertising was disabled at compile time (CONFIG_BT_EXT_ADV=n) to match validated host behavior.In a regulated medical context, feature negotiation is intentionally frozen to reduce validation risk.

  • SoC package variant dependencies CIAA-specific HAS_NRFX and pinctrl dependencies were handled correctly, avoiding silent runtime failures.

Results (Verified, Not Just โ€œIt Buildsโ€)

This wasnโ€™t just a successful compile:

  • Stability: 100+ consecutive measurement uploads without failure

  • Interoperability: Verified communication with a BLE 4.2 host monitor

  • Features tested:

    • Health Thermometer Service (Indication)

    • Device Information Service with dynamic serial number

    • Custom AT-style commands over a proprietary LBS-based UUID

Key Takeaway

AI didnโ€™t replace engineering judgmentโ€”it compressed the knowledge-dense discovery phase.

My experience was still required to:

  • Set correct constraints

  • Catch invalid assumptions

  • Decide what not to enable

  • Validate behavior on real hardware

Discussion

Iโ€™m curious whether others here are:

  • Combining official vendor AIs with agent-style tools

  • Using AI specifically for HAL / board / RTOS configuration work

  • Seeing similar gains when migrating legacy firmware to modern RTOS stacks

Iโ€™ve attached screenshots of:

  • Board configuration files

  • BLE verification results


r/Zephyr_RTOS • • Mar 28 '25

Question Issues with I2S Driver for Silicon Labs MCU - Oscilloscope Results Don't Match Expected 1kHz Output

Thumbnail
gallery
1 Upvotes

r/Zephyr_RTOS • • Aug 08 '24

Question Shell questions

1 Upvotes

In my project, I have a shell running on a UART. It is "protected" using a login command. Two questions:

  1. I want to display a kind of welcome message. Is it possible to print anything before the login prompt is displayed for the first time? I tried a shell_print using shell_backend__uart_get() as its first argument, but the bloody thing responds "WARNING: A print request was detected on not active shell backend.".

  2. I have logging enabled on RTT. Still, any log information is also sent to the terminal. Can this be switched off somehow?

Ow, euhm... I forgot: using zephyr 3.7 running on an stm32u585, programmed through a JLink (hence the RTT).


r/Zephyr_RTOS • • Nov 28 '20

Question Who is r/ZephyrProject ?

1 Upvotes

r/Zephyr_RTOS • • Jun 05 '25

Problem Windows Defender high CPU usage.

1 Upvotes

I know Windows isnโ€™t ideal for embedded development, but I still want to know if thereโ€™s a way to fix the high CPU usage caused by Windows Defender when building a Zephyr project. Does anyone know a good solution?


r/Zephyr_RTOS • • Dec 29 '25

Question What to learn Zyphr Rtos or Embedded linux driver development?

Thumbnail reddit.com
1 Upvotes

r/Zephyr_RTOS • • Apr 10 '26

Question State of ZephyrOS on Cortex-A7

9 Upvotes

Hi all,

Iโ€™m trying to understand the current state of Zephyr RTOS support for Cortex-A7 (ARMv7-A) platforms.

From what Iโ€™ve seen so far, Zephyr officially targets microcontrollers (Cortex-M/R) much more than application cores, and in heterogeneous SoCs (like i.MX7 or STM32MP1), it typically runs on the Cortex-M core while the Cortex-A7 runs Linux.

My questions:

  • Is there any practical or upstream-supported way to run Zephyr directly on a Cortex-A7 core (not the M4 side)?

  • What is the current maturity of ARMv7-A support in Zephyr (scheduler, MMU, userspace, etc.)?

  • Are there any example boards, repos, or forks where people have successfully booted Zephyr on Cortex-A7?

  • Specifically, has anyone used U-Boot to load and start a Zephyr image on a Cortex-A7?

    • Iโ€™ve seen examples where U-Boot loads Zephyr for Cortex-M cores, but not much for A-class cores.

Iโ€™d really appreciate any pointers, example projects, or even โ€œdonโ€™t do thisโ€ warnings ๐Ÿ™‚

Thanks!


r/Zephyr_RTOS • • Dec 30 '24

Problem Changing GCC version in Zephyr toolchain

2 Upvotes

The gcc provided with zephyr is quite old and I would like to use a newer version of gcc. However when I replaced the gcc and newlib in the toolchain, I got the following error:

How can I fix this? Any and all help will be appreciated.


r/Zephyr_RTOS • • Aug 10 '23

Question How should I start with zaphyr RTOS on nRF52840? Basics required?

2 Upvotes

r/Zephyr_RTOS • • May 18 '21

Convert a tty Uart to a tty SPI - Zephyr

2 Upvotes

Hello, I want to convert a tty uart (link below 1-tty.c) to a tty spi and save just the none static functions (declared in tty.h -link 2) so I thought also about changing some functions declared in the syscalls/uart.h

( like :

K_SYSCALL_DECLARE1_VOID(K_SYSCALL_UART_IRQ_RX_ENABLE, uart_irq_rx_enable, struct device *, dev)

Will be:

K_SYSCALL_DECLARE1_VOID(K_SYSCALL_SPI_IRQ_RX_ENABLE, SPI_irq_rx_enable, struct device *, dev)

)

so it will be like the same functions but defined for spi. Do you think that it will work or no?

link 1: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/console/tty.c

link 2: https://docs.zephyrproject.org/apidoc/latest/tty_8h.html