You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementation Phase 6 of #3648. Depends on Phase 5 (clockless PIO TX wire proof).
Scope
Implement a true-SPI IChannelDriver for RP2040 SPI0/SPI1, separate from PIO parallel SPI. Use Pico SDK SPI APIs, declarative mux-valid pin groups, TX DMA plus RX-drain DMA/sink, selected-clock validation, timeout/error handling, and wire-idle completion (spi_is_busy() == false).
Acceptance criteria
Host tests cover both instances, pin pairing, mode 0, clock clamping, DREQ/FIFO handling, timeout, failure paths, isInUse, and cleanup.
DMA completion is never treated as proof that the last wire bit has left the PL022.
Attached-board gate
Before any LED protocol test, prove SPI0 and SPI1 MOSI-to-MISO loopback at multiple clock rates using AutoResearch/fbuild JSON-RPC. Record non-overflow byte-exact data, wire idle, and resource/memory snapshots.
Software implementation merged in #3668 (commit 0c64dc4). It adds separate fixed-function SPI0/SPI1 PL022 drivers with canonical mux triples, mode-0/MSB-first configuration, paired TX + RX-drain DMA, ownership rollback, timeout/error cleanup, and spi_is_busy() wire-idle completion.\n\nHost coverage passed for both instances, mux pairing, mode 0, clock clamping, both DMA completion gates, wire drain, timeout/error cleanup, and ledger ownership. This phase remains open solely for its explicit attached-board gate: byte-exact SPI0 and SPI1 MOSI-to-MISO loopback at multiple rates via AutoResearch/fbuild after #3631 has physical headers/jumpers available. No fbuild defect was observed or filed: this checkout has no RP fbuild target configured, so no valid RP deployment invocation exists yet.
Hardware bring-up update (FastLED #3648): the attached Pico (2E8A:000A, COM12) passed the sanctioned fbuild → AutoResearch → fbuild-backed JSON-RPC GPIO gate on 2026-07-15. fbuild wrote G:\NEW.UF2, returned COM12, and segmented discovery found the installed GPIO0↔GPIO1 loopback.
That validates the board, USB recovery, RPC transport, and generic GPIO oracle, but it is not an SPI loopback: RP2040 SPI0 has no MOSI/MISO mux on GPIO1. The smallest Phase-6 wiring change is GPIO3 (SPI0 TX/MOSI) → GPIO0 (SPI0 RX/MISO), with GPIO2 as SCK. After that, qualify SPI0 at multiple rates. The corresponding SPI1 configuration is GPIO11 (MOSI) → GPIO8 (MISO), with GPIO10 as SCK.
Keeping this issue open until those true-SPI byte-exact and wire-idle results are captured; Phase 7 remains correctly blocked on it. Related fbuild recovery evidence: FastLED/fbuild#1049 and FastLED PR #3670.
Result: GPIO3 -> GPIO0 pre-test passed. The real ChannelEngineRpSpi / SPI0 DMA loopback captured all 32 bytes exactly at 1 MHz, 8 MHz, and 24 MHz; each response reported the requested actual clock and PL022 wire idle.
The reusable mode also supports SPI1. Remaining Phase 6 hardware gate: move the single jumper from GPIO3 -> GPIO0 to GPIO11 (SPI1 MOSI) -> GPIO8 (SPI1 MISO). Leave GPIO10 (SPI1 SCK) unconnected. Then run the same command with --rp-spi-index 1 --tx-pin 11 --rx-pin 8.
fbuild cache invalidation discovered during this work is filed separately as FastLED/fbuild#1075.
Phase 6 is complete. Post-merge attached-board validation was run from origin/master at 7d30a32 (FastLED PR #3671) on Raspberry Pi Pico RP2040, COM12 (USB 2E8A:000A, serial 5303284720C4641C).\n\nCommand:\n\�ash autoresearch rp2040 --rp-spi-loopback --rp-spi-index 1 --tx-pin 11 --rx-pin 8 --upload-port COM12 --timeout 120s --skip-lint --clean\n\nWiring: GPIO11 SPI1 MOSI -> GPIO8 SPI1 MISO; GPIO10 was SPI1 SCK output only (no SCK jumper). GPIO pre-test passed. The fbuild JSON-RPC test used ChannelEngineRpSpi / BusTraits<Bus::SPI, 1> and captured 32-byte MISO data exactly at 1, 8, and 24 MHz; reported clocks were 1,000,000, 8,000,000, and 24,000,000 Hz respectively, and each run proved PL022 wire idle. SPI0 had already passed the same post-merge acceptance ladder at GPIO3 MOSI -> GPIO0 MISO with GPIO2 SCK.\n\nThe accompanying host coverage and hardware harness are merged in #3671. The clean deploy also exercised the fbuild deployment path; its separate stale-stage-cache defect is tracked in FastLED/fbuild#1075.
Activity
zackees commentedon Jul 15, 2026
Software implementation merged in #3668 (commit 0c64dc4). It adds separate fixed-function SPI0/SPI1 PL022 drivers with canonical mux triples, mode-0/MSB-first configuration, paired TX + RX-drain DMA, ownership rollback, timeout/error cleanup, and spi_is_busy() wire-idle completion.\n\nHost coverage passed for both instances, mux pairing, mode 0, clock clamping, both DMA completion gates, wire drain, timeout/error cleanup, and ledger ownership. This phase remains open solely for its explicit attached-board gate: byte-exact SPI0 and SPI1 MOSI-to-MISO loopback at multiple rates via AutoResearch/fbuild after #3631 has physical headers/jumpers available. No fbuild defect was observed or filed: this checkout has no RP fbuild target configured, so no valid RP deployment invocation exists yet.
zackees commentedon Jul 15, 2026
Hardware bring-up update (FastLED #3648): the attached Pico (2E8A:000A, COM12) passed the sanctioned fbuild → AutoResearch → fbuild-backed JSON-RPC GPIO gate on 2026-07-15. fbuild wrote G:\NEW.UF2, returned COM12, and segmented discovery found the installed GPIO0↔GPIO1 loopback.
That validates the board, USB recovery, RPC transport, and generic GPIO oracle, but it is not an SPI loopback: RP2040 SPI0 has no MOSI/MISO mux on GPIO1. The smallest Phase-6 wiring change is GPIO3 (SPI0 TX/MOSI) → GPIO0 (SPI0 RX/MISO), with GPIO2 as SCK. After that, qualify SPI0 at multiple rates. The corresponding SPI1 configuration is GPIO11 (MOSI) → GPIO8 (MISO), with GPIO10 as SCK.
Keeping this issue open until those true-SPI byte-exact and wire-idle results are captured; Phase 7 remains correctly blocked on it. Related fbuild recovery evidence: FastLED/fbuild#1049 and FastLED PR #3670.
zackees commentedon Jul 15, 2026
[Phase 6] SPI0 HIL accepted after PR #3671 merged (7d30a32).
Post-merge board: Raspberry Pi Pico SDK CDC UART on COM12 (VID:PID 2E8A:000A).
Validated on origin/master with fbuild only:
bash autoresearch rp2040 --rp-spi-loopback --rp-spi-index 0 --tx-pin 3 --rx-pin 0 --upload-port COM12 --timeout 120s --skip-lint --clean
Result: GPIO3 -> GPIO0 pre-test passed. The real ChannelEngineRpSpi / SPI0 DMA loopback captured all 32 bytes exactly at 1 MHz, 8 MHz, and 24 MHz; each response reported the requested actual clock and PL022 wire idle.
The reusable mode also supports SPI1. Remaining Phase 6 hardware gate: move the single jumper from GPIO3 -> GPIO0 to GPIO11 (SPI1 MOSI) -> GPIO8 (SPI1 MISO). Leave GPIO10 (SPI1 SCK) unconnected. Then run the same command with --rp-spi-index 1 --tx-pin 11 --rx-pin 8.
fbuild cache invalidation discovered during this work is filed separately as FastLED/fbuild#1075.
zackees commentedon Jul 15, 2026
Phase 6 is complete. Post-merge attached-board validation was run from origin/master at 7d30a32 (FastLED PR #3671) on Raspberry Pi Pico RP2040, COM12 (USB 2E8A:000A, serial 5303284720C4641C).\n\nCommand:\n\�ash autoresearch rp2040 --rp-spi-loopback --rp-spi-index 1 --tx-pin 11 --rx-pin 8 --upload-port COM12 --timeout 120s --skip-lint --clean\n\nWiring: GPIO11 SPI1 MOSI -> GPIO8 SPI1 MISO; GPIO10 was SPI1 SCK output only (no SCK jumper). GPIO pre-test passed. The fbuild JSON-RPC test used ChannelEngineRpSpi / BusTraits<Bus::SPI, 1> and captured 32-byte MISO data exactly at 1, 8, and 24 MHz; reported clocks were 1,000,000, 8,000,000, and 24,000,000 Hz respectively, and each run proved PL022 wire idle. SPI0 had already passed the same post-merge acceptance ladder at GPIO3 MOSI -> GPIO0 MISO with GPIO2 SCK.\n\nThe accompanying host coverage and hardware harness are merged in #3671. The clean deploy also exercised the fbuild deployment path; its separate stale-stage-cache defect is tracked in FastLED/fbuild#1075.
feat(rp): add fixed SPI loopback autoresearch