Fifth reference implementation of testbench's device contract (MSP430:
firmware/main.c, ESP32: firmware/esp32/, STM32:
firmware/stm32/, RP2040: firmware/rp2040/). The
other four are bare-metal or vendor-HAL; this one runs the identical protocol
under Zephyr RTOS instead, with a real scheduler, a devicetree-driven driver
model, and west as the build tool, the way production Zephyr applications
are actually structured, rather than a hand-rolled register-poking loop.
Targets the nRF52840 DK, Nordic's own dev board and the single most common Zephyr target in practice. Nothing on the bridge, backend, or dashboard changed to support this chip; it emits byte-for-byte the same JSON frames as every other reference firmware in this repo.
| Signal | Pin | Purpose |
|---|---|---|
| Console UART | onboard USB-to-serial (VCOM), or P0.06 TX / P0.08 RX if repointed at uart1 |
to bridge host |
| ADC: VDD sense | P0.02 (AIN0) | external divider to VDD |
| ADC: current sense | P0.03 (AIN1) | current-sense shunt/amplifier output |
| ADC: temp sense | P0.04 (AIN2) | NTC thermistor divider |
| GPIO loopback out | P1.10 | jumper to P1.11 |
| GPIO loopback in | P1.11 | jumper to P1.10 |
Pin mapping lives in boards/nrf52840dk_nrf52840.overlay.
Edit it (or add another boards/<board>.overlay) to retarget a different
nRF52840 board or repin the DK.
Requires a Zephyr workspace
(west, the Zephyr SDK, and the zephyr repo as a west module). This
directory is a standalone Zephyr application, not a full workspace.
west build -b nrf52840dk/nrf52840 firmware/zephyr
west flashWatch UART output over the console at 115200 baud (Zephyr's default console rate, independent of the 9600 baud, 8N1 the other four reference firmwares use on their dedicated UART peripherals, since this one rides the console device rather than a bit-banged UART).