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
west build -b nucleo_f767zi samples/subsys/shell/shell_module
ct run --json --board nucleo-f767zi build/zephyr/zephyr.elfSuite & fault configuration
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
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.xmlRunning 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 |
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.yamlversion: 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. |