Skip to content

test(rp2040): validate watchdog recovery and deploy-to-RPC soak #3630

Closed

Description

@zackees

Context

Parent: #3626
Depends on: #3628 and #3629.

A single successful flash/RPC exchange does not prove that deployment, USB re-enumeration, port handoff, watchdog recovery, and JSON-RPC remain reliable across repeated cycles. The AutoResearch firmware exposes deliberateHang, which acknowledges the request and then hangs so the watchdog path can be observed.

Proposal

Add/extend the pin-free RPC workflow to validate deliberate watchdog recovery, then execute a ten-cycle deployment-to-RPC soak on the attached Pico.

Acceptance criteria

Watchdog recovery

  • Invoke deliberateHang through the normal RPC client.
  • Receive and record the method acknowledgement before the device hangs.
  • Observe the expected serial disconnect/reset within the documented watchdog interval.
  • Reacquire the application device through the fbuild/AutoResearch handoff path; do not retain a stale COM handle.
  • A post-reset ping succeeds.
  • Uptime/reset evidence demonstrates that a reboot occurred.
  • The pin-free JSON-RPC smoke set passes again after recovery.

Deployment soak

Run ten consecutive cycles equivalent to:

bash autoresearch rp2040 --rpc-smoke --timeout 120s
  • Every cycle performs a real build/deploy or an explicitly documented deploy of the current artifact through fbuild.
  • Every cycle reaches application CDC and completes the RPC smoke set.
  • Record any COM-port changes between cycles.
  • Zero cycles fail from stale ports, wrong-device selection, missed boot volume, deployment timeout, malformed JSON, or leftover serial data.
  • Failure output includes the cycle number and preserves the fbuild and RPC diagnostics.
  • Closeout includes the exact command/scripted canonical invocation, board VID:PID/identity, all cycle results, and decisive watchdog output.

Related issues

Activity

  1. zackees commented on Jul 14, 2026

    @zackees
    MemberAuthor

    This phase remains hardware-gated. The current host has no RP2040 endpoint (latest build port scan: 11 USB ports, no Raspberry Pi 2E8A:0003), so repeated stock-board deploy/RPC/watchdog cycles cannot be honestly claimed yet. Once the Pico is connected, run the fbuild-linked --rpc-smoke path and capture 10 deploy/reboot cycles plus deliberateHang recovery before closing.

  2. zackees commented on Jul 14, 2026

    @zackees
    MemberAuthor

    Added reusable --watchdog-soak in merged FastLED PR #3638. It uses RpcClient, records deliberateHang ACK, requires CDC disappearance/re-enumeration, validates post-reset ping/uptime, and reruns pin-free RPC smoke. Hardware execution is currently NOT accepted: on this Pico the deliberateHang request did not produce an ACK through the fbuild serial session and left the board in RPI-RP2 BOOTSEL; recovery requires investigation/physical restore. The normal ten-cycle deployment soak is separately complete (10/10 RPC smoke PASS).

  3. zackees commented on Jul 14, 2026

    @zackees
    MemberAuthor

    Follow-up merged in FastLED PR #3639: explicit Serial.flush() before deliberateHang disables interrupts, addressing a likely RP2040 CDC ACK race. Hardware retest remains pending because the prior deliberateHang left the attached board in BOOTSEL (2E8A:0003) rather than returning application CDC.

  4. zackees commented on Jul 14, 2026

    @zackees
    MemberAuthor

    CORRECTION: the watchdog timeout was also against the wrong COM11 CP210x device; it is not valid Pico evidence. Strict RP2040 CDC identity matching is being merged before retesting.

  5. zackees commented on Jul 15, 2026

    @zackees
    MemberAuthor

    Real-Pico watchdog implementation/acceptance update (2026-07-15)

    This is already the watchdog child issue of #3626, so no duplicate issue was filed.

    Implementation status:

    • AutoResearch.ino arms fl::Watchdog before fallible setup and uses the 5 s loop/RPC guard.
    • RP2040 uses the Pico SDK hardware watchdog backend in src/platforms/arm/rp/watchdog_rp.impl.hpp; it is independent of the cooperative RPC/task scheduler and is not fed from an ISR/timer.
    • A local bring-up fix moves RPC registration/task setup above the fallible createRxDevice() path, so watchdog recovery and pin-free RPC remain reachable when the unsoldered board has no RX channel.
    • RpcClient now preserves JSON-RPC errors instead of masking -32601 as a timeout.

    Decisive attached-board command:

    UV_NO_SYNC=1 bash autoresearch rp2040 --watchdog-soak --timeout 120s --skip-lint

    Identity:

    COM12
    VID:PID 2E8A:000A
    serial 5303284720C4641C
    

    Observed result:

    WATCHDOG: pre-reset ping uptimeMs=3518
    WATCHDOG: deliberateHang acknowledgement={'acknowledged': True}
    WATCHDOG: application port disconnected=True
    WATCHDOG: post-reset ping uptimeMs=3186 port=COM12 reset_evidence=True
    RESULT: RPC smoke PASS (...)
    RESULT: watchdog soak PASS (ack, disconnect, CDC recovery, ping, RPC smoke)
    

    This proves the product does not remain wedged after an RPC/firmware hang: the hardware watchdog resets it, Windows observes CDC disconnect/re-enumeration, the same Pico identity is reacquired, uptime resets, and the full pin-free RPC surface works again.

    Correction retained: the earlier COM11 soak/watchdog evidence is invalid for Pico acceptance because COM11 is a CP210x device (10C4:EA60). Only the COM12 evidence above is accepted. The ten-cycle deployment soak still needs to be rerun against COM12 before this issue is closed.

  6. zackees commented on Jul 15, 2026

    @zackees
    MemberAuthor

    Watchdog and deployment-soak acceptance is complete on the genuine Pico 1, COM12 (2E8A:000A, serial 5303284720C4641C).

    Watchdog command:

    UV_NO_SYNC=1 bash autoresearch rp2040 --watchdog-soak --timeout 120s --skip-lint

    Decisive evidence:

    • pre-reset uptime: 3518 ms
    • deliberateHang acknowledged: {'acknowledged': True}
    • application port disconnected
    • the existing RP2040 hardware watchdog reset the wedged firmware
    • COM12 was reacquired; post-reset ping uptime: 3186 ms, reset evidence true
    • the complete post-reset RPC smoke set passed
    • RESULT: watchdog soak PASS (ack, disconnect, CDC recovery, ping, RPC smoke)

    Deployment soak:

    • 10 consecutive UV_NO_SYNC=1 bash autoresearch rp2040 --rpc-smoke --timeout 120s --skip-lint cycles
    • before every cycle, fbuild port scan matched exactly COM12 / 2E8A:000A / serial 5303284720C4641C (never the unrelated CP210x COM11)
    • every cycle performed a real fbuild UF2 deploy, returned COM12, and ended in RESULT: RPC smoke PASS
    • result: 10/10 passed with no manual action, stale port, wrong device, missed boot volume, deploy timeout, malformed JSON, or leftover serial data

    The watchdog implementation was already present in FastLED's RP2040 backend and AutoResearch loop; #3646 moved RPC registration ahead of fallible unsoldered RX setup so the hang trigger and recovery diagnostics are always reachable. fbuild reset-race hardening merged in FastLED/fbuild#1073.

  7. moved this from Triage to Done in FastLED Trackeron Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions