Skip to content

feat(rp2040): add UART DMA channel driver - #3665

Merged
zackees merged 1 commit into
masterfrom
feat/rp2040-phase4-uart-rx
Jul 15, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/rp2040-phase4-uart-rx

Conversation

@zackees

@zackees zackees commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Closes #3657\n\nImplements Phase 4 UART TX DMA bring-up for RP2040/RP2350:\n- UART0/UART1 Bus::UART lanes with documented TX pin mux validation\n- transactional UART/DMA/GPIO ownership plus rollback\n- DMA BUSY, PL011 wire DRAINING, latch interval, and error cleanup\n- neutral UART wave encoder entry point with backend-specific baud ceilings\n- host coverage for 256 bytes, queues, error cleanup, latch, baud admission, and ledger ownership\n\nValidation:\n- �ash test channel_engine_rp_uart --debug\n- �ash test channel_engine_rp_uart --cpp\n- �ash test rp_resource_ledger --debug\n- uv run --no-sync python ci/lint_cpp/run_all_checkers.py --no-rust\n\nHardware fbuild target is not configured in this repository's platformio.ini; physical validation remains tracked by #3631/#3661.

Summary by CodeRabbit

  • New Features
    • Added UART-based clockless LED output support for RP2040 and RP2350 boards.
    • Enabled both UART0 and UART1 for supported hardware TX pins.
    • Added DMA-driven transmission with queuing, timing validation, and automatic resource management.
    • Added configurable baud-rate limits to improve compatibility across chipset timings.
  • Bug Fixes
    • Improved cleanup and recovery when UART, DMA, or transmission setup fails.
  • Tests
    • Added coverage for encoding, queuing, timing validation, failure handling, and hardware-resource ownership.

@zackees
zackees merged commit f87a354 into master Jul 15, 2026
8 of 11 checks passed
@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: bbd220a1-0e1f-4ac5-bb9e-83e2e39455de

📥 Commits

Reviewing files that changed from the base of the PR and between 2fda0c6 and d618b80.

📒 Files selected for processing (17)
  • src/fl/channels/bus.h
  • src/fl/channels/uart_wave_encoder.cpp.hpp
  • src/fl/channels/uart_wave_encoder.h
  • src/platforms/arm/rp/rpcommon/_build.cpp.hpp
  • src/platforms/arm/rp/rpcommon/channel_engine_rp_uart.cpp.hpp
  • src/platforms/arm/rp/rpcommon/channel_engine_rp_uart.h
  • src/platforms/arm/rp/rpcommon/init_channel_driver_rp.cpp.hpp
  • src/platforms/arm/rp/rpcommon/irp_uart_peripheral.h
  • src/platforms/arm/rp/rpcommon/rp_pio_dma_resource_manager.h
  • src/platforms/arm/rp/rpcommon/rp_resource_ledger.h
  • src/platforms/arm/rp/rpcommon/rp_uart_bus_traits.h
  • src/platforms/arm/rp/rpcommon/rp_uart_peripheral.cpp.hpp
  • src/platforms/arm/rp/rpcommon/rp_uart_peripheral.h
  • src/platforms/esp/32/drivers/uart/wave8_encoder_uart.cpp.hpp
  • src/platforms/esp/32/drivers/uart/wave8_encoder_uart.h
  • tests/platforms/arm/rp/rpcommon/channel_engine_rp_uart.cpp
  • tests/platforms/arm/rp/rpcommon/rp_resource_ledger.cpp

📝 Walkthrough

Walkthrough

Adds RP2040/RP2350 UART clockless transmission using baud-constrained wave encoding, DMA-backed peripheral control, resource ownership tracking, UART bus registration, and host tests covering transmission and failure states.

Changes

RP UART clockless transmission

Layer / File(s) Summary
Baud-constrained UART encoding
src/fl/channels/uart_wave_encoder.*, src/platforms/esp/32/drivers/uart/wave8_encoder_uart.*
Adds neutral UART encoder forwarding and configurable maximum-baud LUT construction and timing validation.
RP UART peripheral and ownership
src/platforms/arm/rp/rpcommon/irp_uart_peripheral.h, rp_resource_ledger.h, rp_pio_dma_resource_manager.h, rp_uart_peripheral.*
Defines the UART/DMA peripheral contract, tracks UART ownership, acquires UART/pin/DMA resources transactionally, and implements RP UART DMA transmission.
UART channel engine and lifecycle tests
src/platforms/arm/rp/rpcommon/channel_engine_rp_uart.*, tests/platforms/arm/rp/rpcommon/channel_engine_rp_uart.cpp, tests/platforms/arm/rp/rpcommon/rp_resource_ledger.cpp
Adds queueing, encoding, DMA/wire-drain state handling, latch timing, cleanup, failure reporting, and host tests for normal and error paths.
UART bus registration and build wiring
src/fl/channels/bus.h, src/platforms/arm/rp/rpcommon/rp_uart_bus_traits.h, init_channel_driver_rp.cpp.hpp, _build.cpp.hpp
Adds two RP UART bus instances, registers UART0 and UART1 drivers, marks clockless UART support, and includes the implementation units in the RP build.

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

Possibly related issues

  • FastLED/FastLED issue 3657 — The PR implements the issue’s RP UART clockless TX scope, including encoding, DMA transmission, UART bus binding, and host tests.

Possibly related PRs

  • FastLED/FastLED#3662 — Introduces the RP resource ownership infrastructure extended here with UART claim/release tracking and APIs.
✨ 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-phase4-uart-rx

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.

feat(rp2040): phase 4 — UART clockless TX and first RX byte match

1 participant