Skip to content

feat(autoresearch): passive edge-probe mode + pre-filter RX telemetry (#3586) - #3596

Merged
zackees merged 1 commit into
masterfrom
feat/edgeprobe-passive-3586
Jul 2, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/edgeprobe-passive-3586

Conversation

@zackees

@zackees zackees commented Jul 2, 2026 •

Copy link
Copy Markdown
Member
  • edgeProbe gains {passive:true}: no pad reconfiguration — only the triggered tight-loop sampler. Safe on pads owned by an armed receiver (active mode destroyed the RX arm).
  • rmt_rx: pre-filter callback telemetry (g_rmtrx_cb_raw_symbols, g_rmtrx_cb_first_raw).

Findings (on #3586): pin 0 — the receiver's own pad — carries the full crisp PARLIO waveform through the jumper, yet the RMT hardware's raw callback delivers exactly ONE symbol spanning the whole frame as continuous HIGH (731 µs). Probe presence doesn't alter pass/fail. All registers byte-identical to working captures. Next step requires an oscilloscope or vendor-level RMT input-path review.

Host tests + lint clean; C6 compile clean.

Refs #3586.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added an optional passive arming mode for edge probing, giving users more control over how the probe is initialized.
    • The remote probe command now accepts a passive option and can be called with just a pin or with both pin and mode settings.
  • Bug Fixes

    • Improved probe re-arming behavior so passive mode avoids interrupt reconfiguration and resets counters appropriately.
  • Chores

    • Expanded low-level receive telemetry to capture additional callback details for easier debugging and analysis.

…#3586)

- edgeProbe gains {passive:true}: no pinMode/attachInterrupt/pull
  toggles — only the triggered tight-loop sampler task. Safe on pads
  owned by an armed receiver (active mode destroyed the RX arm and
  produced self-inflicted artifacts).
- rmt_rx: g_rmtrx_cb_raw_symbols / g_rmtrx_cb_first_raw capture the
  PRE-FILTER symbol count and first raw symbol per callback.

Findings (recorded on #3586): pin 0 — the receiver's own pad — carries
the FULL crisp PARLIO waveform (passive probe: H~893/L~356 ns
alternation through the jumper), yet the RMT hardware's raw callback
delivers exactly ONE symbol spanning the whole frame as continuous
HIGH (H 731 us). Probe presence does not alter pass/fail. Every
digital register (input mux, filter, divider, idle threshold) is
byte-identical to captures that work. The remaining investigation
needs an oscilloscope or ESP-IDF/vendor-level review of RMT RX input
sampling during concurrent PARLIO/RMT-TX activity.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 048d9732-38b8-424c-b24a-73f37aedee6a

📥 Commits

Reviewing files that changed from the base of the PR and between 0383419 and cc09d74.

📒 Files selected for processing (4)
  • examples/AutoResearch/AutoResearchEdgeProbe.cpp
  • examples/AutoResearch/AutoResearchEdgeProbe.h
  • examples/AutoResearch/AutoResearchRemoteSystemMethods.cpp
  • src/platforms/esp/32/drivers/rmt_rx/rmt_rx_5/rmt_rx_channel_5.cpp.hpp

📝 Walkthrough

Walkthrough

Adds a new edgeProbeArmMode(int pin, bool passive) API to the AutoResearch edge probe module, refactoring edgeProbeArm to delegate to it, skipping interrupt reconfiguration and self-test in passive mode, and threading an optional passive argument through the RPC handler. Separately, adds telemetry variables to the RMT RX channel 5 callback.

Changes

Edge Probe Passive Mode

Layer / File(s) Summary
Passive-mode API declaration and implementation
examples/AutoResearch/AutoResearchEdgeProbe.h, examples/AutoResearch/AutoResearchEdgeProbe.cpp
Adds edgeProbeArmMode(int pin, bool passive) declaration with docs; edgeProbeArm now delegates to it; in passive mode interrupt detach/attach and self-test are skipped and g_selftest_edges is reset; adds a non-ESP32 stub for the new function.
RPC handler passive flag wiring
examples/AutoResearch/AutoResearchRemoteSystemMethods.cpp
The edgeProbe RPC handler now parses an optional passive boolean argument (default false) and calls edgeProbeArmMode(pin, passive).

RMT RX Telemetry

Layer / File(s) Summary
RX callback telemetry capture
src/platforms/esp/32/drivers/rmt_rx/rmt_rx_5/rmt_rx_channel_5.cpp.hpp
Adds two volatile telemetry variables tracking raw symbol count and first raw symbol word, populated inside rxDoneCallback.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

  • FastLED/FastLED#3593: Both PRs modify the same AutoResearch edge-probe implementation, with the related PR handling edgeProbeArm diagnostics/RPC while this PR refactors it into edgeProbeArmMode(pin, passive).
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/edgeprobe-passive-3586

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit cc6a7c2 into master Jul 2, 2026
9 of 11 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 2, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 2, 2026
zackees added a commit that referenced this pull request Jul 2, 2026
…3588) (#3597)

Route handlers used to execute ON the esp_http_server FreeRTOS task,
running full fl::json/string/Response machinery concurrently with the
main loop's fl:: churn. Requests are now marshaled: the httpd task
extracts plain-C request data (method/uri/body buffers only), queues
it, and blocks on a semaphore; the main task — via the existing
task::Executor pump — runs the fl:: handler and hands back a
heap-allocated Response the httpd task then serializes with IDF C
APIs. No fl:: object is constructed or mutated off the main task.
When the main loop is busy (e.g. a long bench test), requests get a
clean 5xx instead of cross-task execution.

Verified over the air (WROOM AP + C6 client): GET /ping 200 through
the marshaled path. The #3588 corruption itself STILL reproduces even
with handlers fully marshaled — which eliminates the last
fl-object-cross-task theory; per-task stack watermarks (new heapCheck
"tasks" field) show every task healthy under traffic, the RX ISR does
no allocation, and heap integrity is intact seconds before the crash.
Full record on the issue; next step is an IDF-source build with
comprehensive heap poisoning.

Also:
- HOTFIX: #3596's pre-filter ISR telemetry broke the classic-ESP32
  link ("l32r: literal placed after use" in the IRAM rxDoneCallback);
  the telemetry writes are now RISC-V-only.
- heapCheck RPC reports per-task stack high-water marks.

Host: 347/347, lint clean; esp32dev/c6/s3 compile clean.

Co-authored-by: Claude Fable 5 <[email protected]>
zackees added a commit that referenced this pull request Jul 5, 2026
… root-cause S3 DMA fallback (#3591) (#3600)

Telemetry
- The scattered `g_rmtrx_*` volatile globals (wait/max/first-symbols,
  callback raw-symbol probes) reserved BSS unconditionally. They are now
  fields of one `RmtRxDebug` struct reached via `fl::Singleton<RmtRxDebug>`
  — lazily constructed on first RX-channel creation, so nothing is
  reserved unless a capture actually runs.
- The ISR reaches the struct through a cached member pointer (mDebug)
  instead of a global symbol. A member deref emits no absolute-address
  literal, so the telemetry is now IRAM-safe on Xtensa too — this
  removes the `#if defined(__riscv)` gate that #3596 had to add after
  the "l32r: literal placed after use" link failure. Telemetry now works
  on every ESP32 variant.

#3591 — S3 RMT-RX DMA "silent arm failure" root-caused
- New begin()/arm telemetry (begin_dbg + accumulating dma_tally +
  dma_fail_where) let the bench read the DMA outcome despite suppressed
  logs. Verdict on ESP32-S3: dma_tally = [requested=16, armedOK=0,
  fellback=0, armFail=16] — the shared DMA slot IS granted (no TX
  contention), but the arm fails 100% at heap_caps_malloc
  (dma_fail_where=1). The 14336-symbol pool + a matching user buffer
  needs ~112 KB of contiguous DMA-internal RAM, unavailable once WiFi is
  up. begin() then retries non-DMA and every capture passes — the
  failure was purely a silent, correct memory-pressure fallback.
- Fixed a latent size MISMATCH exposed while investigating: the DMA user
  buffer was sized 14000 while the descriptor pool was 14336. If that
  buffer ever allocated, the DMA engine would write past it (bench
  confirmed: StoreProhibited/Cache-error crash when the buffer is
  shrunk below the pool). The user buffer is now derived from the same
  kDmaRxSymbols constant as the pool, so they can never diverge.

The non-DMA ping-pong path (en_partial_rx) captures every S3 driver's
frames reliably; DMA offers only CPU offload here, so enabling it on
S3 is deferred rather than forced with a fragile small pool.

Verified: WROOM RMT/I2S/UART 4/4, C6 SPI/UART 4/4, S3
UART/LCD_CLOCKLESS/LCD_SPI/RMT 4/4 (single-pass). Host 349/349, lint
clean, esp32dev/c6/s3 compile clean.

Co-authored-by: Claude Fable 5 <[email protected]>
@zackees
zackees deleted the feat/edgeprobe-passive-3586 branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant