Skip to content

esp32c6 parlio: parlioStreamValidate(16 lanes × 256 LEDs) hangs the chip and takes USB-Serial/JTAG down with it #2667

Closed

Description

@zackees

Symptom

On ESP32-C6FH4 (USB-Serial/JTAG only, COM port enumerated), running the default-payload parlioStreamValidate RPC {numLanes: 16, numLeds: 256, iterations: 10, timeoutMs: 250} hangs the chip within milliseconds of the call. Only the first FL_WARN line from FastLED.add(cfg) reaches the host before the USB-CDC pipe stops responding and the chip drops off the USB bus entirely. Recovery requires a physical power-cycle — esptool --after hard-reset cannot reach the chip while it's off the bus, and fbuild reset fails with 'failed to open COM9' for the same reason.

This is reproducible with the silenced build (FASTLED_DISABLE_DBG=1, see commits on fix-esp32c6-parlio) — i.e. the host-side ClearCommError / PermissionError is NOT the log-flood symptom in #2663. The chip really does wedge.

Sequence captured

ping: {'message': 'pong', 'success': True, 'uptimeMs': 16210, 'timestamp': 16210}

--- parlioStreamValidate(16x256, 10 iter, 250ms timeout) ---
[RPC] Sending: {\"method\":\"parlioStreamValidate\",\"params\":[[{\"numLanes\":16,\"numLeds\":256,\"iterations\":10,\"timeoutMs\":250}]],\"id\":2}
  [async-serial] FastLED.cpp.hpp(620): WARN: FastLED.add(cfg): runtime-selection mode — enrolling every available driver via fl::enableAllDrivers(). For minimum binary size, prefer FastLED.addLeds<CHIPSET, PIN, ORDER,
[RPC] Exception during read_lines: Serial read error: ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22))
[RPC] Timeout: No response with ID 2 within 30.0s
parlioStreamValidate FAILED

The single FL_WARN line happens during the first FastLED.add(cfg) in validateParlioStreaming(). After that, the wedge occurs before any of the other 15 channels are added — or before FastLED.show() runs at all, depending on where exactly we are stalling.

What this likely means

Three plausible root causes — needs lane-sweep triangulation to discriminate:

  1. OOM during 16-lane channel setup. Each ChannelDriverPARLIOImpl carries a per-lane scratch buffer + state. With 16 lanes × 256 LEDs × 3 bytes per LED × any expansion factor, plus the 3-buffer ring (cap 256 KB by default per parlio_engine.h docs), DRAM pressure may exceed the 320 KB available on C6. The 'When cap exceeded, system uses streaming mode (~30 µs overhead per iteration)' comment in parlio_engine.h implies the engine should gracefully fall back, but maybe a sizing math bug makes it allocate before checking.

  2. Driver-init deadlock. enableAllDrivers() registers 5 drivers per add() call. With 16 lanes that's 80 calls; if any take a mutex that the parlio engine setup also takes, we could deadlock.

  3. Parlio peripheral mis-configuration that hangs the CPU on a peripheral access (e.g. clock not enabled, register write that blocks pending a signal that never arrives).

Why this isn't easy to recover from

ESP32-C6's USB-Serial/JTAG is INSIDE the chip — when the CPU wedges hard enough, the USB-JTAG controller stops responding to host-side resets too. esptool's normal usb_jtag_serial DTR/RTS sequence (which works fine when the chip is responsive) can't reach the chip once it's off the bus. The host literally cannot recover the device without physical intervention. This makes lane-sweep triangulation slow.

(This is a separate bug, tracked as: 'fbuild reset gap on ESP32-C6 USB-Serial/JTAG' — fbuild's own fbuild reset command exits with 'failed to open COM9' rather than attempting the in-USB-JTAG CHIP_EN sequence that might preempt the wedge before it becomes terminal.)

What we still need to measure

  • Lane sweep: 1, 2, 4, 8, 12, 14, 15, 16 lanes at 256 LEDs each — find the smallest lane count that wedges.
  • LED-count sweep: 16 lanes × 32/64/128/192/256 — find the smallest per-lane count that wedges at 16 lanes.
  • Memory delta: snapshot esp_get_free_heap_size() before/after each add() to detect OOM before the wedge.

These reproduce too aggressively right now — every test wedges the device. Need a CPU-side guard (heap headroom check + early-fail with a clean RPC reply) before the engine can be safely benchmarked at the upper end.

Environment

Activity

  1. zackees commented on May 31, 2026

    @zackees
    MemberAuthor

    Lane sweep — narrows the failure to the 8→16-bit data-width transition

    Ran progressive parlioStreamValidate(N lanes × 256 LEDs, 5 iter) on the FH4:

    Lanes × LEDs total show (encode) wait (DMA TX) PARLIO width result
    1 × 256 9.2 ms 2.8 ms 6.4 ms 1-bit ✓
    2 × 256 12.1 ms 5.8 ms 6.2 ms 2-bit ✓
    4 × 256 12.5 ms 6.3 ms 6.2 ms 4-bit ✓
    8 × 256 15.7 ms 9.6 ms 6.1 ms 8-bit ✓
    12 × 256 — — — 16-bit (4 dummy) HANG
    16 × 256 — — — 16-bit HANG

    The cliff is between 8 lanes and 12 lanes — exactly where selectDataWidth() (channel_driver_parlio.h:247) jumps from 8-bit to 16-bit PARLIO. 1L/2L/4L/8L all stay within their tight power-of-2 width and work; the first 16-bit configuration (12 lanes with 4 dummy lanes) hangs.

    This is a much more specific failure than my original 'OOM at 16 lanes' hypothesis. It strongly implicates the 16-bit width path: either the 16-bit DMA-buffer math, the dummy-lane padding logic, or the 16-bit Wave8 transpose dispatch (BF1+pipe4 from #2559).

    Observations supporting the width-transition hypothesis

    1. The 12-lane case is less memory-pressured than 16 lanes in any rational sizing (fewer real lanes, fewer real bytes), but it still hangs. Pure OOM would expect 16 to hang worse than 12, not 'both hang' — 12 hanging at all means something about the 16-bit width path is broken regardless of how many real lanes are populated.
    2. The 8-lane case runs cleanly with encode (9.6 ms) > TX (6.1 ms), meaning the chunked-streaming ring buffer math is correct in the 8-bit path. Whatever breaks at 16-bit is not a generic streaming bug.
    3. The 12-lane hang is a softer failure than 16-lane: the chip stays on the USB bus (COM port enumerates) and the bootloader still responds — but the CDC pipe is half-dead (Windows reports 'device attached but not functioning', PermissionError(13)). The 16-lane case drops the device off the bus entirely. This suggests 16-lane corrupts memory worse / hits the watchdog harder than 12-lane.

    Pure-encode timing (decoupled from hardware)

    The 1L→8L progression also gives us a clean encode-cost model:

    • 1L encode = 2.84 ms (baseline)
    • 2L encode = 5.83 ms (+2.99 ms)
    • 4L encode = 6.33 ms (+0.50 ms)
    • 8L encode = 9.57 ms (+3.24 ms)

    Linear extrapolation to 16L 8-bit-equivalent would be ~16 ms, well within the encode-vs-TX budget. The hang is not because the CPU can't keep up — it's because the 16-bit code path is broken.

    Suggested next steps (for the design-out-the-fix work)

    1. Audit populateDmaBuffer / populateDmaBufferSpi for 16-bit-specific assumptions. Anything that assumes dataWidth ≤ 8 or dummy_lanes == 0 is suspect.
    2. Check wave8Transpose_16x4_bf1_pipe4 (introduced in perf(parlio): #2548 BF1 — chipset-aware direct encode (5.5× vs baseline, 4.4× faster than TX) #2559) — it was originally validated with all-16-real-lane patterns; 12-real + 4-dummy may be untested.
    3. Add a heap-headroom + capacity check in ParlioEngine::initialize() so the engine fails the RPC cleanly instead of wedging the CPU. Once esp32c6 parlio: parlioStreamValidate(16 lanes × 256 LEDs) hangs the chip and takes USB-Serial/JTAG down with it #2667 is fixed in the firmware, the chip would never enter the unrecoverable state described in the parent issue.

    Sweep script for repro: scratch-issues/parlio_lane_sweep.py on branch fix-esp32c6-parlio.

  2. zackees commented on May 31, 2026

    @zackees
    MemberAuthor

    Code path narrowing — 16-bit Wave8 dispatch + ring buffer math

    Walking the relevant code on fix-esp32c6-parlio:

    Buffer sizing (parlio_buffer_calc.h:88): For mDataWidth == 16, outputBytesPerInputByte() = 128. A 256-LED frame at 16-bit width therefore produces 256 × 3 × 128 = 98304 DMA bytes per frame. With FASTLED_PARLIO_MAX_RING_BUFFER_TOTAL_BYTES = 256 KB and perBufferCap = 256/3 ≈ 87 KB, the full frame (96 KB) does NOT fit one buffer — calculateRingBufferCapacity() falls into the streaming path: 86 LEDs/buffer × 3 × 128 ≈ 33 KB per ring buffer × 3 = ~99 KB total.

    That math itself looks fine.

    Allocation path (parlio_engine.cpp.hpp:1523): initialize() calls calculateRingBufferCapacity first with the PSRAM cap (1 MB), gets back ~99 KB per buffer, then allocateRingBuffers() requests 99 KB × 3 = 297 KB of DMA-capable memory. ESP32-C6 has no PSRAM, so this allocation hits internal SRAM. The C6 has ~320 KB of DIRAM; allocating 297 KB out of it after FreeRTOS heap fragmentation is very unlikely to succeed — it almost certainly fails. The fallback path then retries with the SRAM cap (~33 KB × 3 = 99 KB) which is more realistic.

    The PSRAM-first-on-no-PSRAM-chip pattern wastes one allocation attempt and fragments the heap before the real (smaller) attempt runs. This is plausibly the difference between '8 lanes works' (8-bit width — small enough buffers that even the PSRAM-cap path fits) and '12/16 lanes hang' (16-bit width — large enough that the first attempt is doomed). When the fragmented heap then also can't satisfy the smaller retry, ring buffer allocation fails — but the engine has already set mPeripheral and may have configured DMA channels, so we end up with a partially-initialized engine that subsequent code paths assume is ready.

    16-lane Wave8 dispatch (parlio_engine.cpp.hpp:992-1037): the wave8Transpose_16x4_bf1_pipe4 fast path (4-position pipelined) is taken when byteOffset + 3 < byteCount && outputIdx + 4 * blockSize <= outputBufferCapacity. For 256 LEDs × 3 bytes (768 byte positions), this is hit on every step except the last 3. The fallback (wave8Transpose_16_bf1) is reached when byteOffset >= byteCount - 3. Both paths build lanes_[a|b|c|d][16] with dummy lanes zeroed. The short-circuit active ? base[...] : 0 prevents out-of-bounds reads on dummy lanes — that's correct.

    Per-add re-initialization: FastLED.add() in runtime-selection mode goes through enableAllDrivers() + addDriver() for every lane. If the PARLIO engine is re-initialized per add (which enableAllDrivers may trigger via ChannelDriverPARLIOImpl::add), each of the 12-16 add calls re-runs the PSRAM-first-then-SRAM-fallback allocation flow → 12-16× heap fragmentation cycles on a 320 KB DIRAM budget. By call 12 of 16 the heap may be too fragmented to satisfy any DMA-capable allocation.

    Concrete fix design (proposed for this branch)

    Three independent patches, in priority order:

    1. Skip the PSRAM-first attempt on chips with no PSRAM (highest impact)

    In ParlioEngine::initialize() (line 1523), gate the PSRAM-cap path on esp_psram_get_size() > 0 (or BOARD_HAS_PSRAM macro). For ESP32-C6/H2/C5 etc. without PSRAM, go straight to the SRAM cap. Cost: ~20 LOC, no runtime overhead, eliminates the largest fragmentation cycle.

    2. Heap-headroom pre-check, fail-fast RPC instead of wedge

    Before allocateRingBuffers(), query heap_caps_get_largest_free_block(MALLOC_CAP_DMA). If the largest free DMA block < mRingBufferCapacity, return false from initialize() with a clear error. The validateParlioStreaming RPC handler can then return a {ok: false, error: "insufficient DMA heap"} response before the chip wedges, leaving USB-CDC alive for the next iteration.

    3. Re-initialization guard

    If mInitialized && mDataWidth == dataWidth && mActualChannels == channelCount && ... , skip re-running allocateRingBuffers(). Eliminates the multi-add fragmentation cycle entirely. Cost: ~30 LOC, requires careful invariant analysis to avoid stale config.

    Defensive (won't fix root cause but prevents bricking)

    • Add esp_task_wdt_reset() in populateDmaBuffer's outer loop for 16-bit width (in case the encode itself is what hangs)
    • File arduino-esp32 issue: USB-Serial/JTAG re-enumeration after panic doesn't survive on C6

    I'll prototype (1) + (2) on fix-esp32c6-parlio next iteration. (3) is bigger surgery and worth its own design pass.

  3. zackees commented on Jun 1, 2026

    @zackees
    MemberAuthor

    Reproduced again from C:\Users\niteris\dev\fastled7 on 2026-06-01 with the ESP32-C6FH4 on COM9.

    Additional observations from this run:

    • fbuild was bypassed for the reproducer because fbuild has a separate ESP32-C6 flash/deploy issue now tracked in fix: honor ESP32-C6 4MB flash size and avoid deploy hang fbuild#357.
    • PlatformIO fallback built and flashed successfully; esptool image-info .pio\build\esp32c6\firmware.bin reported Flash size: 4MB.
    • The same firmware successfully handled JSON-RPC over COM9 and passed the SIMD RPC path first: testSimd returned 85/85 passed and testSimdBenchmark returned success.
    • The general AutoResearch path --parlio --lanes 16 --strip-sizes 256 did not exercise the driver because runSingleTest rejected it with LaneSizeTooLarge (max_leds_per_lane = rx_buffer.size() / 32).
    • Direct RPC call reproduced the hard failure:
    CALL parlioStreamValidate {'numLanes': 16, 'numLeds': 256, 'iterations': 5, 'timeoutMs': 200}
    [RPC] Sending: {method:parlioStreamValidate,params:[{numLanes:16,numLeds:256,iterations:5,timeoutMs:200}],id:2}
    [async-serial] src/fl/remote/remote.cpp.hpp(151): Stored request ID for parlioStreamValidate (id=2)
    [async-serial] src/FastLED.cpp.hpp(620): WARN: FastLED.add(cfg): runtime-selection mode ...
    [async-serial] src/fl/channels/manager.cpp.hpp(74): ChannelManager::addDriver() ... repeated
    [RPC] Exception during read_lines: Serial read error: ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22))
    [RPC] Timeout: No response with ID 2 within 30.0s
    

    After that COM9 disappeared from python -m serial.tools.list_ports -v and did not re-enumerate after an additional 60 second poll. No local fbuild/zccache/compiler/serial helper processes were holding the port. pnputil /scan-devices could not be used from this shell because it requires elevation.

    One extra suspect from this run: immediately before the direct RPC, AutoResearch pin discovery had auto-applied TX=0/RX=1. parlioStreamValidate currently uses mState->pin_tx as its base pin, so this likely attempted PARLIO lanes GPIO 0..15. That includes constrained/strap pins on ESP32-C6 and could be contributing to the post-watchdog USB disappearance. The RPC probably needs an explicit baseTxPin override and/or safe preflight validation before it is used for destructive lane sweeps.

  4. zackees commented on Jun 1, 2026

    @zackees
    MemberAuthor

    Current research report: C6 16-lane PARLIO feasibility and next proof point

    This is the current state after re-checking the driver, the C6 docs, and the available hardware evidence.

    What is proven by hardware so far

    The lane sweep already posted above is still the best live evidence:

    lanes x LEDs PARLIO width result
    1 x 256 1-bit pass
    2 x 256 2-bit pass
    4 x 256 4-bit pass
    8 x 256 8-bit pass
    12 x 256 16-bit, 4 dummy lanes hang
    16 x 256 16-bit hard hang / USB-Serial-JTAG disappears

    That still points to the 8-bit -> 16-bit PARLIO-width transition more than to a generic streaming failure. The C6 is currently not back on USB after the hard 16-lane crash, so I could not run a new live sweep with the improved RPC fields in this iteration. Current ports are COM1/COM3/COM4/COM22; COM22 is the ESP32-S3, not the C6.

    ESP32-C6 PSRAM answer

    PSRAM fallback is not a viable fallback for the ESP32-C6 target we are debugging.

    Authoritative Espressif docs:

    Conclusion: if the fix depends on pre-encoding 16-lane frames into PSRAM, it is a P4-class strategy, not a C6 strategy. For C6 we should assume internal SRAM only.

    CPU / SIMD answer

    ESP32-C6 has a single HP 32-bit RISC-V CPU up to 160 MHz and 512 KB HP SRAM in the Espressif datasheet: https://documentation.espressif.com/esp32-c6_datasheet_en.html?q=ESP32-C6

    FastLED's local RISC-V SIMD layer does not give C6 vector acceleration. src/platforms/esp/32/simd_riscv.hpp explicitly uses scalar fallback for ESP32 RISC-V variants, with FASTLED_ESP32_RISCV_HAS_RVV 0; only ESP32-P4 has the optional PIE path when built with __riscv_xesppie. The earlier testSimd RPC passing 85/85 proves the API path is correct, not that C6 has SIMD hardware acceleration.

    The 16-lane hot path is therefore scalar on C6. The useful optimization work is the BF1/pipe4 transpose path, not SIMD.

    Is the crash proven to be a stream-chunk timeout?

    No. The current evidence does not prove that the C6 hangs because the hardware timed out waiting for a large stream chunk.

    For 16 lanes x 256 LEDs, the per-lane source byte count is 768. In Wave8 16-bit mode, each source byte position expands to 128 DMA bytes. Full pixel data is therefore:

    768 source byte positions x 128 DMA bytes = 98,304 DMA bytes
    

    With 16-bit Wave8 back padding and reset padding, the full frame is about 98.7 KB before the 128-byte safety margin. Under the PSRAM cap, that produces roughly a 98.8 KB buffer and would try to allocate three such DMA buffers, about 296 KB total. On a no-PSRAM C6, that is too aggressive for internal DMA memory.

    Under the SRAM cap path, each ring buffer is about 33.6 KB. calculateBufferByteCount() then pre-populates three buffers before the first hardware transmit:

    buffer 0: 255 byte positions
    buffer 1: 255 byte positions
    buffer 2: 257 byte positions
    sum:      767 / 768 byte positions
    

    So the 16 x 256 case is not waiting on the ISR to compute a large missing stream segment. It has almost the whole frame encoded before TX starts. The only remaining byte position goes through the callback/refill path. That makes a pure "C6 CPU cannot compute the next stream chunk in time" explanation weak for this exact reproducer.

    A larger LED count could still underrun if encoding cannot keep up, but 16 x 256 should be dominated by one of these instead:

    1. 16-bit PARLIO peripheral / pin / valid-bit interaction.
    2. 16-bit DMA buffer sizing or allocation failure behavior.
    3. Bad pin sweep: the previous hard crash likely used base TX pin 0, so the test may have touched GPIO 0..15, including constrained/strap pins.
    4. A 16-bit BF1/pipe4 path issue not seen by host bit-exact tests.

    Detection added locally

    I added a low-overhead underrun counter to the local worktree. It increments exactly when txDoneCallback() sees:

    ringCount == 0 && bytesTransmitted < totalBytes
    

    That is the event we actually care about: the PARLIO hardware drained the available ring while source bytes remained. The counter is exposed through ParlioDebugMetrics and returned by parlioStreamValidate as:

    underrunCount, txDoneCount, workerIsrCount, ringCount,
    bytesTotal, bytesTransmitted, ringError, hardwareIdle
    

    The RPC now also accepts baseTxPin, so the next C6 run can avoid GPIO 0..15 and test known-safe lanes explicitly.

    Validation of the instrumentation:

    uv run pytest ci\tests\test_autoresearch_phases.py        # 42 passed
    uv run python ci\lint_cpp\logging_in_iram_checker.py      # no violations
    pio run -e esp32c6 with AutoResearch as src                 # success
    uv run python test.py --unit --quick --no-interactive wave8 # passed
    

    No logging was added to ISR/hot paths.

    Strategy matrix

    1. Skip PSRAM-cap allocation on no-PSRAM chips.
      C6 should not first try the PSRAM-sized ring buffer path. Gate that on real PSRAM presence, e.g. esp_psram_get_size() > 0, so C6 goes directly to the SRAM cap. This reduces failed huge DMA allocation attempts and heap fragmentation.

    2. Fail fast on DMA heap headroom.
      Before allocating three ring buffers, check largest DMA-capable free block against the requested per-buffer size. If insufficient, return a clean initialization/RPC error instead of entering a partially initialized state.

    3. Use the new underrun metrics to classify the crash.
      Next live run should call something like:

    parlioStreamValidate({baseTxPin:<known-safe-base>, numLanes:8,  numLeds:256, iterations:5, timeoutMs:200})
    parlioStreamValidate({baseTxPin:<known-safe-base>, numLanes:12, numLeds:256, iterations:1, timeoutMs:200})
    parlioStreamValidate({baseTxPin:<known-safe-base>, numLanes:16, numLeds:256, iterations:1, timeoutMs:200})
    

    If underrunCount > 0, then CPU/refill latency is real and we can optimize around the transpose/refill budget. If underrunCount == 0 or the board hard-resets before any response, the failure is earlier/lower: allocation, pin/peripheral configuration, IDF PARLIO 16-bit behavior, or a memory stomp.

    1. CPU-assist/blocking mode.
      The driver already has partial CPU assist: beginTransmission() pre-populates the ring on the caller thread before first TX, and poll() refills from the caller/main-thread side while TX is active. A stricter blocking mode could pre-encode the full frame before TX only when the full frame fits available DMA memory. For C6 16 x 256, full pre-encode needs about 99 KB for one DMA buffer plus driver/peripheral overhead; possible in theory, but not robust for larger frames and not PSRAM-backed on C6.

    2. Optimize scalar transpose only if underrun is proven.
      The current 16-lane path already uses BF1 and wave8Transpose_16x4_bf1_pipe4. Because C6 has no RVV/PIE acceleration, more optimization would be scalar loop/layout work. It is not the first lever until the underrun counter says refill latency is the actual failure mode.

    3. Fallback if 16-bit mode remains unstable.
      Disable 16-bit PARLIO on C6 and split 9-16 lanes into two 8-bit passes in the same frame. The known 8 x 256 measurement is about 15.7 ms total, so two passes are likely around 31 ms before any reuse/overlap optimization. That is slower, but it uses the width that is already proven to work on this board.

    Current conclusion

    Do not treat this as proven CPU starvation yet. The strongest current hypothesis is still "C6 16-bit PARLIO path is unsafe," with allocation/pin/peripheral behavior ahead of raw compute as likely causes. PSRAM pre-encode is not a C6 fallback. The next decisive experiment is the same lane sweep using a safe baseTxPin and the new underrunCount metrics.

  5. zackees commented on Jun 1, 2026

    @zackees
    MemberAuthor

    Follow-up after the report above: I also patched the local worktree with the first mitigation from the strategy matrix.

    Changes now in the local branch:

    • ParlioEngine checks whether a DMA-capable PSRAM heap exists before using the PSRAM-sized ring-buffer cap.
    • On no-PSRAM chips such as ESP32-C6, clockless and SPI-over-PARLIO initialization go directly to the SRAM cap instead of first attempting the much larger PSRAM-cap allocation.
    • allocateRingBuffers() now fail-fasts on no-PSRAM chips if the internal DMA heap cannot satisfy three aligned ring buffers, avoiding partial allocation/retry churn.
    • The earlier parlioStreamValidate RPC changes remain in place: explicit baseTxPin plus underrunCount, ISR counts, ring/error state, and byte counts.

    Validation after this mitigation:

    uv run python ci\lint_cpp\logging_in_iram_checker.py      # no violations
    uv run pytest ci\tests\test_autoresearch_phases.py        # 42 passed
    pio run -e esp32c6 with AutoResearch as src                 # success
    

    Still not hardware-validated on C6 because the C6 board has not re-enumerated after the prior hard crash. Next physical run should use a known-safe baseTxPin and inspect underrunCount to decide whether the remaining 16-bit failure is compute/refill pressure or an earlier 16-bit allocation/peripheral/pin failure.

  6. zackees commented on Jun 1, 2026

    @zackees
    MemberAuthor

    Updated C6 hardware pass after #2669 merged and local AutoResearch instrumentation was rebuilt/flashed to the ESP32-C6FH4 on COM9.

    What changed in this pass

    • fix(esp32c6): route Serial to HWCDC + non-blocking writes (#2665) #2669 is merged, so C6 Serial now routes through HWCDC with ARDUINO_USB_CDC_ON_BOOT=1 and non-blocking CDC writes.
    • I rebuilt AutoResearch locally with the PARLIO debug counters (txDoneCount, workerIsrCount, underrunCount, bytesTotal, bytesTransmitted, hardwareIdle, ringError).
    • I added an AutoResearch-only txPins:[...] override for parlioStreamValidate so we can test 16 lanes on the C6 DevKit without driving GPIO12/GPIO13, which are the native USB data pins on this board.

    Espressif's ESP32-C6-DevKitC-1 docs list GPIO13 as USB_D+ and GPIO12 as USB_D-, and the header table has no GPIO14 entry: https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/user_guide.html#header-block

    Results

    Encode benchmark on C6 confirms the no-PSRAM path:

    parlioEncodeBenchmark(iterations=2000)
    scratchPsramOk=false outputPsramOk=false
    perpos_ss_us=10413 frame_ss_us=3998
    PSRAM variants all 0 because PSRAM allocation is unavailable
    

    PARLIO stream sweep, 256 LEDs/lane, 5 iterations unless noted:

    test pins completed steadyAvgUs bytes underruns txDone workerIsr hardwareIdle notes
    safe_1 [16] true 9764 768/768 0 1 0 false clean
    safe_2 [16,17] true 12356 768/768 0 1 0 false clean
    safe_4 [16,17,18,19] true 12828 768/768 0 1 0 false clean
    safe_8 [16..23] true 16364 768/768 0 1 0 false clean
    safe_12 [0..11] true 21328 514/768 1 4 1 true timed completion but incomplete TX
    safe_16 [0..11,15,16,17,18] true 24476 514/768 1 4 1 true timed completion but incomplete TX
    contig_12_base0 [0..11] true 21310 514/768 1 4 1 true same as safe_12
    contig_16_base0 [0..15] no RPC response n/a n/a n/a n/a n/a n/a COM9 disappeared afterward

    Important interpretation: completed=true currently only means show()+wait() returned before the timeout. For 12 and 16 lanes, the debug metrics show the transfer is not actually complete: bytesTransmitted=514 while bytesTotal=768, underrunCount=1, and hardwareIdle=true. So the 12/16-lane path is still broken even when avoiding USB pins; it is failing as an underrun / early-idle condition rather than a host-visible hang.

    The legacy contiguous baseTxPin=0,numLanes=16 failure is probably a second, board-specific problem: it drives GPIO12/GPIO13, which are the same native USB pins used by COM9, and also requests GPIO14, which is not on the DevKitC header table. After that test, Windows no longer enumerated COM9; only the S3 on COM22 remained. A physical reset/replug is needed before more C6 RPC runs.

    Current takeaways

    1. The old 16-lane contiguous reproduction is not a clean engine test on ESP32-C6-DevKitC-1 because the pin map conflicts with native USB.
    2. A clean 16-lane test using explicit non-contiguous pins still exposes a real engine bug: the PARLIO hardware goes idle at 514/768 source bytes with one underrun.
    3. 1/2/4/8 lanes are clean on the safe C6 pin maps: no underrun, no ring error, all bytes transmitted.
    4. parlioStreamValidate should treat bytesTransmitted != bytesTotal, underrunCount > 0, or hardwareIdle=true as failure, not just wall-clock timeout.
    5. The next fix should focus on why the ISR refill/ring path starves at 12+ lanes after byte 514 on no-PSRAM C6, while also preventing AutoResearch/default pin selection from choosing GPIO12/13 for USB-JTAG boards.
  7. zackees commented on Jun 2, 2026

    @zackees
    MemberAuthor

    Resolved by the C6 PARLIO fixes that landed in #2681 and #2682, with follow-up hardware validation on the ESP32-C6FH4.

    Verified on COM9 after the fixes:

    • Legacy/default-pin repro payload {numLanes:16,numLeds:256,iterations:10,timeoutMs:250} now returns a clean RPC response with channelsOk=false instead of wedging the chip, because the unsafe C6 USB pin map is rejected before PARLIO setup. Follow-up ping succeeded and COM9 stayed enumerated.
    • Safe explicit 16-lane payload using txPins:[0,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17], numLanes=16, numLeds=256, iterations=10, timeoutMs=250 returned success=true, completed=true, failedIter=-1, bytesTotal=768, bytesTransmitted=768, ringError=false, hardwareIdle=false. Follow-up ping succeeded.
    • A prior full lane sweep over RPC also passed lane counts 1 through 16 at 256 LEDs/lane without reflashing, with post-test ping succeeding after every lane count.

    Closing this as the hard C6 PARLIO crash / USB drop is no longer reproducible with the guarded default path or the safe explicit 16-lane path.

  8. moved this from Triage to Done in FastLED Trackeron Jun 2, 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