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 slugZephyr board namePassing L1 apps
nucleo-f767zinucleo_f767ziblinky, hello_world, philosophers, shell
nucleo-h743zi2nucleo_h743ziblinky, hello_world, philosophers, shell
nrf52840-dknrf52840dk/nrf52840blinky, hello_world, philosophers, shell
frdm-k64ffrdm_k64fblinky, hello_world, philosophers, shell
b-u585i-iot02ab_u585i_iot02ablinky, 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

StageCommandArtifact
1. Build matrixwest twister --build-only -p nucleo_f767zi -p nrf52840dk/nrf52840twister-out/*/zephyr/zephyr.elf
2. Twin executionct test matrix run --json --junit results/ztest.xmlJUnit XML + console logs
3. Determinism checkct test run --recheckBit-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

SymptomFix
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 overflowEnable CONFIG_THREAD_STACK_INFO=y and decode CFSR/STKOF with the HardFault Decoder.
Device init returns -ENODEV on I2C sensorCheck devicetree reg address matches the twin address (e.g. 0x68 vs 0x69 on MPU-6050).
Exit code 4 on unmodelled clock/entropy registerInspect the JSON diagnostic register name and disable unused SoC drivers in prj.conf for the test.
ztest hangs waiting for entropy or crypto peripheralUse CONFIG_TEST_RANDOM_GENERATOR=y in test prj.conf when TRNG is not required.
Console string misses PROJECT EXECUTION SUCCESSFULVerify CONFIG_UART_CONSOLE=y and increase timeout_ms for multi-case ztest suites.

Frequently asked questions

QuestionAnswer
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

More in RTOS & Firmware Stacks