Repository navigation
fix(parlio): derive wave8 clock from chipset timing + edge-probe diagnostics (#3586) - #3593
Conversation
…nostics (#3586) Two deliverables from the #3586 deep-dive on the C6 bench: 1. PARLIO wave8 clock is now DERIVED from the chipset timing (8 samples/bit -> clock = 8e9 / bit_period_ns) instead of the hardcoded 8 MHz FL_ESP_PARLIO_CLOCK_FREQ_HZ. Bench-measured on ESP32-C6 with the in-firmware edge probe: the old constant transmitted WS2812 with a 1.0 us bit period (T1H 643 ns / T1L 356 ns on the wire) - 25% fast. Same rule as the classic-I2S engine: pixel clocks derive from ChipsetTimingConfig, never hardcoded. Mock-driver tests updated (WS2812B_V5 1225 ns -> 6530612 Hz). 2. AutoResearch edge-probe tooling (edgeProbe / edgeProbeRead RPCs + AutoResearchEdgeProbe.{h,cpp}): an in-firmware logic probe that triggers on line activity and run-length records the waveform with the cycle counter (62.5 ns resolution class). Includes an arm-time pull-toggle self-test, a mid-test re-arm task (drivers clear the pad's input-enable on re-init), and trigger-time RMT register snapshots. Also parlioRawTest: a minimal IDF parlio transmit (pin/hz/width/pattern/queue-flags parameterized) for engine-vs-IDF-vs-silicon bisection. Hard-won portability notes encoded in the tooling: plain `rdcycle` is an ILLEGAL INSTRUCTION on Espressif RISC-V cores (use esp_cpu_get_cycle_count()); classic ESP32 exposes GPIO.in as a bare u32 (use GPIO_IN_REG/GPIO_IN1_REG); LED frames complete inside one FreeRTOS tick so triggers must tight-poll in bursts. #3586 status after this change: the PARLIO waveform is present and timing-correct on the wire; the RMT-RX capture still records zero symbols for PARLIO/RMT-TX frames while UART/SPI/BIT_BANG on the same jumper capture fine - full forensic addendum on the issue. Host: 347/347, lint clean. Bench: C6 SPI/UART 4/4; P4 RMT/SPI/UART 4/4 with the new derived clock. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughAdds a new ESP32 edge-probe module (implementation, header, and RPC bindings) for capturing and reading GPIO edge timestamps, plus a new PARLIO raw transmit RPC test binding. Separately, PARLIO Wave8 clock frequency is now derived from chipset timing instead of a fixed constant, with matching test updates. ChangesEdge Probe and RPC Wiring
PARLIO Wave8 Clock Frequency Fix
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant AutoResearchRemoteControl
participant AutoResearchEdgeProbe
participant GPIO_ISR
Client->>AutoResearchRemoteControl: edgeProbe(pin)
AutoResearchRemoteControl->>AutoResearchEdgeProbe: edgeProbeArm(pin)
AutoResearchEdgeProbe->>GPIO_ISR: install CHANGE interrupt, run self-test
GPIO_ISR-->>AutoResearchEdgeProbe: record edge timestamps
AutoResearchEdgeProbe-->>AutoResearchRemoteControl: pin, selfTestEdges
AutoResearchRemoteControl-->>Client: success, pin, selfTestEdges
Client->>AutoResearchRemoteControl: edgeProbeRead()
AutoResearchRemoteControl->>AutoResearchEdgeProbe: edgeProbeStamps(count)
AutoResearchEdgeProbe-->>AutoResearchRemoteControl: timestamp buffer, count
AutoResearchRemoteControl->>AutoResearchEdgeProbe: edgeProbeRmtLive(), edgeProbeState()
AutoResearchEdgeProbe-->>AutoResearchRemoteControl: rmt samples, state
AutoResearchRemoteControl-->>Client: level/ns pulse entries
Possibly related issues
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Two deliverables from the #3586 deep-dive:
1. PARLIO wave8 clock derived from chipset timing
The wave8 clock was the hardcoded 8 MHz
FL_ESP_PARLIO_CLOCK_FREQ_HZ; it must be8 samples/bit ÷ bit_period(WS2812B_V5's 1225 ns → 6.53 MHz). Bench-measured on ESP32-C6 with the new in-firmware edge probe: the old constant transmitted WS2812 with a 1.0 µs bit period (T1H 643 ns / T1L 356 ns on the wire) — 25% fast. Same mandate as the classic-I2S engine: pixel clocks derive fromChipsetTimingConfig, never hardcoded. Mock tests updated.2. Edge-probe diagnostic suite (AutoResearch)
edgeProbe/edgeProbeReadRPCs: an in-firmware logic probe (trigger on activity, run-length record with the cycle counter) plusparlioRawTest(minimal IDF parlio transmit, parameterized) for engine-vs-IDF bisection. Portability lessons hard-encoded:rdcycleis an illegal instruction on Espressif RISC-V (useesp_cpu_get_cycle_count()); classicGPIO.inis a bare u32; LED frames complete inside one FreeRTOS tick (burst-poll triggers required).#3586 status
Waveform proven present and now timing-correct; the capture blindness (RMT-RX records zero symbols for PARLIO/RMT-TX frames while UART/SPI/BIT_BANG capture fine on the same jumper) persists — full forensic addendum with the elimination table posted on the issue.
Host: 347/347; lint clean; esp32dev/s3/p4/c6 compile clean. Bench: C6 SPI/UART 4/4, P4 RMT/SPI/UART 4/4 on the new clock.
Refs #3586, #3576.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes