Skip to content

feat(rp): add fixed SPI loopback AutoResearch - #3671

Merged
zackees merged 1 commit into
masterfrom
feat/rp2040-spi-loopback-autoresearch
Jul 15, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/rp2040-spi-loopback-autoresearch

Conversation

@zackees

@zackees zackees commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add a documented --rp-spi-loopback AutoResearch mode for RP fixed SPI0/SPI1
  • capture SPI MISO through the real ChannelEngineRpSpi DMA path and require byte-exact data plus PL022 wire-idle
  • validate SPI0 on attached Raspberry Pi Pico at 1, 8, and 24 MHz

Validation

  • bash test channel_engine_rp_spi --debug
  • bash autoresearch rp2040 --rp-spi-loopback --rp-spi-index 0 --tx-pin 3 --rx-pin 0 --upload-port COM12 --timeout 120s --skip-lint

Refs #3659

Summary by CodeRabbit

  • New Features

    • Added RP2040 SPI loopback testing through the AutoResearch runner.
    • Added support for selecting SPI interfaces, configuring pins, and testing multiple clock rates.
    • Added RPC reporting for loopback results, including captured bytes, clock speed, wiring, and validation status.
    • Added DMA-based SPI receive capture for diagnostic loopback transfers.
  • Tests

    • Added coverage for argument parsing, test dispatch, DMA capture, and byte-accurate loopback validation.

@zackees
zackees merged commit 7d30a32 into master Jul 15, 2026
8 of 11 checks passed
@zackees
zackees deleted the feat/rp2040-spi-loopback-autoresearch branch July 15, 2026 17:40
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 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: 2e7bf7f5-de64-4c19-b31e-0771c2502519

📥 Commits

Reviewing files that changed from the base of the PR and between f7c17c9 and 03f3445.

📒 Files selected for processing (13)
  • ci/autoresearch/args.py
  • ci/autoresearch/phases.py
  • ci/autoresearch/test_rp_spi_loopback.py
  • ci/tests/test_autoresearch_phases.py
  • examples/AutoResearch/AutoResearchRemote.cpp
  • examples/AutoResearch/AutoResearchRemote.h
  • examples/AutoResearch/AutoResearchRemoteRpSpiMethods.cpp
  • src/platforms/arm/rp/rpcommon/channel_engine_rp_spi.cpp.hpp
  • src/platforms/arm/rp/rpcommon/channel_engine_rp_spi.h
  • src/platforms/arm/rp/rpcommon/irp_spi_peripheral.h
  • src/platforms/arm/rp/rpcommon/rp_spi_peripheral.cpp.hpp
  • src/platforms/arm/rp/rpcommon/rp_spi_peripheral.h
  • tests/platforms/arm/rp/rpcommon/channel_engine_rp_spi.cpp

📝 Walkthrough

Walkthrough

Adds RP2040 fixed-SPI DMA RX capture, an rpSpiLoopback remote RPC, autoresearch CLI selection, multi-rate byte validation, and unit coverage for capture and dispatch behavior.

Changes

RP SPI loopback

Layer / File(s) Summary
SPI DMA RX capture
src/platforms/arm/rp/rpcommon/*
Adds TX/RX DMA APIs, RX destination handling, pending capture state, and actual-clock tracking to the RP SPI peripheral and channel engine.
Remote loopback RPC
examples/AutoResearch/AutoResearchRemote*
Registers rpSpiLoopback, validates fixed SPI pins and clock arguments, performs captured transfers, and returns structured results.
Autoresearch mode and validation runner
ci/autoresearch/*
Adds RP2040 loopback arguments and dispatch, selects SPI wiring, discovers the RPC, and validates byte-exact results at multiple clock rates.
Loopback integration tests
tests/platforms/arm/rp/rpcommon/*, ci/tests/test_autoresearch_phases.py
Tests captured bytes, actual clock reporting, argument parsing, GPIO-only handling, and loopback dispatch.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • FastLED/FastLED#3668: Extends the same RP2040 fixed-SPI driver and DMA code paths used by this loopback capture implementation.

Sequence Diagram(s)

sequenceDiagram
  participant AutoresearchCLI
  participant phases
  participant test_rp_spi_loopback
  participant AutoResearchRemoteControl
  participant ChannelEngineRpSpi
  participant RpSpiPeripheral
  AutoresearchCLI->>phases: Enable rp_spi_loopback
  phases->>test_rp_spi_loopback: Run with SPI index and pin configuration
  test_rp_spi_loopback->>AutoResearchRemoteControl: Discover and call rpSpiLoopback
  AutoResearchRemoteControl->>ChannelEngineRpSpi: Request RX capture
  ChannelEngineRpSpi->>RpSpiPeripheral: Start TX DMA with RX destination
  RpSpiPeripheral-->>ChannelEngineRpSpi: Captured bytes and actual clock
  ChannelEngineRpSpi-->>AutoResearchRemoteControl: Transfer result
  AutoResearchRemoteControl-->>test_rp_spi_loopback: Return validation fields
Loading
✨ 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/rp2040-spi-loopback-autoresearch

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