Skip to content

agent runbook: get bash autoresearch esp32p4 --parlio working end-to-end on the attached EV board #2510

@zackees

Description

@zackees

Goal

bash autoresearch esp32p4 --parlio runs to completion on the attached ESP32-P4-EV (currently COM25, VID 0x303A PID 0x1001) and prints a normal autoresearch test summary. Today it fails before any test runs. This issue is only about the autoresearch feature — not general compile, not the perf analysis. The success bar is autoresearch driving the device over its JSON-RPC protocol and reporting PARLIO pass/fail.

How to work this issue (agent instructions)

This is a meta-tracking issue. As you make progress, the goal is not to do everything in one shot; it's to discover blockers, file them as new GitHub issues cross-referenced back here, fix them one at a time, and tick them off the checklist below.

Rules of engagement:

  1. Each distinct autoresearch blocker → a new GitHub issue. Don't pile fixes into one PR or commit. If you discover that, say, the fbuild daemon doesn't propagate PLATFORMIO_SRC_DIR, file fbuild: daemon ignores PLATFORMIO_SRC_DIR env var from client (autoresearch can't pick sketch) as its own issue, link it as a child of this one ("Tracked in #..."), and fix it on its own branch + PR.
  2. Stay in scope. Anything orthogonal to autoresearch (e.g. perf optimization opportunities you spot in the trace data, refactoring ideas, general compile-time issues unrelated to autoresearch's build path) belongs in its own issue — file it, link it, and keep moving. This issue is only the autoresearch happy-path.
  3. Touch the right repo. Code fixes go to whichever repo owns the bug:
  4. Use the local fbuild checkout at C:/Users/niteris/dev/fbuild (already cloned) for fbuild work. Always branch off main, never push to main.
  5. Verify every fix end-to-end on the connected hardware via autoresearch before closing a sub-issue. "Compiles" is not enough; "bash compile esp32p4 --examples AutoResearch succeeds" is not enough; the sub-issue is only done when bash autoresearch esp32p4 --parlio gets further than it did before the fix.
  6. Append progress here as comments, one per sub-issue closed. Include the autoresearch summary output if available.
  7. Don't disturb in-progress local edits. If the fbuild clone has uncommitted changes, git status it first, decide whether they're throw-away formatter churn (drop) or real work-in-progress (stash and restore after).
  8. Stop signal: bash autoresearch esp32p4 --parlio --skip-lint exits 0 with at least one PARLIO test reported in the streaming output.

Known blockers (do these in order, file sub-issues as you confirm each)

1. ⏳ fbuild PR #273 needs to merge + ship in a release

  • PR: fix(esp32): strip Windows UNC prefix + collect .S/.s assembly sources (FastLED #2507) fbuild#273 (fix/esp32p4-include-paths) — fixes the Windows \?\ UNC prefix mangling and the .S/.s assembly source drop. Without this, autoresearch fails at the build phase before it can even attempt to upload.
  • Already verified locally: with that PR's binaries dropped into .venv/Scripts/, bash compile esp32p4 --examples AutoResearch --no-filter succeeds.
  • Action: chase the review, get it merged, cut a new fbuild release (likely 2.2.7), then bump FastLED's pyproject.toml fbuild pin to that version. Mirror the pattern from commits 7ae55c0 / adab3f8. Don't sub-issue this one — it's the unblock for everything below.

2. 🟥 fbuild daemon ignores PLATFORMIO_SRC_DIR — autoresearch compiles the wrong sketch

  • Symptom: bash autoresearch esp32p4 --parlio sets os.environ[\"PLATFORMIO_SRC_DIR\"] = examples/AutoResearch in ci/autoresearch/phases.py:564, but the long-lived fbuild daemon inherits its env from whoever spawned it first. Result: the daemon compiles examples/Sailboat (platformio.ini default src_dir) instead of AutoResearch, hits unrelated build errors, and autoresearch never reaches the RPC handshake phase.
  • Reproducer:
    bash autoresearch esp32p4 --parlio --skip-lint --timeout 60
    
    Confirm by checking the build error output references examples/Sailboat/... not examples/AutoResearch/....
  • Two valid fixes:
    a. Pass src_dir through the daemon protocol (preferred — explicit > env-var inheritance).
    b. Kill + respawn the daemon at the start of each autoresearch invocation so it picks up the current env.
  • File this as a new fbuild issue before fixing. Title suggestion: fbuild daemon doesn't pick up PLATFORMIO_SRC_DIR from client process env. Confirm whether the fix lives in the daemon protocol or the FastLED-side autoresearch wrapper.

3. 🟥 USB-Serial-JTAG produces no host-visible bytes post-boot — autoresearch RPC can't connect

  • Symptom: COM25 enumerates and esptool can flash, but once the AutoResearch sketch boots, no bytes ever reach the host. The autoresearch driver's RPC client times out waiting for the device's REMOTE: responses, and the run aborts with No response with ID 1 within Xs.
  • This is the autoresearch-relevant slice of fbuild: bash autoresearch esp32p4 --parlio fails to build (WString.h / soc_caps.h missing, zccache hang) #2507 — fix it here only insofar as autoresearch needs it. (If you find a way to make autoresearch work over a different transport — BLE, flash-dump, anything — that's also a valid fix for this issue. The goal is autoresearch, not specifically serial.)
  • What's already been tried (don't repeat verbatim):
    • ARDUINO_USB_MODE=0 alone
    • ARDUINO_USB_MODE=0 + ARDUINO_USB_CDC_ON_BOOT=1 (currently committed)
    • ARDUINO_USB_MODE=1 + ARDUINO_USB_CDC_ON_BOOT=1 (no OTG port enumerates — only one USB cable)
    • 3 s / 5 s / 10 s delays before first Serial.println
    • DTR/RTS variants, dtr=None, rts=None no-touch open
    • Reopening port after expected re-enumeration window
  • New angles to try (not yet exhausted):
    • Serial.setTxTimeoutMs(0) so HWCDC writes don't block when no host is reading
    • Drive the JTAG endpoint directly via usb_serial_jtag_driver_install + usb_serial_jtag_write_bytes from ESP-IDF instead of going through Arduino's Serial
    • Try pio device monitor --port COM25 — PIO's monitor may handle the JTAG handshake differently than raw pyserial / the autoresearch RPC client
    • Compare against a minimal Serial.println(\"hi\") sketch (rule out our app being the variable)
    • Investigate whether autoresearch's BLE transport (AutoResearchBle) is a viable alternate path on esp32p4 — the AutoResearch sketch already wires it up
    • On Windows, swap the USB driver via Zadig and try a different CDC-class driver
  • File this as a new FastLED issue scoped to "autoresearch can't talk to esp32p4-EV over the dev-board's USB connector." Title suggestion: autoresearch: ESP32-P4-EV RPC client times out — no host-visible Serial bytes after boot. Cross-ref PR debug(parlio): #2493 reproducer + FL_PARLIO_PROFILE markers #2494, issue fbuild: bash autoresearch esp32p4 --parlio fails to build (WString.h / soc_caps.h missing, zccache hang) #2507.

Reference state at the time of filing

Done definition

  • bash autoresearch esp32p4 --parlio --skip-lint exits 0
  • At least one PARLIO test reported in the streaming autoresearch output
  • Autoresearch summary line posted as a comment here
  • All sub-issues filed by the agent have either landed PRs or have a clear "won't fix" note linked back to this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions