MCU Testing & CI

Nordic nRF52840 firmware CI without hardware

Test nRF52 EasyDMA peripheral logic, Zephyr RTOS threads and sensor fault recovery on deterministic Nordic board twins.

nRF52 EasyDMA peripherals (TWIM, SPIM, UARTE, SAADC) require RAM-resident buffers—passing a const Flash pointer silently fails on silicon. Running your real nRF52840 binary on a twin exercises register tasks/events, PPI triggers and Zephyr device init in CI.

Be explicit about scope: CircuitTwin models the Cortex-M4F core, clocks, timers, GPIO, SAADC, TWIM, SPIM and UARTE (with passing SAADC oracle and 4/4 Zephyr L1 boots on nrf52840-dk and feather-nrf52840-express). Native BLE SoftDevice / Zephyr radio PHY stacks are not modelled today.

Nordic nRF52 board coverage

Board slugMCUVerified / provisional highlights
nrf52840-dknRF52840 (1 MB / 256 KB)Passing SAADC oracle + 4/4 Zephyr L1 boots
feather-nrf52840-expressnRF528404/4 Zephyr L1 boots + ARMv7E-M differential
nrf52833-dknRF52833 (512 KB / 128 KB)ARMv7E-M differential + scorecard tracking
seeed-xiao-nrf52840nRF52840Compact wearable sensor-hub target

Local CLI workflow

Shell — run nRF52840 Zephyr ELF
west build -b nrf52840dk/nrf52840 app/
ct run --json --board nrf52840-dk build/zephyr/zephyr.elf

Suite & fault configuration

tests/nrf52840.suite.yaml
version: 1
board: nrf52840-dk
firmware: build/zephyr/zephyr.elf
tests:
  - name: uarte-and-bme680-boot
    timeout_ms: 2000
    expect:
      console_contains: "BME680_READY"
      exit_code: 0
  - name: twim-nack-handling
    faults:
      - at_ms: 60
        bus: TWIM0
        kind: nack
        address: 0x76
        count: 2
    expect:
      console_contains: "SENSOR_FALLBACK_ACTIVE"

CI pipeline integration

.github/workflows/nrf52840-ci.yml
name: nRF52840 Twin CI
on: [push, pull_request]
jobs:
  nrf52840:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: west build -b nrf52840dk/nrf52840 app/
      - uses: circuittwin/action@v1
        with:
          suite: tests/nrf52840.suite.yaml
          junit-out: results/nrf52840.xml

Troubleshooting checklist

SymptomFix
EasyDMA TX sends garbage or zero bytesConfirm TX buffer lives in RAM (0x20000000+); EasyDMA cannot read directly from Flash (0x00000000).
Run ends inconclusive (exit code 4) on RADIO registersDisable BLE controller init in the sensor-logic test profile (CONFIG_BT=n) since native BLE RF is unmodelled.
UARTE baud mismatch with host consoleCheck UARTE->BAUDRATE register constant (0x01D7E000 for 115200) in the UART Baud Calculator.
SAADC readings offset after sleepTrigger TASKS_CALIBRATEOFFSET on startup and verify buffer pointer re-arming before TASKS_START.

Related boards & component twins

More in MCU Testing & CI