Skip to content

slim bridge: RP2040/RP2350 PIO clockless #4589

Closed

Description

@zackees

Files:

  • src/platforms/arm/rp/rpcommon/clockless_rp_pio.h
  • src/platforms/arm/rp/rpcommon/clockless_rp_pio_parallel.h

RP already has channel engines (PIO/UART/SPI), so these are Bridged candidates. They do not use ChannelData today.

Part of #4580. Follow the slim bridge format, the gap register (A1-A12) and the testing plan (T0-T4) there. Acceptance: the T1 conformance suite passes, a same-SHA bash bloat before/after is recorded, and AutoResearch evidence is included where hardware is available.

Activity

  1. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Exempt per the decision recorded in #4590: this platform's legacy clockless path links no channel code, so the slim bridge has nothing to remove, and bridging would add ChannelManager. Reopen if its legacy controller adopts a channel driver.

  2. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Follow-up filed as #4599: Teensy 4.x and RP2040/2350 do have channel engines, so the exemption is being re-evaluated by measurement there.

  3. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Reopened under follow-up meta #4601. The exemption in #4590 is being re-evaluated per platform by measurement rather than applied as a blanket rule.

  4. moved this from Done to Triage in FastLED Trackeron Sep 25, 2026
  5. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    RP2040/RP2350: decision = keep the direct PIO controller (not converting)

    Same SHA (origin/master @ 5b33873), bash bloat rp2040 --example <X> --build. The prototype aliased ClocklessController to fl::SlimBridgeController<DATA_PIN, TIMING, RGB_ORDER, WAIT_TIME, BusTraits<Bus::FLEX_IO, 0>> (ChannelEngineRpPio on PIO0).

    rp2040 legacy direct PIO slim bridge over ChannelEngineRpPio delta
    Blink, bloat total flash 93,053 B 128,055 B +35,002 B (+37.6%)
    Blink, firmware.bin 103,756 B 136,820 B +33,064 B
    Blink, static RAM 45,741 B 46,734 B +993 B
    BlinkParallel, bloat total flash 101,922 B 131,562 B +29,640 B (+29.1%)
    BlinkParallel, firmware.bin 112,564 B 140,812 B +28,248 B

    Most of the increase comes from ChannelManager::instance() → initChannelDrivers(), which links every RP driver (PIO, UART, native SPI, and the SPI adapters). The legacy direct PIO code removed is much smaller than that.

    Parity: the engine cannot currently replace the direct controller

    • Concurrency: the legacy controller gives each strip its own PIO state machine and DMA channel, so all strips transmit at the same time. ChannelEngineRpPio batches a run of lanes only when the pins are consecutive and the byte length and timing match exactly. Any other strips, such as BlinkParallel-style strips on scattered pins, are sent one after another, each followed by its own latch. N strips therefore take about N× the wire time. That is a frame-rate regression.
    • RAM: the engine expands every data byte into 8 × u32 PIO words, 32 B of DMA RAM per byte. The legacy controller packs bits (about 1×). A 1,000-LED RGB strip needs about 96 KB with the engine versus about 3 KB today.
    • XTRA0: the engine ignores it. The legacy controller emits the extra zero bits.
    • Fallbacks: the engine has no equivalent of FASTLED_RP2040_CLOCKLESS_M0_FALLBACK (blocking M0 bit-bang when no state machine or DMA can be claimed) or of the !FASTLED_RP2040_CLOCKLESS_PIO build.
    • ParallelClocklessController (clockless_rp_pio_parallel.h) and the auto-parallel driver would stay as separate implementations anyway.

    Decision: under #4601's rule the conversion is neither flash-neutral nor at parity, so the duplicate stays. To revisit, first give ChannelEngineRpPio concurrent per-strip state machines and bit-packed DMA words, then re-measure. No RP hardware was attached, so nothing was validated on a device.

  6. moved this from Triage to Done in FastLED Trackeron Sep 25, 2026
  7. zackees commented on Sep 25, 2026

    @zackees
    MemberAuthor

    Reopened by maintainer decision: move RP2040/RP2350 legacy clockless onto the slim channels API (fl::SlimBridgeController over ChannelEngineRpPio), matching Teensy 4.x (#4617). Hardware testing is deferred. The prototype's measured costs will be tracked as follow-ups:

    • +35 KB flash on Blink;
    • strips are sent one after another unless on consecutive pins with the same length and timing;
    • about 32× the DMA memory;
    • no XTRA0 support and no blocking fallback.
  8. moved this from Done to Triage in FastLED Trackeron Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions