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 slug               | MCU                        | Verified / provisional highlights           |
| ------------------------ | -------------------------- | ------------------------------------------- |
| nrf52840-dk              | nRF52840 (1 MB / 256 KB)   | Passing SAADC oracle + 4/4 Zephyr L1 boots  |
| feather-nrf52840-express | nRF52840                   | 4/4 Zephyr L1 boots + ARMv7E-M differential |
| nrf52833-dk              | nRF52833 (512 KB / 128 KB) | ARMv7E-M differential + scorecard tracking  |
| seeed-xiao-nrf52840      | nRF52840                   | Compact 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

| Symptom                                                | Fix                                                                                                            |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- |
| EasyDMA TX sends garbage or zero bytes                 | Confirm TX buffer lives in RAM (0x20000000+); EasyDMA cannot read directly from Flash (0x00000000).            |
| Run ends inconclusive (exit code 4) on RADIO registers | Disable BLE controller init in the sensor-logic test profile (CONFIG\_BT=n) since native BLE RF is unmodelled. |
| UARTE baud mismatch with host console                  | Check UARTE->BAUDRATE register constant (0x01D7E000 for 115200) in the UART Baud Calculator.                   |
| SAADC readings offset after sleep                      | Trigger TASKS\_CALIBRATEOFFSET on startup and verify buffer pointer re-arming before TASKS\_START.             |

## Related boards & component twins

[Board: nrf52840-dk](https://circuittwin.ai/boards/nrf52840-dk) [Board: feather-nrf52840-express](https://circuittwin.ai/boards/feather-nrf52840-express) [Board: nrf52833-dk](https://circuittwin.ai/boards/nrf52833-dk) [Board: seeed-xiao-nrf52840](https://circuittwin.ai/boards/seeed-xiao-nrf52840) [Twin: BME680](https://circuittwin.ai/twins/bme680) [Twin: BMI270](https://circuittwin.ai/twins/bmi270) [Twin: VL53L0X](https://circuittwin.ai/twins/vl53l0x) [Twin: SX1280](https://circuittwin.ai/twins/sx1280) [Board dashboard](https://circuittwin.ai/docs/board-dashboard) [CI integration](https://circuittwin.ai/docs/ci)

## More in MCU Testing & CI

[STM32F7 firmware CI without a bench](https://circuittwin.ai/guides/stm32f7-firmware-ci) [STM32F4 firmware testing without hardware](https://circuittwin.ai/guides/stm32f4-firmware-testing) [STM32H7 digital twin CI for H743 & H747](https://circuittwin.ai/guides/stm32h7-digital-twin-ci) [STM32F103 Blue Pill & NUCLEO-F103RB simulation](https://circuittwin.ai/guides/stm32f103-bluepill-simulation)

> ## 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)
