Skip to content

test: add hardware-validated smoke tests (xiao_nrf54l15, xiao_mg24) - #41

Merged
cumin777 merged 1 commit into
masterfrom
test/hw-smoke-nrf54l15-mg24
Sep 30, 2026
Merged

cumin777 merged 1 commit into
masterfrom
test/hw-smoke-nrf54l15-mg24

Conversation

@cumin777

@cumin777 cumin777 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds per-board MicroPython hardware smoke tests, placed in example/ alongside the existing per-board test scripts (xiao_stm32c5_full_test.py, xiao_nrf54lm20b_full_test.py, ...):

  • example/xiao_nrf54l15_smoke_test.py — 6/6 PASS on hardware
  • example/xiao_mg24_smoke_test.py — 7/7 PASS on hardware

Both were executed against the v1.27.0 master builds on real hardware (2026-09-29).

RA4M1 is not included: no board on hand, hardware run deferred — see the status comment below.

What the hardware run corrected

  1. mg24 user C modules are uppercase (ADC, RTC, CAN, PDM, LowPWR via MP_REGISTER_MODULE(MP_QSTR_*)), with the callable class inside the module (ADC.ADC, RTC.RTC). Consistent with example/boards/xiao.py and every shipped example; an early draft of this test did import adc / import rtc and "failed" — that was a test bug, not a firmware bug. The test exercises ADC.ADC(("adc0", ch)).read_uv() across channels and an RTC.RTC() datetime round-trip (the on-hardware validation of the ci(mg24): drop dead-fork PR override, apply repo v1.27.0 patches for USER_C_MODULES #38 USER_C_MODULES wiring).

  2. nrf54l15 gc threshold 50K was unreachable: the zephyr port default CONFIG_MICROPY_HEAP_SIZE is 49152, leaving exactly 48000 usable bytes after GC bookkeeping (measured free+alloc == 48000). Threshold is now 32K.

How to run

mpremote connect COM<x> run example\xiao_nrf54l15_smoke_test.py

Both boards carry an onboard debug bridge (CMSIS-DAP + CDC UART) — the REPL lives on the bridge CDC port; the MCU's own USB peripheral is not wired to the USB-C connector, so no other USB serial device is expected. mpremote specifically: its raw-paste flow control is needed to push the ~5 KB script through the bridge. Final LED check is visual.

Per-board MicroPython smoke tests in example/ (matching the existing
per-board test scripts like xiao_stm32c5_full_test.py), run over the
board REPL after flashing the CI firmware artifact. Both were executed
against the v1.27.0 master builds on real hardware (2026-09-29):
xiao_nrf54l15 6/6 PASS, xiao_mg24 7/7 PASS.

Findings from the hardware run that are encoded in the tests:

- mg24: the user C modules (PR #38, USER_C_MODULES) register with
  uppercase names -- MP_REGISTER_MODULE(MP_QSTR_ADC, ...) etc, so the
  importable modules are ADC / RTC / CAN / PDM / LowPWR, and the
  callable classes live inside (ADC.ADC, RTC.RTC), consistent with
  example/boards/xiao.py and every shipped example. An early draft of
  this test did `import adc` / `import rtc` and reported ImportError;
  that was a test bug, not a firmware bug. The test now also exercises
  ADC.ADC(("adc0", ch)).read_uv() across channels and an RTC.RTC()
  datetime round-trip.

- nrf54l15: gc threshold lowered 50K -> 32K. The zephyr port default
  CONFIG_MICROPY_HEAP_SIZE is 49152, leaving 48000 usable bytes after
  GC bookkeeping (measured: free+alloc == 48000 exactly), so a >50K
  assertion can never pass on the default build.

- Script headers document how to run: both boards expose the REPL via
  the onboard debug bridge CDC port (mpremote required for raw-paste
  flow control); the MCU USB peripheral is not wired to the USB-C
  connector, so no other USB serial device is expected. The LED check
  is visual.

RA4M1 smoke test follows in a separate PR once its hardware run is done.

Co-Authored-By: Claude <noreply@anthropic.com>
@cumin777
cumin777 force-pushed the test/hw-smoke-nrf54l15-mg24 branch from 434a59c to 6a1c7e2 Compare September 30, 2026 02:02
@cumin777

Copy link
Copy Markdown
Contributor Author

Status before merge (2026-09-30)

Validated on hardware (2026-09-29): xiao_nrf54l15 6/6 PASS, xiao_mg24 7/7 PASS.

NOT validated — no boards on hand, recorded here so the gap is visible:

  • xiao_ra4m1 — hardware run deferred indefinitely (no board available). Its smoke test is therefore intentionally not in this PR. Expectation per the build config: the renesas-ra port uses MicroPython'''s own TinyUSB (MICROPY_HW_ENABLE_USBDEV=1), independent of Zephyr Kconfig, so it should enumerate a USB CDC REPL — but that is unverified, and getting a REPL at all is precisely the on-hardware validation of the VDCEN patch (0002-renesas-ra-usb-ldo-vdcen.patch, carried from upstream micropython#16409 via ci(ra4m1): drop upstream PR #16409 checkout, carry USB LDO VDCEN as patch 0002 #39).
  • xiao_nrf52840 — known-bad: firmware boots but never enumerates a serial port (fix(nrf52840): enable USB CDC ACM console — firmware was headless #40; CI green, real hardware silent — runtime-death analysis needs SWD, archived).

Docs gap for users: the wiki has no MicroPython usage page at all for nrf52840 and ra4m1. For nrf54l15/mg24 a wiki page exists but never mentions that the REPL arrives through the onboard debug bridge'''s CDC port (the MCU USB is not wired to the USB-C connector) — users without that context hit "where is the REPL" (see #12).

@cumin777
cumin777 merged commit 9b2daaf into master Sep 30, 2026
7 checks passed
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