Skip to content

fix(rmt_rx): retry begin() without DMA when the DMA arm path fails (#3591) - #3592

Merged
zackees merged 1 commit into
masterfrom
fix/s3-rmt-rx-dma-fallback-3591
Jul 2, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/s3-rmt-rx-dma-fallback-3591

Conversation

@zackees

@zackees zackees commented Jul 2, 2026 •

Copy link
Copy Markdown
Member

On ESP32-S3 (the only bench chip with RMT RX DMA silicon), every non-RMT driver's loopback capture failed to arm: the harness passes use_dma=true for non-RMT TX paths and the DMA-mode begin() returned false silently — SPI/UART/LCD_CLOCKLESS/LCD_SPI all reported captureWaitResult=-1 while RMT (non-DMA loopback) passed 4/4. Bisect proof: forcing use_dma=false flipped UART to 4/4 instantly.

DMA only extends the capture window; a shorter window beats no capture. begin() now retries once in non-DMA mode (with a warning) when the DMA attempt fails. Body moved to beginImpl(); DMA-successful and non-DMA paths are unchanged.

Bench matrix after the fix

Board Result
S3 (GPIO1→2) UART 0/4 → 4/4, LCD_CLOCKLESS 0/4 → 4/4, LCD_SPI 0/4 → 4/4, RMT 4/4; SPI arms now but 0-edge (transmit-not-captured family → #3586)
WROOM I2S / I2S0 / RMT / UART / SPI — 4/4 each
C6 SPI / UART — 4/4
P4 RMT / SPI / UART — 4/4

Host: 347/347; lint clean.

Refs #3591, #3576, #3586.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved receiver startup reliability by automatically retrying initialization in non-DMA mode if DMA-based setup fails.
    • Added clearer logging when DMA initialization cannot be completed, helping diagnose capture issues.

…3591)

On ESP32-S3 (the only bench chip with RMT RX DMA silicon) every
non-RMT driver's loopback capture failed to arm: the harness passes
use_dma=true for non-RMT TX paths and the DMA-mode begin() returned
false silently, so SPI/UART/LCD_CLOCKLESS/LCD_SPI all reported
captureWaitResult=-1 while RMT (non-DMA loopback) passed 4/4.

DMA only extends the capture window — a shorter window beats no
capture — so begin() now retries once in non-DMA mode (with a warning)
when the DMA-mode attempt fails. The body moved to beginImpl();
behavior is unchanged whenever the DMA path succeeds or DMA was not
requested.

Bench matrix after the fix:
- S3 (GPIO1->2): UART 0/4 -> 4/4, LCD_CLOCKLESS 0/4 -> 4/4,
  LCD_SPI 0/4 -> 4/4, RMT stays 4/4. S3 SPI still 0-edge (arms now,
  transmit-not-captured family -> #3586).
- Regression: WROOM I2S/I2S0/RMT/UART/SPI 4/4 each; C6 SPI/UART 4/4;
  P4 RMT/SPI/UART 4/4.

Host: 347/347, lint clean.

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: 6f2bcf8a-ba24-469e-b4a5-eadb67d73a38

📥 Commits

Reviewing files that changed from the base of the PR and between b693ac3 and c486e1e.

📒 Files selected for processing (1)
  • src/platforms/esp/32/drivers/rmt_rx/rmt_rx_5/rmt_rx_channel_5.cpp.hpp

📝 Walkthrough

Walkthrough

RmtRxChannelImpl::begin() now retries capture initialization once in non-DMA mode when the initial beginImpl(config) call fails and DMA was requested, logging the failure before falling back to a cloned config with use_dma=false.

Changes

DMA fallback retry

Layer / File(s) Summary
begin() retry logic
src/platforms/esp/32/drivers/rmt_rx/rmt_rx_5/rmt_rx_channel_5.cpp.hpp
Adds a fallback path that retries beginImpl with use_dma=false after a failed DMA-mode attempt, logging the failure and returning the retry result.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2300: Introduced the use_dma-controlled RMT RX DMA mode and related begin/initialization behavior that this fallback logic builds upon.
✨ 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 fix/s3-rmt-rx-dma-fallback-3591

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.

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