Skip to content

fix(rp): honour XTRA0 and fall back across PIO blocks (#4622) - #4631

Merged
zackees merged 1 commit into
masterfrom
fix/4622-rp-pio-xtra0-fallback
Sep 25, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/4622-rp-pio-xtra0-fallback

Conversation

@zackees

@zackees zackees commented Sep 25, 2026

Copy link
Copy Markdown
Member

Closes #4622. Part of #4601 / #4580.

What changed

  • XTRA0: ChannelData now carries extraZeroBitsPerByte. SlimBridgeController takes an optional trailing XTRA0 template parameter (default 0, so other platforms are unchanged). ClocklessRpPio forwards its XTRA0, so GE8822 and GW6205 (XTRA0=4, src/chipsets.h) again get 8+4-bit symbols on RP. ChannelEngineRpPio emits the extra zero planes, and it does not batch lanes whose XTRA0 differs.
  • Resource fallback: RpPioTxPeripheral::configure() first tries its own PIO block, then every other block. The SM, DMA and pin claim and the program load are retried together, so a block whose instruction memory is full is also skipped. This covers the usual case where TinyUSB or PIO-USB holds PIO0.
  • When no block can take the strip, a single FL_WARN_ONCE names the possible causes (invalid pin or timing, or no SM / program space / DMA) and points at FASTLED_RP2040_CLOCKLESS_PIO=0, the blocking bit-bang controller.
  • Not done: an automatic runtime bit-bang fallback (FASTLED_RP2040_CLOCKLESS_M0_FALLBACK). Resources are claimed asynchronously per transmission inside the engine, so a synchronous fallback would need a probe-then-claim race. The documented compile-time switch remains the escape hatch.

Verification

  • New host tests in tests/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp:
    • XTRA0=4 gives 12 planes per byte, with the zero tail checked.
    • Lanes with different XTRA0 are not batched.
  • bash test --cpp: all pass. bash lint: clean.
  • bash compile rp2040|rp2350 --examples Blink with GE8822 and GW6205 addLeds enabled locally (not committed) builds. Blink and BlinkParallel for rp2040 and rp2350 build.

Code review (/code-review medium)

  • MEDIUM: the fallback first covered only the SM/DMA claim and not the program load. Fixed: the loop moved into configure() and retries both together.
  • LOW: the warning blamed every configure() failure on resource exhaustion. Fixed: it now lists every cause.

Hardware

Hardware validation is deferred (maintainer decision), tracked in #4623.

🤖 Generated with Claude Code

…ne (#4622)

- ChannelData carries the legacy XTRA0 as extra zero bits per byte;
  SlimBridgeController takes an optional XTRA0 parameter and ClocklessRpPio
  forwards it, so GE8822/GW6205 get their 12-bit symbols on RP again.
- ChannelEngineRpPio emits the extra zero planes and never batches lanes
  with different XTRA0.
- RpPioTxPeripheral::configure() retries the state-machine/DMA/pin claim and
  the program load on every PIO block, not only its own.
- One clear warning when no block can take the strip.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@zackees
zackees merged commit 9892092 into master Sep 25, 2026
13 checks passed
@zackees
zackees deleted the fix/4622-rp-pio-xtra0-fallback branch September 25, 2026 05:47
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Sep 25, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Sep 25, 2026
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: FastLED/FastLED/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 55e28bff-64f6-452a-b5ae-ddf88a896a7d

📥 Commits

Reviewing files that changed from the base of the PR and between 1c237f5 and 6afeb8a.

📒 Files selected for processing (6)
  • src/fl/channels/data.h
  • src/fl/channels/slim_bridge_controller.h
  • src/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp.hpp
  • src/platforms/arm/rp/rpcommon/clockless_rp_pio.h
  • src/platforms/arm/rp/rpcommon/rp_pio_tx_peripheral.cpp.hpp
  • tests/platforms/arm/rp/rpcommon/channel_engine_rp_pio.cpp
 _________________________________________________________
< Fun fact: 'idempotent' doesn't mean 'it usually works'. >
 ---------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

RP PIO engine: honour XTRA0 and add a blocking fallback when no SM/DMA is free (breaks GE8822/GW6205 on RP)

1 participant