Repository navigation
Description
Summary
Meta-issue tracking that bash autoresearch esp32p4 --parlio cannot complete on a fresh dev environment for the ESP32-P4-EV board. Both default (fbuild) and --no-fbuild code paths hit toolchain integration failures, while plain pio run -e esp32p4 --target upload against the same sketch succeeds. This is blocking empirical verification of the PARLIO-blocking follow-up to #2493 / #2494 / #2503 — the new fl::PerfTrace instrumentation (see PR linked below) needs a working autoresearch loop to capture per-frame data.
Reproducer
Environment: Windows 10 x64, ESP32-P4-EV on COM25 (VID 0x303A, PID 0x1001), arduino-esp32 framework v3.3.7, fbuild 2.2.5, zccache 1.9.0.
git clone https://github.com/FastLED/FastLED && cd FastLED
git checkout master
bash autoresearch esp32p4 --parlio --skip-lint --timeout 180Observed failures
1. zccache daemon hang (first run after fresh zccache clear)
[fbuild] operation failed: build error: build failed: project-as-library 'fastled' compilation failed:
build failed: build failed: failed to compile <repo>/src/fl/build/fl.sensors+.cpp in library fastled:
zccache[err][R]: broken connection to daemon: recv timed out after 300s
Daemon recovers on retry, but ~300s of wall time is burned.
2. arduino-esp32 internal-header miss (fbuild default path)
[fbuild] compilation failed for .../framework-arduinoespressif32/.../3.3.7/esp32-core-3.3.7/cores/esp32/HEXBuilder.cpp:
HEXBuilder.h:23:10: fatal error: WString.h: No such file or directory
23 | #include <WString.h>
WString.h is present at <cache>/.../3.3.7/esp32-core-3.3.7/cores/esp32/WString.h (sibling file). The compile command for HEXBuilder.cpp is missing the cores/esp32/ include directory.
3. arduino-esp32 SoC-header miss (fbuild --no-filter / --no-fbuild path)
fatal error: soc/soc_caps.h: No such file or directory
16 | #include "soc/soc_caps.h"
The header exists at <cache>/.../3.3.7/esp32-core-3.3.7/tools/esp32-arduino-libs/esp32p4/include/soc/esp32p4/include/soc/soc_caps.h. The compile command is missing the chip-specific SoC include path that PlatformIO injects via the platform manifest.
Direct PlatformIO works
The same sketch builds and uploads cleanly via stock PlatformIO:
PLATFORMIO_SRC_DIR=examples/AutoResearch \
uv run pio run -e esp32p4 --target upload --upload-port COM25 \
--project-dir .Result: SUCCESS, 1654858 bytes flash (52.6% of 3MB), firmware uploaded over USB-Serial-JTAG.
Why this matters
We need autoresearch to capture per-frame PARLIO timing on a real ESP32-P4 to confirm whether the wait-loop blocking issue is fully resolved post-#2503 or if the new setPerfTraceEnabled / getPerfTraceLog RPCs (PR forthcoming) still show residual ~16 ms blocking. Without autoresearch we have no automated regression coverage for #2493.
Scope / acceptance
- Investigate why fbuild's arduino-esp32 esp32p4 toolchain config omits
cores/esp32/and the chip-specifictools/esp32-arduino-libs/<chip>/include/soc/<chip>/include/directories from the compile command. PIO derives these from the platform's manifest; fbuild may be skipping the same wiring. - Investigate the zccache daemon timeout — repeatable on first compile of
fl.sensors+.cppafterzccache clear. May be unrelated (large TU?) or a daemon stability bug. - Fix in the fbuild repo (https://github.com/FastLED/fbuild) and cut a new release.
- Bump fbuild pin in FastLED (mirroring 7ae55c0 / adab3f8).
- Re-run
bash autoresearch esp32p4 --parlioto confirm green. - Run the new
ci/perf_trace_sweep.pyagainst the device and append the per-frame trace dump (12 lanes × 256 LEDs WS2812B) to this issue.
Related
- ESP32-P4 PARLIO: FastLED.show() appears to block for ~16.7 ms before WS2812 data burst begins #2493 — original PARLIO blocking report
- debug(parlio): #2493 reproducer + FL_PARLIO_PROFILE markers #2494 — earlier reproducer / FL_PARLIO_PROFILE markers (couldn't capture serial in dev env)
- fix(channels): skip vTaskDelay(1) floor in wait-loop on ESP32-P4 (#2493 follow-up) #2503 — vTaskDelay floor fix (landed)
- New PR introducing
fl::PerfTrace(instrumentation that needs autoresearch to validate)
🤖 Filed via Claude Code while attempting the PARLIO perf-trace follow-up to #2503.
Activity
zackees commentedon May 24, 2026
Additional finding: USB-Serial-JTAG produces no host-side bytes after boot
Reproduced PR #2494's serial-capture failure. Updating because it should be tracked alongside the fbuild work (autoresearch is blocked by both the toolchain issue and the inability to read serial back).
What works
esptool --chip esp32p4 --port COM25 write_flash 0x2000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin— uploads cleanly, hash verified.image-infoon the produced firmware.bin confirms a valid ESP32P4 image.What doesn't work
After a valid app is flashed and the device reset, no bytes ever arrive on COM25 — neither boot banners nor the AutoResearch sketch's
Serial.printlnoutput. Any RPC sent to the port goes silent (noREMOTE:response).Likely cause + first remediation tried
On the ESP32-P4-EV board,
ARDUINO_USB_MODE=1routesSerialto the USB-OTG connector (separate from the JTAG port that enumerates as COM25, VID 0x303A PID 0x1001). Master hadARDUINO_USB_MODE=1; PR #2494 already noticed this and set it to 0 in their reproducer.I applied
ARDUINO_USB_MODE=0(Serial → built-in USB-Serial-JTAG / UART0) and reflashed. Still no bytes. This matches what PR #2494 reported after exhausting their combinations.Suggested investigation paths
ARDUINO_USB_CDC_ON_BOOT=1withARDUINO_USB_MODE=1and connect to the OTG port (would mean enumerating as a different COM device).delay(2000)before the firstSerial.println(USB-Serial-JTAG sometimes drops bytes during host enumeration).Serial.begin(115200)is hit — there may be a fault insetup()that never reachesSerial.begin. A simple sketch (justSerial.println("hi")inloop()) would isolate this.Until host-side serial is restored, autoresearch can't drive the device even if fbuild gets fixed. Both issues block the perf-trace validation work.
Where this leaves the PR
The new PR introduces
fl::PerfTrace+ RPCs (setPerfTraceEnabled,getPerfTraceLog) + aci/perf_trace_sweep.pydriver script. Host-side unit tests pass (10/10). The autoresearch sweep is wired but cannot be empirically run on this dev env until at least one of the two issues above is resolved.🤖 Filed via Claude Code.
zackees commentedon May 24, 2026
fbuild investigation — partial findings
Dug into the fbuild code path. Confirmed observations + open questions below. Posting here because the actual fix point is still ambiguous and warrants a maintainer's eyes before touching the local working tree (which has 8 unrelated modified files in your fbuild clone).
Confirmed: relevant code is in
crates/fbuild-packages/src/library/esp32_framework/sdk_paths.rs:54-121—Esp32Framework::get_sdk_include_dirs(mcu, memory_type)<framework>/tools/esp32-arduino-libs/<mcu>/flags/includes(the-iwithprefixbeforelist shipped by arduino-esp32 ≥3.3.7).<sdk>/include/4 levels deep.["esp32", "esp32s2", "esp32s3"]loop for Xtensa port headers and no RISC-V equivalent. So if the flags file is missing for a RISC-V chip (esp32c*, esp32h*, esp32p*) the chip-specific port includes are silently dropped.parsing.rs:55-91—parse_include_flags. Takes the file content, splits, and for each-iwithprefixbefore RELATIVE/PATHresolves toinclude_base.join(relative)whereinclude_base = <sdk>/include/. Pushes onto the dir list if it exists.What I verified
The flags/includes file for esp32p4 DOES exist on disk and DOES contain
soc/esp32p4/includeas a relative entry:The header file path is:
parse_include_flagsshould resolve that entry to.../tools/esp32-arduino-libs/esp32p4/include/soc/esp32p4/include/, which makes#include "soc/soc_caps.h"work.So the primary path should work for esp32p4. The error must mean one of:
parse_include_flagsis dropping the entry (maybe<resolved>.exists()check fails due to a path-separator issue on Windows?)get_sdk_include_dirs()are computed for framework-lib compilation but NOT being passed to sketch/project-as-library compilationesp32p4that bypassesget_sdk_include_dirs()entirelyI'd start by adding
eprintln!tracing insideparse_include_flagsandget_sdk_include_dirsand re-runningbash compile esp32p4 --examples AutoResearch --no-filterto see which dirs actually make it onto the compile command for the failing TU.For the
WString.hfailureThat's a different root cause —
cores/esp32/is not part of the SDK include tree, it's the Arduino core itself.crates/fbuild-build/src/esp32/orchestrator/build.rs:247addscore_dironce. Need to checkframework_libs.rsto see whether it's threaded through when compilingHEXBuilder.cpp. The fact that PIO compiles it successfully suggests PIO addscores/esp32/to every framework-lib compile and fbuild may be adding it only at sketch-compile time.Likely (but unverified) fix sketch
In
sdk_paths.rs:102-109, parallel the Xtensa loop with RISC-V chip paths — even though the flags file should cover esp32p4 already, the explicit safety net never hurts and protects the 2.x fallback:But the primary fix likely lives somewhere else — most likely the orchestrator forgets to use these dirs when compiling the sketch/project-as-library. Worth tracing the actual
-I…arguments fbuild emits for the failing TU to confirm.Status
Once the fbuild fix lands and a new release ships, the FastLED-side bump is a 1-line change (mirroring 7ae55c0 / adab3f8). Re-running
bash autoresearch esp32p4 --parlio+uv run ci/perf_trace_sweep.py --port COM25 --lanes 12 --strip-size 256will close out the validation.🤖 Filed via Claude Code.
ci(perf-trace): add flash-based PerfTraceBench sketch + host decoder
zackees commentedon May 24, 2026
Update: hardware sweep unblocked via flash-dump workaround (PR #2508)
Was able to capture per-frame PARLIO trace data without resolving either blocker by adapting PR #2494's ParlioBench pattern:
examples/PerfTraceBench/PerfTraceBench.inoflushesfl::PerfTraceevents to a flash data partition once per run.ci/perf_trace_decode.pyparses the dump back on the host.esptool read-flashworks fine (it's USB-Serial-JTAG output that's broken, not the ROM-loader path).Doesn't unblock fbuild or serial. Both still need to be fixed for
bash autoresearch esp32p4to function as intended. But it does let us answer the original "is #2493 fixed?" question (it's not — 755 ms per frame in the manager's flush wait, full per-PR-#2508 comment for details).Posting because someone looking at this issue might want the workaround. The flash-dump path is intentionally minimal — not a replacement for autoresearch, just an escape hatch.
zackees commentedon May 24, 2026
Update: fbuild fix merged-pending; serial remains stuck
✅ fbuild side — fixed and PR'd
Root-caused both compile failures and shipped a fix:
FastLED/fbuild#273 —
fix(esp32): strip Windows UNC prefix + collect .S/.s assembly sourcesTwo bugs:
Path::canonicalize()on Windows returns\?\C:\…. The response-file writer rewrites all backslashes to forward slashes so gcc doesn't see them as escapes, producing-I//?/C:/…. Most headers resolve, but chip-specific SoC headers likesoc/soc_caps.hdon't — esp32p4 was the only chip where this surfaced because its include paths nest two levels deeper than esp32/s2/s3. Fixed by stripping the\?\prefix incanonicalize_existing_pathbefore it ever reaches the response-file writer.library_info::is_source_fileonly matched.c/.cpp/.cc/.cxx, silently dropping.Sassembly files from project archives. FastLED'sgpio_isr_rx/fast_isr.S(definesgpio_fast_edge_isr) was lost →undefined referenceat link.Local fbuild build of the patch +
bash compile esp32p4 --examples AutoResearch --no-filternow succeeds end-to-end (1.7 MB firmware.bin in 100 s).After the fbuild fix,
bash compile esp32p4 --examples AutoResearch --no-filterworks, butbash autoresearch esp32p4 --parlio --skip-lintstill fails because the fbuild daemon compilesexamples/Sailboat(the platformio.ini defaultsrc_dir) instead ofexamples/AutoResearch. The autoresearch front-end setsPLATFORMIO_SRC_DIR=examples/AutoResearchinos.environ, but the change does not propagate to the long-lived daemon (which inherits its env from whoever spawned it first).Separate bug, separate fix: either pass
src_dirthrough the daemon protocol, or restart the daemon on every autoresearch invocation. Worth filing as its own issue.❌ USB-Serial-JTAG output remains silent post-boot
Tried, all on COM25 (VID 0x303A PID 0x1001):
ARDUINO_USB_MODE=0alone — silent.ARDUINO_USB_MODE=0 + ARDUINO_USB_CDC_ON_BOOT=1— silent.ARDUINO_USB_MODE=1 + ARDUINO_USB_CDC_ON_BOOT=1— silent (also no new COM port enumerates for the OTG side; the dev board only has one USB cable connected, to the JTAG bridge).delay(5000)before the firstSerial.println(...).flush()— silent.dtr=None, rts=None) — silent.ROM bootloader output IS visible, so the host-side path is alive — it's specifically the post-app-boot CDC stream. Matches PR #2494's experience. Likely a board/driver-level config issue this dev environment doesn't expose to user-space.
What works as a workaround
examples/PerfTraceBench/PerfTraceBench.ino(added on the perf-trace branch) flushes thefl::PerfTracelog to a flash data partition andci/perf_trace_decode.pyreads it back viaesptool read-flash. No serial needed. This is what produced the empirical data on PR #2508 showing the PARLIO blocking issue is not fully fixed by #2503.Status checklist
pyproject.tomlbumped to new fbuild versionbash autoresearchenv-var propagation to the daemon🤖 Filed via Claude Code.
fix(esp32p4): enable ARDUINO_USB_CDC_ON_BOOT + delay → 19× faster show()
zackees commentedon May 31, 2026
Closing as stale. fbuild has been bumped 2.2.5 → 2.2.11 (commits adab3f8, dc586bf, 84633f6, d11bcd9), addressing the include-path normalization and zccache stability issues from the original report. Please reopen with a fresh repro if the failure recurs on current master.