RTOS & Firmware Stacks

# Zephyr RTOS CI without hardware benches

Execute your target Zephyr zephyr.elf directly on STM32, nRF52840 and FRDM-K64F board twins instead of porting drivers to native\_sim.

Zephyr native\_sim compiles your app to a host POSIX binary, which skips ARM startup code, NVIC priorities, DMA descriptors and real peripheral register drivers. Running the cross-compiled zephyr.elf on a CircuitTwin board twin exercises the exact devicetree bindings and register writes you ship.

Clean-tree evidence under public/evidence/accuracy/zephyr-2026-11-21.json and board-dashboard.json tracks Zephyr kernel suites and L1 boot apps (blinky, hello\_world, philosophers, shell) across STM32F0/F1/F4/F7/G0/H7/L4/L5/U5, nRF52840 and FRDM-K64F.

## Zephyr L1 boot boards passing 4/4 suites

| Board slug     | Zephyr board name   | Passing L1 apps                           |
| -------------- | ------------------- | ----------------------------------------- |
| nucleo-f767zi  | nucleo\_f767zi      | blinky, hello\_world, philosophers, shell |
| nucleo-h743zi2 | nucleo\_h743zi      | blinky, hello\_world, philosophers, shell |
| nrf52840-dk    | nrf52840dk/nrf52840 | blinky, hello\_world, philosophers, shell |
| frdm-k64f      | frdm\_k64f          | blinky, hello\_world, philosophers, shell |
| b-u585i-iot02a | b\_u585i\_iot02a    | blinky, hello\_world, philosophers, shell |

## Local CLI workflow

Shell — west build & ct run

```
west build -b nucleo_f767zi samples/subsys/shell/shell_module
ct run --json --board nucleo-f767zi build/zephyr/zephyr.elf
```

## Suite & fault configuration

tests/zephyr-ci.suite.yaml

```
version: 1
board: nucleo-f767zi
firmware: build/zephyr/zephyr.elf
tests:
  - name: zephyr-shell-prompt
    timeout_ms: 2500
    expect:
      console_contains: "uart:~$"
      exit_code: 0
  - name: zephyr-i2c-sensor-nack
    faults:
      - at_ms: 100
        bus: I2C1
        kind: nack
        address: 0x44
        count: 2
    expect:
      console_contains: "sensor_retry_ok"
```

## CI pipeline integration

.github/workflows/zephyr-twin-ci.yml

```
name: Zephyr Twin CI
on: [push, pull_request]
jobs:
  zephyr:
    runs-on: ubuntu-latest
    container: ghcr.io/zephyrproject-rtos/zephyr-build:v0.26.13
    steps:
      - uses: actions/checkout@v4
      - run: west build -b nucleo_f767zi app/
      - uses: circuittwin/action@v1
        with:
          suite: tests/zephyr-ci.suite.yaml
          junit-out: results/zephyr.xml
```

## Running Zephyr Twister suites on digital twins

Build Zephyr ztest suites with west/twister --build-only, then run every target ELF on real board twins in parallel.

Zephyr Twister excels at building dozens of board configurations, yet running hardware tests requires USB-attached devkits and pytest-twister serial muxes.

Pair twister --build-only with ct test matrix run to execute the exact target zephyr.elf across NUCLEO-F767ZI, NUCLEO-H743ZI2, nRF52840 DK and FRDM-K64F in seconds.

### Twister + CircuitTwin pipeline stages

| Stage                 | Command                                                            | Artifact                         |
| --------------------- | ------------------------------------------------------------------ | -------------------------------- |
| 1\. Build matrix      | west twister --build-only -p nucleo\_f767zi -p nrf52840dk/nrf52840 | twister-out/\*/zephyr/zephyr.elf |
| 2\. Twin execution    | ct test matrix run --json --junit results/ztest.xml                | JUnit XML + console logs         |
| 3\. Determinism check | ct test run --recheck                                              | Bit-identical trace verification |

Shell - build with Twister and run on twins

```
west twister --build-only -p nucleo_f767zi -p frdm_k64f -T tests/drivers/sensor
ct test matrix run --json --junit results/twister-twin.xml tests/twister-matrix.yaml
```

tests/twister-matrix.yaml

```
version: 1
matrix:
  - name: f767-ztest
    board: nucleo-f767zi
    firmware: twister-out/nucleo_f767zi/app/zephyr/zephyr.elf
    expect:
      console_contains: "PROJECT EXECUTION SUCCESSFUL"
  - name: k64f-ztest
    board: frdm-k64f
    firmware: twister-out/frdm_k64f/app/zephyr/zephyr.elf
    expect:
      console_contains: "PROJECT EXECUTION SUCCESSFUL"
```

## Troubleshooting checklist

| Symptom                                              | Fix                                                                                                |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| No console output from printk()                      | Confirm CONFIG\_UART\_CONSOLE=y and chosen zephyr,console points to the board VCP UART.            |
| Zephyr kernel hits k\_oops() on stack overflow       | Enable CONFIG\_THREAD\_STACK\_INFO=y and decode CFSR/STKOF with the HardFault Decoder.             |
| Device init returns -ENODEV on I2C sensor            | Check devicetree reg address matches the twin address (e.g. 0x68 vs 0x69 on MPU-6050).             |
| Exit code 4 on unmodelled clock/entropy register     | Inspect the JSON diagnostic register name and disable unused SoC drivers in prj.conf for the test. |
| ztest hangs waiting for entropy or crypto peripheral | Use CONFIG\_TEST\_RANDOM\_GENERATOR=y in test prj.conf when TRNG is not required.                  |
| Console string misses PROJECT EXECUTION SUCCESSFUL   | Verify CONFIG\_UART\_CONSOLE=y and increase timeout\_ms for multi-case ztest suites.               |

## Frequently asked questions

| Question                                                            | Answer                                                                                                                                     |
| ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Does Zephyr ztest output work natively with CircuitTwin assertions? | Yes. Match "PROJECT EXECUTION SUCCESSFUL" in expect.console\_contains and fail automatically on "PROJECT EXECUTION FAILED" or kernel oops. |

## Related boards & component twins

[Board: nucleo-f767zi](https://circuittwin.ai/boards/nucleo-f767zi) [Board: nucleo-h743zi2](https://circuittwin.ai/boards/nucleo-h743zi2) [Board: nrf52840-dk](https://circuittwin.ai/boards/nrf52840-dk) [Board: frdm-k64f](https://circuittwin.ai/boards/frdm-k64f) [Board: b-u585i-iot02a](https://circuittwin.ai/boards/b-u585i-iot02a) [Twin: SHT31-DIS](https://circuittwin.ai/twins/sht31-dis) [Twin: LSM6DSO](https://circuittwin.ai/twins/lsm6dso) [Twin: BME680](https://circuittwin.ai/twins/bme680) [Twin: BME280](https://circuittwin.ai/twins/bme280) [Zephyr board dashboard rows](https://circuittwin.ai/docs/board-dashboard) [Zephyr accuracy record](https://circuittwin.ai/docs/accuracy) [Zephyr RTOS CI guide](https://circuittwin.ai/guides/zephyr-rtos-ci-without-hardware)

## More in RTOS & Firmware Stacks

[FreeRTOS headless testing in CI](https://circuittwin.ai/guides/freertos-headless-testing) [ESP-IDF CI simulation for ESP32, S3 & C3](https://circuittwin.ai/guides/esp-idf-ci-simulation) [PX4 Pixhawk 6C simulation on real ARM ELF](https://circuittwin.ai/guides/px4-pixhawk-6c-simulation) [Marlin 3D printer firmware testing in CI](https://circuittwin.ai/guides/marlin-firmware-testing-ci)

> ## Run this workflow on your own ELF
>
> Start free on CircuitTwin to run local board twins, fault matrices and CI checks with zero per-run credits.
>
> [Start now](https://app.circuittwin.ai/try) [Read the quickstart](https://circuittwin.ai/docs/quickstart) [Connect a coding agent](https://circuittwin.ai/docs/agents)
