Skip to content

nRF52 UARTE EasyDMA TX — unmodified Zephyr console boots in the sim#340

Merged
w1ne merged 3 commits into
mainfrom
feat/zephyr-nrf52-bringup
Jun 23, 2026
Merged

nRF52 UARTE EasyDMA TX — unmodified Zephyr console boots in the sim#340
w1ne merged 3 commits into
mainfrom
feat/zephyr-nrf52-bringup

Conversation

@w1ne

@w1ne w1ne commented Jun 23, 2026

Copy link
Copy Markdown
Owner

What

Implements nRF52 UARTE EasyDMA TX so unmodified Zephyr (and any nrfx-based) firmware can use the console.

Nrf52Uarte previously tracked registers but TASKS_STARTTX did nothing — no DMA read of the TXD buffer, no output, no completion events. Since nrfx/Zephyr drive the console exclusively through UARTE EasyDMA, the console was silent and a polling poll_out hung forever on EVENTS_TXSTOPPED.

Changes

  • EasyDMA TX in Nrf52Uarte via the existing needs_bus_tick/tick_with_bus pattern (the RADIO PACKETPTR precedent): on STARTTX, DMA-read TXD.MAXCNT bytes from TXD.PTR, emit to stdout + capture sink, set TXD.AMOUNT, and raise the begin→drain→stop events (TXSTARTED/TXDRDY/ENDTX/TXSTOPPED). nrfx enables the ENDTX_STOPTX short and waits on TXSTOPPED, so that one must fire.
  • Point nrf52840 uart0 at the EasyDMA model (nrf52840_uart, irq 2) — it is a UARTE in silicon; the legacy "uart" mapping was the inaccuracy.
  • Wire Bus::attach_uart_tx_sink to capture/echo the UARTE console.
  • EasyDMA TX regression test.

Verification

Unmodified Zephyr v3.7.2 LTS samples/hello_world (built gnuarmemb, no SDK) boots and prints:

Hello World! nrf52840dk/nrf52840

both via the top-level run and labwired test --script (uart_contains assertion → exit 0). Full nRF52 + UARTE test suites pass; no regressions.

This is Phase 0 of a broader Zephyr integration (west runner + hosted Zephyr build to follow). The SCB SYSRESETREQ warm-reset that Zephyr's SystemInit needs is already on main; this PR is the remaining console piece.

w1ne added 3 commits June 23, 2026 10:37
The Nrf52Uarte model tracked registers but TASKS_STARTTX did nothing — no
DMA read of the TXD buffer, no output, no completion events. nRF drivers
(nrfx/Zephyr) drive the console exclusively through UARTE EasyDMA, so the
console was silent and a polling `poll_out` hung forever waiting on
EVENTS_TXSTOPPED.

Implement EasyDMA TX via the existing needs_bus_tick/tick_with_bus pattern
(the RADIO PACKETPTR precedent): on STARTTX, DMA-read TXD.MAXCNT bytes from
TXD.PTR, emit them to stdout + the capture sink, set TXD.AMOUNT, and raise
the begin→drain→stop events (TXSTARTED/TXDRDY/ENDTX/TXSTOPPED) the driver
polls — nrfx enables the ENDTX_STOPTX short and waits on TXSTOPPED.

- Point nrf52840 uart0 at the EasyDMA model (it is a UARTE in silicon; the
  legacy `"uart"` mapping was the inaccuracy), irq 2.
- Wire Bus::attach_uart_tx_sink to capture/echo the UARTE console.
- Add an EasyDMA TX regression test.

Result: unmodified Zephyr v3.7 hello_world boots and prints
"Hello World! nrf52840dk/nrf52840" in the sim, both via the top-level run
and `labwired test` (uart_contains assertion).
The UARTE model gained an EasyDMA TX path so an unmodified nrfx/Zephyr
console boots under the sim. That changes a peripheral model after the
2026-06-17 silicon capture, which the drift gate flags. Record a dated
drift_ack on nrf52840 and the Seeed XIAO (same silicon), and regenerate
VALIDATION_STATUS.md. Additive change; the prior register sweep holds and
a UARTE TX live diff stays tracked.
@w1ne w1ne merged commit c3fe35c into main Jun 23, 2026
14 checks passed
@w1ne w1ne deleted the feat/zephyr-nrf52-bringup branch June 23, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant