You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ESP32-C6: RMT and PARLIO clockless TX not captured on loopback bench — UART/SPI pass on the same jumper (#3576 Phase 7) #3586
An in-firmware GPIO_IN poll on the jumpered pad during TX sees 269 edges — the wire is toggling; the RMT capture still records nothing.
timing=WS2811-400 (2× slower pulses) also fails → not a marginal pulse-width filter issue.
Open questions
Why does show() take ~22 ms (PARLIO) / ~170 ms (RMT) per 300 µs frame? Both smell like waits timing out — yet PARLIO's txDone metric increments.
Why does the RMT-RX capture see UART/SPI waveforms but not RMT/PARLIO ones on the same pins? (Possible interaction: RMT group interrupt sharing when RMT TX and RX run together — but that doesn't explain PARLIO.)
parlioStreamValidate RPC ignores its params (always 16 lanes) and its pin pool yields only 12 valid pins → channelsOk:false; needs fixing before C6 lane-sweeps can use it.
Bench context
C6 serial is USB-Serial-JTAG; response truncation at the 64-byte FIFO was fixed by Serial.setTxTimeoutMs(100) once a host attaches (shipping separately).
parlioMetrics RPC (engine debug counters) shipping separately — used for the evidence above.
Scope update from the Phase 9 audit: the "transmits but capture sees zero edges" family now spans C6 PARLIO, P4 PARLIO, and S3 SPI (all arm the RMT-RX capture successfully post-#3592 and record 0 edges while UART/RMT on the same jumpers are byte-exact). Common thread to investigate: waveform rate/geometry produced by these TX paths vs the RMT-RX min-pulse filter, or pin-matrix output-enable timing on their init paths.
Forensic addendum — PR #3593 merged (derived wave8 clock + edge-probe tooling). Root cause narrowed but still open.
Established with the new in-firmware edge probe (62 ns class resolution)
PARLIO's waveform IS on the wire and healthy. Old clock: 1.0 µs bit period (T1H 643/T1L 356 ns — the hardcoded 8 MHz, 25% fast; now derived → fixed). UART reference capture: perfect 1.25 µs cadence.
BIT_BANG captures 256 raw edges on the same RX arm → the receiver is not deaf to fast-starting TX in general.
Raw IDF parlio_new_tx_unit+transmit (via the new parlioRawTest RPC) works in every config permutation the engine uses (width 1/2 + dummy -1 lane, queue_nonblocking, mts=65534, dma_burst=64, depth 3/8) — sustained bursts captured every run.
Engine-side snapshots during its own transmit: bit_count/payload/clk-divider/pin-routing/OEN/pulls all correct and equal to the raw-working case.
RMT-RX register snapshots taken AT the trigger instant (waveform provably live): INT_RAW/CH2STATUS/CH3STATUS/CH2_RX_CONF1 identical between the working UART capture and the deaf PARLIO capture.
Sequence quirk: UART→PARLIO→UART leaves the third test failing, while PARLIO→UART passes — some cross-test state interaction in the engines/harness.
Something in the rmt_rx_channel_5 software path drops symbols/never sees callbacks specifically when the PARLIO/RMT-TX engines ran in-process (interrupt priority/allocation interplay?).
A GPIO-matrix input-stage interaction invisible to the peeked registers.
Next tools if picked up again: rmt ISR-level counters (increment volatile globals in rxDoneCallback to see whether the ISR fires at all during a PARLIO frame); trigger-time INT_RAW polling loop instead of one-shot reads (ISR clears INT_RAW immediately, one-shot reads are blind).
New portability landmines documented in the tooling: rdcycle = illegal instruction on Espressif RISC-V cores (esp_cpu_get_cycle_count() instead); classic GPIO.in is a bare u32; LED frames complete within one FreeRTOS tick (burst-poll triggers required).
The C6 receiver does NOT time out — it completes "naturally" with exactly one symbol: H 772,875 ns (the entire frame duration as one merged HIGH, terminated by idle). Meanwhile the TX pad (pin 1) demonstrably carries a crisp, now timing-correct waveform (edge-probe: H720/L310 ns wave8 at the derived 6.53 MHz clock; UART reference captures with perfect 1.25 µs cadence on the same probe).
Timeline instrumentation confirms each capture arms ~2.4 ms BEFORE its transmit — no arm race.
Everything on the RX config side is verified identical between working (UART, 240 symbols) and broken (PARLIO/RMT-TX, 1 merged symbol) captures: CH2 filter = 8 APB ticks (100 ns), divider = 2 (40 MHz), idle threshold, input mux routing (FUNC71 ← GPIO0), pad IE/pulls/drive (20 mA default).
Interpretation
The RMT input stage sees the frame's envelope with ALL low gaps (~310–360 ns) swallowed — for exactly the drivers whose waveforms have the tightest low gaps. Since every digital register checks out, the remaining suspects are electrical/board-level: the pin1→jumper→pin0 path degrading fast low pulses below pin 0's input threshold (the working UART/BIT_BANG waves have ≥460 ns gaps), or an RMT-input-stage sampling subtlety not visible in registers. Pin-0 in-firmware probing self-interferes (the probe artifacts its own 21.5 kHz pattern), so this needs a scope on pin 0 — one minute of oscilloscope time resolves it.
Suggested software mitigation to try regardless
Wave-encoder option to guarantee minimum low-gap width ≥ ~500 ns on capture-validated chips (stretch T3), or bench-only: slow the PARLIO validation chipset timing so gaps clear the degradation. Also: parlioMetrics, edgeProbe/edgeProbeRead, parlioRawTest, and the new g_rmtrx_* telemetry make the whole investigation reproducible in minutes.
Model-killing datapoint (PR #3595 merged): with the derived clock, WS2811-400 timing gives PARLIO 625 ns low gaps — still merged into a single envelope symbol — while UART's 490 ns gaps on the same jumper capture perfectly. No low-pass/electrical model survives that: the capture deafness follows the TX DRIVER, not the waveform. Combined with byte-identical RX state at waveform-live instants (input mux, filter, divider, idle threshold — all verified at trigger time), the remaining hypothesis space: (a) something these drivers' software does to the receive between arm and idle-completion (the merged symbol spans exactly frame-start→frame-end, so the receiver DOES see the boundary edges); (b) an RMT input-sampling interaction triggered by PARLIO/RMT-TX peripheral activity invisible to the peeked registers. Next steps: scope on pin 0, or IDF-internals review of rmt rx channel state during concurrent PARLIO/RMT-TX activity. Full reproduction now takes minutes with the merged tooling (edgeProbe/parlioRawTest/parlioMetrics/g_rmtrx_* telemetry).
Final synthesis of this investigation round (PR #3596 merged): the paradox is now fully instrument-verified. Pin 0 — the receiver's own pad — carries the complete crisp PARLIO waveform (passive probe through the jumper: H893/L356 ns alternation), while the RMT hardware's raw on_recv_done callback delivers exactly one pre-filter symbol spanning the entire frame as continuous HIGH (H 731 µs). All digital state (input mux FUNC71←GPIO0, filter 8 APB ticks, divider 2, idle threshold) byte-identical to working captures at waveform-live instants. Probe presence does not alter outcomes. WS2811-400's 625 ns gaps merge while UART's 490 ns gaps capture — behavior follows the TX driver, not waveform shape.
This is beyond register-level remote debugging. Next concrete steps for whoever picks this up: (1) oscilloscope on pin 0 during a PARLIO frame (1 minute of scope time settles pad-vs-silicon); (2) ESP-IDF internals review / vendor query: under what conditions does the C6/P4 RMT RX input stage sample a pad as its envelope while GPIO_IN sees full detail — possible IO_MUX vs GPIO-matrix input path divergence for the RMT signal when specific peripherals are active; (3) try routing the RMT RX input via a DIFFERENT gpio (move the jumper) to rule out pin-0-specific behavior (LP-IO-capable pad on C6).
All tooling to reproduce in minutes is merged: edgeProbe(passive)/edgeProbeRead, parlioRawTest, parlioMetrics, g_rmtrx_* telemetry.
Ran bash autoresearch --parlio on the C6 (COM9, jumper TX=GPIO0 → RX=GPIO1, PARLIO 100 LEDs, WS2812B-V5) across three builds. Two distinct defects found, each proven by a measured state change.
Routing C6 PARLIO to the GPIO ISR timestamp backend captures 256 raw edges where RMT RX captured 0. This corroborates the earlier GPIO_IN-sees-269-edges observation: the GPIO input genuinely sees what RMT RX cannot.
2. mcpwm_capture_channel_enable() was never called — fixed in #3881
Zero call sites anywhere in src/platforms/esp/32/drivers/gpio_isr_rx/. IDF requires the capture channel to be enabled separately from the capture timer (the C6 header: "will transit the channel state from init to enable"). The driver created the channel and enabled the timer, but never enabled the channel, so it never latched and the capture register the fast ISR reads stayed 0. The ISR was working correctly the whole time — timestamping against a dead register.
Also fixed there: mcpwm_timer_start() runs per capture arm while stop() ran only on the error path and at teardown, so re-arming called enable on an already-enabled timer → ESP_ERR_INVALID_STATE ("timer not in init state"), three times per run.
3. Still open: timestamps are implausible
With #3881 the register is live, but decode still fails (0/300 bytes). WS2812B bit periods should be ~1250 ns (~100 ticks at the requested 80 MHz); observed values are in the millions — 3-4 orders of magnitude too large — with recurring round numbers (25000000, 3906250, 24390625).
Prime suspect: capture-clock resolution. mcpwm_timer_init() warns and continues on a resolution mismatch (mcpwm_timer.cpp.hpp:243), so if C6's MCPWM_CAPTURE_CLK_SRC_DEFAULT does not deliver the requested 80 MHz, this is exactly the signature. Investigating now.
#3880 is not a regression — it added 2 lines to the MCPWM file (gpio_status_w1tc_reg_addr) and nothing to the timer lifecycle. Both defects above are pre-existing in the ISR backend and were newly exposed by routing C6 PARLIO through it for the first time. Worth checking whether they also affect ISR-backend captures on other boards.
Root cause of the remaining failure: the GPIO ISR cannot resolve WS2812-rate edges on C6
Measured the ISR's actual capture ceiling across a full 100-LED PARLIO frame on the C6 bench (COM9, TX=GPIO0 -> RX=GPIO1), instrumenting getEdges() to compute inter-capture intervals over every captured edge:
Not one of 1137 intervals fell below 2 us. Zero under 1 us, zero under 500 ns. The distribution is tight — 2000-3550 ns, mean 2599 — which is the signature of an ISR running continuously at its service limit, not one dropping edges sporadically.
WS2812B-V5 needs ~300 ns (T0H) resolution and produces ~4800 edges per 100-LED frame. The backend captured 1138 (~24%) and cannot physically resolve pulses shorter than ~2 us. It is off by ~6.7x.
#3880's premise is correct and confirmed: the C6 GPIO input genuinely sees edges RMT RX misses (256+ vs 0). But routing C6 PARLIO validation to the GPIO ISR timestamp backend cannot succeed, because the ISR cannot sample those edges fast enough to reconstruct WS2812 bit timing. The approach is not viable for WS28xx-rate signals, independent of the two bugs fixed in #3881.
Note gpio_isr_rx_mcpwm.cpp.hpp's header claims "Fast ISR: 25-31 cycles" and ">1 MHz edge capture rate". That accounts for the assembly ISR body only. The measured 2 us at 160 MHz is ~320 cycles — dominated by ESP-IDF's interrupt entry/exit, since a handler registered through esp_intr_alloc() goes through the IDF vector with full context save/restore rather than being a true high-priority vectored interrupt. The header numbers are misleading and should be corrected.
No available timing profile is slow enough to work around this: WS2812B-V5, SK6812, and UCS7604-800KHZ are all ~800 kHz-class, whose shortest pulses are well under the 2 us floor.
Both real, both bench-proven, both worth landing regardless:
mcpwm_capture_channel_enable() was never called. IDF requires enabling the capture channel separately from the timer, so the channel never latched and the register the fast ISR reads stayed 0. Every edge carried a zero timestamp. Fixed -> timestamps went live.
getEdges() converted ticks to ns in place and destructively.result_ptr aliases output_ptr, and EdgeTimestamp::time_ns is a union member overlaying EdgeEntry::timestamp, so each call re-multiplied by 12.5 (proven: two consecutive reads of one capture differed by exactly 12.5x). Fixed -> reported pulse widths went from 4.8M-41M ns to a plausible 2.0-23.4 us.
Suggested direction
Resolving #3586 for C6 PARLIO needs a capture path that does not take an interrupt per edge:
Edge-buffer wrap — RX wait/raw: .../256 is a display cap (AutoResearchTest.cpp:396 resizes to 256 before getRawEdgeTimes()), not an edge count. Raising it to 4096 makes the call return 0 because that vector fails to allocate on this C6 build — a separate constraint worth knowing.
✅ RESOLVED — C6 PARLIO now captures and decodes byte-exactly
TEST PARLIO lanes=1 leds=100 PASS 129ms
✓ AUTORESEARCH SUCCEEDED
RESULT PASS 2 test(s)
Reproduced across two consecutive runs on the C6 bench (COM9, TX=GPIO0 → RX=GPIO1, WS2812B-V5, 100 LEDs).
Fixed in #3881 (branch fix/3586-mcpwm-capture-channel-enable).
Why a new capture backend was required
Neither existing path can capture WS2812-rate signals on C6:
RMT RX returns the whole frame as one merged HIGH symbol even though the GPIO input on the same pad sees every edge — the original report here.
GPIO ISR (routed here by fix(esp32-c6): validate PARLIO with GPIO ISR RX capture backend (#3586) #3880) has a measured capture ceiling of ~2 µs between edges: min=2000ns max=3550ns avg=2599ns, with zero of 1137 intervals under 1 µs on a 100-LED frame. WS2812 needs ~300 ns, so it is off by ~6.7×. The tight spread is an ISR saturated at its service rate, not one dropping edges sporadically.
gpio_isr_rx_mcpwm.cpp.hpp's header claims "25-31 cycles / >1 MHz edge capture rate" — that counts only the assembly ISR body. The measured 2 µs ≈ 320 cycles at 160 MHz is dominated by ESP-IDF interrupt entry/exit, because a handler registered through esp_intr_alloc() runs via the IDF vector with full context save/restore. Those header numbers are misleading and worth correcting.
The fix: PARLIO RX oversampling into DMA
Takes no interrupt per edge. The PARLIO RX unit samples one data line at 16 MHz (62.5 ns) straight into DMA — a 100-LED frame is ~6 KB of samples. C6 has a dedicated RX unit separate from the TX unit (SOC_PARLIO_RX_UNITS_PER_GROUP=1), so PARLIO clockless TX and this capture run concurrently. A soft delimiter gates capture in software, so no external clock or valid-signal pin is needed.
This is the C6 counterpart to the classic-ESP32 I2S-RX oversampler (#3576 Phase 3), reusing its run-length extraction and 4-phase pair decode so byte-exactness semantics match the RMT/ISR/I2S backends.
Both real and independently bench-proven, in the GPIO ISR backend:
mcpwm_capture_channel_enable() was never called anywhere in the driver. IDF requires the capture channel enabled separately from the timer, so it never latched and the register the fast ISR reads stayed 0 — every edge carried timestamp 0.
getEdges() converted ticks→ns in place and destructively.result_ptr aliases output_ptr and EdgeTimestamp::time_ns is a union member over EdgeEntry::timestamp, so each call re-multiplied by 12.5 — proven by two consecutive reads of one capture differing by exactly 12.5×.
Implementation gotchas worth recording
Byte order matters. Samples are scanned byte-wise in DMA order with each byte shifted so bit 7 lands at bit 31 for the leading-zero count, paired with PARLIO_BIT_PACK_ORDER_MSB. Reinterpreting the buffer as u32 (as the I2S backend does) puts the earliest-sampled byte in the low bits on a little-endian core, reversing the time order the scan depends on. This produced a distinctive symptom: valid pulses (H625, H250) interleaved with impossibly short ones (H62, H125).
Window sizing. DMA starts at begin() but transmit happens some ms later, so the window (32 KB ≈ 16.4 ms) must still span a whole frame.
Mid-frame resync. A long idle seen with fewer than kMinFrameRuns runs means sampling opened mid-frame; that fragment is discarded and capture resyncs on the next frame rather than reporting a short capture. Without this the backend reported 7-17 runs instead of a full frame.
Hypotheses ruled out with device data
Capture clock resolution — device reports exactly 80000000 Hz; the hardcoded ns = ticks * 25 / 2 is correct.
Wrong capture register/channel — device reports 0x600140fc = MCPWM base + 0xfc = MCPWM_CAP_CH0_REG, correct for C6.
Edge-buffer wrap — RX wait/raw: .../256 is a display cap (AutoResearchTest.cpp:396 resizes to 256 before getRawEdgeTimes()), not an edge count.
This issue auto-closed at 2026-08-17T02:10:01Z, one second after #3880 merged, because that PR's description said "Closes #3586". That was my mistake — #3880 does not fix this issue.
#3880's premise is correct and confirmed on silicon: the C6 GPIO input genuinely sees edges RMT RX misses. But routing validation to the GPIO ISR timestamp backend cannot work. Its capture ceiling, measured across a full 100-LED frame, is:
Zero of 1137 intervals below 2 µs, against the ~300 ns WS2812 needs — off by ~6.7×.
Leaving the issue closed would point anyone reading it at #3880 as the resolution, which is a change that measurably does not work.
The actual fix is #3881, which adds a PARLIO_RX oversampling backend (16 MHz DMA sampling, 62.5 ns resolution, no interrupt per edge) and passes on the bench:
Activity
feat(autoresearch): dual-device WiFi bench green + C6 USB-CDC fix + p…
fix(autoresearch): extend 16 KB loop stack to all ESP32 variants (#3576…
fix(rmt_rx): retry begin() without DMA when the DMA arm path fails (#…
zackees commentedon Jul 2, 2026
Scope update from the Phase 9 audit: the "transmits but capture sees zero edges" family now spans C6 PARLIO, P4 PARLIO, and S3 SPI (all arm the RMT-RX capture successfully post-#3592 and record 0 edges while UART/RMT on the same jumpers are byte-exact). Common thread to investigate: waveform rate/geometry produced by these TX paths vs the RMT-RX min-pulse filter, or pin-matrix output-enable timing on their init paths.
fix(parlio): derive wave8 clock from chipset timing + edge-probe diag…
zackees commentedon Jul 2, 2026
Forensic addendum — PR #3593 merged (derived wave8 clock + edge-probe tooling). Root cause narrowed but still open.
Established with the new in-firmware edge probe (62 ns class resolution)
parlio_new_tx_unit+transmit (via the newparlioRawTestRPC) works in every config permutation the engine uses (width 1/2 + dummy -1 lane, queue_nonblocking, mts=65534, dma_burst=64, depth 3/8) — sustained bursts captured every run.Elimination table
Pin routing ✓, output enable ✓, pulls ✓, clock divider ✓ (now derived), DMA completion ✓ (metrics), payload ✓, IDF driver ✓ (raw test), glitch filter ✓ (30 ns floor tried), skip-phase ✓ (0), start-low/idle level unresolved-but-probed, RX registers at waveform time ✓ identical.
Remaining hypotheses
Next tools if picked up again: rmt ISR-level counters (increment volatile globals in rxDoneCallback to see whether the ISR fires at all during a PARLIO frame); trigger-time INT_RAW polling loop instead of one-shot reads (ISR clears INT_RAW immediately, one-shot reads are blind).
New portability landmines documented in the tooling:
rdcycle= illegal instruction on Espressif RISC-V cores (esp_cpu_get_cycle_count() instead); classicGPIO.inis a bare u32; LED frames complete within one FreeRTOS tick (burst-poll triggers required).feat(rmt_rx): peekMem-able wait() telemetry for capture forensics (#3586
zackees commentedon Jul 2, 2026
Breakthrough evidence (PRs #3593, #3594 merged):
The C6 receiver does NOT time out — it completes "naturally" with exactly one symbol:
H 772,875 ns(the entire frame duration as one merged HIGH, terminated by idle). Meanwhile the TX pad (pin 1) demonstrably carries a crisp, now timing-correct waveform (edge-probe: H720/L310 ns wave8 at the derived 6.53 MHz clock; UART reference captures with perfect 1.25 µs cadence on the same probe).Timeline instrumentation confirms each capture arms ~2.4 ms BEFORE its transmit — no arm race.
Everything on the RX config side is verified identical between working (UART, 240 symbols) and broken (PARLIO/RMT-TX, 1 merged symbol) captures: CH2 filter = 8 APB ticks (100 ns), divider = 2 (40 MHz), idle threshold, input mux routing (FUNC71 ← GPIO0), pad IE/pulls/drive (20 mA default).
Interpretation
The RMT input stage sees the frame's envelope with ALL low gaps (~310–360 ns) swallowed — for exactly the drivers whose waveforms have the tightest low gaps. Since every digital register checks out, the remaining suspects are electrical/board-level: the pin1→jumper→pin0 path degrading fast low pulses below pin 0's input threshold (the working UART/BIT_BANG waves have ≥460 ns gaps), or an RMT-input-stage sampling subtlety not visible in registers. Pin-0 in-firmware probing self-interferes (the probe artifacts its own 21.5 kHz pattern), so this needs a scope on pin 0 — one minute of oscilloscope time resolves it.
Suggested software mitigation to try regardless
Wave-encoder option to guarantee minimum low-gap width ≥ ~500 ns on capture-validated chips (stretch T3), or bench-only: slow the PARLIO validation chipset timing so gaps clear the degradation. Also:
parlioMetrics,edgeProbe/edgeProbeRead,parlioRawTest, and the newg_rmtrx_*telemetry make the whole investigation reproducible in minutes.feat(autoresearch): trigger-time input-mux snapshots in the edge probe (
zackees commentedon Jul 2, 2026
Model-killing datapoint (PR #3595 merged): with the derived clock, WS2811-400 timing gives PARLIO 625 ns low gaps — still merged into a single envelope symbol — while UART's 490 ns gaps on the same jumper capture perfectly. No low-pass/electrical model survives that: the capture deafness follows the TX DRIVER, not the waveform. Combined with byte-identical RX state at waveform-live instants (input mux, filter, divider, idle threshold — all verified at trigger time), the remaining hypothesis space: (a) something these drivers' software does to the receive between arm and idle-completion (the merged symbol spans exactly frame-start→frame-end, so the receiver DOES see the boundary edges); (b) an RMT input-sampling interaction triggered by PARLIO/RMT-TX peripheral activity invisible to the peeked registers. Next steps: scope on pin 0, or IDF-internals review of rmt rx channel state during concurrent PARLIO/RMT-TX activity. Full reproduction now takes minutes with the merged tooling (edgeProbe/parlioRawTest/parlioMetrics/g_rmtrx_* telemetry).
feat(autoresearch): passive edge-probe mode + pre-filter RX telemetry (…
zackees commentedon Jul 2, 2026
Final synthesis of this investigation round (PR #3596 merged): the paradox is now fully instrument-verified. Pin 0 — the receiver's own pad — carries the complete crisp PARLIO waveform (passive probe through the jumper: H
893/L356 ns alternation), while the RMT hardware's rawon_recv_donecallback delivers exactly one pre-filter symbol spanning the entire frame as continuous HIGH (H 731 µs). All digital state (input mux FUNC71←GPIO0, filter 8 APB ticks, divider 2, idle threshold) byte-identical to working captures at waveform-live instants. Probe presence does not alter outcomes. WS2811-400's 625 ns gaps merge while UART's 490 ns gaps capture — behavior follows the TX driver, not waveform shape.This is beyond register-level remote debugging. Next concrete steps for whoever picks this up: (1) oscilloscope on pin 0 during a PARLIO frame (1 minute of scope time settles pad-vs-silicon); (2) ESP-IDF internals review / vendor query: under what conditions does the C6/P4 RMT RX input stage sample a pad as its envelope while GPIO_IN sees full detail — possible IO_MUX vs GPIO-matrix input path divergence for the RMT signal when specific peripherals are active; (3) try routing the RMT RX input via a DIFFERENT gpio (move the jumper) to rule out pin-0-specific behavior (LP-IO-capable pad on C6).
All tooling to reproduce in minutes is merged: edgeProbe(passive)/edgeProbeRead, parlioRawTest, parlioMetrics, g_rmtrx_* telemetry.
zackees commentedon Aug 17, 2026
Bench validation on real C6 silicon — 2026-08-17
Ran
bash autoresearch --parlioon the C6 (COM9, jumper TX=GPIO0 → RX=GPIO1, PARLIO 100 LEDs, WS2812B-V5) across three builds. Two distinct defects found, each proven by a measured state change.RX rawzero_capturee52abeb26d)decode_mismatchL0 H0 L0 H0 …decode_mismatchL29808587 H4833913 L15650462 …1. #3880's premise is CONFIRMED on silicon
Routing C6 PARLIO to the GPIO ISR timestamp backend captures 256 raw edges where RMT RX captured 0. This corroborates the earlier
GPIO_IN-sees-269-edges observation: the GPIO input genuinely sees what RMT RX cannot.2.
mcpwm_capture_channel_enable()was never called — fixed in #3881Zero call sites anywhere in
src/platforms/esp/32/drivers/gpio_isr_rx/. IDF requires the capture channel to be enabled separately from the capture timer (the C6 header: "will transit the channel state from init to enable"). The driver created the channel and enabled the timer, but never enabled the channel, so it never latched and the capture register the fast ISR reads stayed 0. The ISR was working correctly the whole time — timestamping against a dead register.Also fixed there:
mcpwm_timer_start()runs per capture arm whilestop()ran only on the error path and at teardown, so re-arming called enable on an already-enabled timer →ESP_ERR_INVALID_STATE("timer not in init state"), three times per run.3. Still open: timestamps are implausible
With #3881 the register is live, but decode still fails (
0/300bytes). WS2812B bit periods should be ~1250 ns (~100 ticks at the requested 80 MHz); observed values are in the millions — 3-4 orders of magnitude too large — with recurring round numbers (25000000,3906250,24390625).Prime suspect: capture-clock resolution.
mcpwm_timer_init()warns and continues on a resolution mismatch (mcpwm_timer.cpp.hpp:243), so if C6'sMCPWM_CAPTURE_CLK_SRC_DEFAULTdoes not deliver the requested 80 MHz, this is exactly the signature. Investigating now.#3880 is not a regression — it added 2 lines to the MCPWM file (
gpio_status_w1tc_reg_addr) and nothing to the timer lifecycle. Both defects above are pre-existing in the ISR backend and were newly exposed by routing C6 PARLIO through it for the first time. Worth checking whether they also affect ISR-backend captures on other boards.fix(esp32): convert ISR edge timestamps once per capture
zackees commentedon Aug 17, 2026
Root cause of the remaining failure: the GPIO ISR cannot resolve WS2812-rate edges on C6
Measured the ISR's actual capture ceiling across a full 100-LED PARLIO frame on the C6 bench (COM9, TX=GPIO0 -> RX=GPIO1), instrumenting
getEdges()to compute inter-capture intervals over every captured edge:(all values in ns)
Not one of 1137 intervals fell below 2 us. Zero under 1 us, zero under 500 ns. The distribution is tight — 2000-3550 ns, mean 2599 — which is the signature of an ISR running continuously at its service limit, not one dropping edges sporadically.
WS2812B-V5 needs ~300 ns (T0H) resolution and produces ~4800 edges per 100-LED frame. The backend captured 1138 (~24%) and cannot physically resolve pulses shorter than ~2 us. It is off by ~6.7x.
What this means for #3880
#3880's premise is correct and confirmed: the C6 GPIO input genuinely sees edges RMT RX misses (256+ vs 0). But routing C6 PARLIO validation to the GPIO ISR timestamp backend cannot succeed, because the ISR cannot sample those edges fast enough to reconstruct WS2812 bit timing. The approach is not viable for WS28xx-rate signals, independent of the two bugs fixed in #3881.
Note
gpio_isr_rx_mcpwm.cpp.hpp's header claims "Fast ISR: 25-31 cycles" and ">1 MHz edge capture rate". That accounts for the assembly ISR body only. The measured 2 us at 160 MHz is ~320 cycles — dominated by ESP-IDF's interrupt entry/exit, since a handler registered throughesp_intr_alloc()goes through the IDF vector with full context save/restore rather than being a true high-priority vectored interrupt. The header numbers are misleading and should be corrected.No available timing profile is slow enough to work around this:
WS2812B-V5,SK6812, andUCS7604-800KHZare all ~800 kHz-class, whose shortest pulses are well under the 2 us floor.Bugs found and fixed along the way (#3881)
Both real, both bench-proven, both worth landing regardless:
mcpwm_capture_channel_enable()was never called. IDF requires enabling the capture channel separately from the timer, so the channel never latched and the register the fast ISR reads stayed 0. Every edge carried a zero timestamp. Fixed -> timestamps went live.getEdges()converted ticks to ns in place and destructively.result_ptraliasesoutput_ptr, andEdgeTimestamp::time_nsis a union member overlayingEdgeEntry::timestamp, so each call re-multiplied by 12.5 (proven: two consecutive reads of one capture differed by exactly 12.5x). Fixed -> reported pulse widths went from 4.8M-41M ns to a plausible 2.0-23.4 us.Suggested direction
Resolving #3586 for C6 PARLIO needs a capture path that does not take an interrupt per edge:
Hypotheses ruled out (recorded so nobody re-chases them)
80000000 Hz. The hardcodedns = ticks * 25 / 2is correct.0x600140fc= MCPWM base +0xfc=MCPWM_CAP_CH0_REG, correct for C6; hardcoded channel 0 matches IDF's allocation.RX wait/raw: .../256is a display cap (AutoResearchTest.cpp:396resizes to 256 beforegetRawEdgeTimes()), not an edge count. Raising it to 4096 makes the call return 0 because that vector fails to allocate on this C6 build — a separate constraint worth knowing.feat(esp32): add PARLIO_RX oversampling capture backend — closes #3586
zackees commentedon Aug 17, 2026
✅ RESOLVED — C6 PARLIO now captures and decodes byte-exactly
Reproduced across two consecutive runs on the C6 bench (COM9, TX=GPIO0 → RX=GPIO1, WS2812B-V5, 100 LEDs).
Fixed in #3881 (branch
fix/3586-mcpwm-capture-channel-enable).Why a new capture backend was required
Neither existing path can capture WS2812-rate signals on C6:
min=2000ns max=3550ns avg=2599ns, with zero of 1137 intervals under 1 µs on a 100-LED frame. WS2812 needs ~300 ns, so it is off by ~6.7×. The tight spread is an ISR saturated at its service rate, not one dropping edges sporadically.gpio_isr_rx_mcpwm.cpp.hpp's header claims "25-31 cycles / >1 MHz edge capture rate" — that counts only the assembly ISR body. The measured 2 µs ≈ 320 cycles at 160 MHz is dominated by ESP-IDF interrupt entry/exit, because a handler registered throughesp_intr_alloc()runs via the IDF vector with full context save/restore. Those header numbers are misleading and worth correcting.The fix: PARLIO RX oversampling into DMA
Takes no interrupt per edge. The PARLIO RX unit samples one data line at 16 MHz (62.5 ns) straight into DMA — a 100-LED frame is ~6 KB of samples. C6 has a dedicated RX unit separate from the TX unit (
SOC_PARLIO_RX_UNITS_PER_GROUP=1), so PARLIO clockless TX and this capture run concurrently. A soft delimiter gates capture in software, so no external clock or valid-signal pin is needed.This is the C6 counterpart to the classic-ESP32 I2S-RX oversampler (#3576 Phase 3), reusing its run-length extraction and 4-phase pair decode so byte-exactness semantics match the RMT/ISR/I2S backends.
Bench progression
L0 H0 L0 H0H2475 L20962 H2463L375 H625 L1000 H500 L625 H625 L250 H62H625≈ T1H,H250≈ T0H,L625≈ T1L.Two bugs fixed along the way (also in #3881)
Both real and independently bench-proven, in the GPIO ISR backend:
mcpwm_capture_channel_enable()was never called anywhere in the driver. IDF requires the capture channel enabled separately from the timer, so it never latched and the register the fast ISR reads stayed 0 — every edge carried timestamp 0.getEdges()converted ticks→ns in place and destructively.result_ptraliasesoutput_ptrandEdgeTimestamp::time_nsis a union member overEdgeEntry::timestamp, so each call re-multiplied by 12.5 — proven by two consecutive reads of one capture differing by exactly 12.5×.Implementation gotchas worth recording
PARLIO_BIT_PACK_ORDER_MSB. Reinterpreting the buffer asu32(as the I2S backend does) puts the earliest-sampled byte in the low bits on a little-endian core, reversing the time order the scan depends on. This produced a distinctive symptom: valid pulses (H625,H250) interleaved with impossibly short ones (H62,H125).begin()but transmit happens some ms later, so the window (32 KB ≈ 16.4 ms) must still span a whole frame.kMinFrameRunsruns means sampling opened mid-frame; that fragment is discarded and capture resyncs on the next frame rather than reporting a short capture. Without this the backend reported 7-17 runs instead of a full frame.Hypotheses ruled out with device data
80000000 Hz; the hardcodedns = ticks * 25 / 2is correct.0x600140fc= MCPWM base +0xfc=MCPWM_CAP_CH0_REG, correct for C6.RX wait/raw: .../256is a display cap (AutoResearchTest.cpp:396resizes to 256 beforegetRawEdgeTimes()), not an edge count.zackees commentedon Aug 17, 2026
Reopened — closed prematurely by #3880
This issue auto-closed at
2026-08-17T02:10:01Z, one second after #3880 merged, because that PR's description said "Closes #3586". That was my mistake — #3880 does not fix this issue.#3880's premise is correct and confirmed on silicon: the C6 GPIO input genuinely sees edges RMT RX misses. But routing validation to the GPIO ISR timestamp backend cannot work. Its capture ceiling, measured across a full 100-LED frame, is:
Zero of 1137 intervals below 2 µs, against the ~300 ns WS2812 needs — off by ~6.7×.
Leaving the issue closed would point anyone reading it at #3880 as the resolution, which is a change that measurably does not work.
The actual fix is #3881, which adds a
PARLIO_RXoversampling backend (16 MHz DMA sampling, 62.5 ns resolution, no interrupt per edge) and passes on the bench:Reopening so this closes when #3881 lands. Full detail: #3586 (comment)
Merge pull request #3881 from FastLED/fix/3586-mcpwm-capture-channel-…
fix(esp32): enable MCPWM capture channel so ISR RX timestamps are live
docs(esp32): correct GPIO ISR RX performance claims with measured data (