Skip to content

feat(lpc845): make UART DMA the default AUTO clockless channel path #3611

Closed

Description

@zackees

Context

PR #3349 discussion exposed the remaining integration gap for LPC845 UART DMA: src/platforms/arm/lpc/uart_arm_lpc_dma.h exists and is already bench-tested by bash autoresearch lpc845 --dma-uart, but it is still only a raw transport helper. It is not wired into the Channels API, FastLED.addLeds<>, or FastLED.add(cfg).

Current state before this work:

  • FASTLED_LPC_UART_DMA=1 enables fl::ARMHardwareUARTOutputDMA<TX_PIN, BAUD>.
  • bash autoresearch lpc845 --dma-uart validates raw async USART1 TX via DMA0 channel 3 while USART0 remains the RPC console.
  • LPC845 clockless AUTO/default routing still resolves to Bus::BIT_BANG.
  • The existing SCT/DMA channel path is behind FASTLED_LPC_PWM_DMA=1 and uses Bus::BIT_BANG.
  • There is no LPC BusTraits<Bus::UART> channel engine yet.

Datasheet / primary source

Use the FastLED datasheets repo before guessing register behavior:

AutoResearch docs / runbooks

Agents implementing this should start from these docs and existing harnesses:

Important testing rule from the runbook: device serial must go through fbuild/RpcClient, not raw pyserial, and deploy remains fbuild deploy's job.

Proposal

Add an LPC845-only UART DMA clockless channel driver and make it the default clockless path when FASTLED_LPC_UART_DMA=1.

Expected routing:

  • Bus::AUTO / default FastLED.addLeds<WS2812, PIN, GRB>(...) on LPC845 + FASTLED_LPC_UART_DMA=1 selects UART DMA.
  • Explicit fl::Bus::UART selects the UART DMA channel driver.
  • Explicit fl::Bus::BIT_BANG still forces the bit-bang fallback.
  • Do not add per-USART public bus enums. Keep the public bus as Bus::UART; hide USART instance choice behind the LPC driver/traits, since LPC845 has several USARTs and users should not need to pick a bus type manually.

Acceptance criteria

  • FASTLED_LPC_UART_DMA=1 FASTLED_LPC_DMA_ISR=1 builds on LPC845.
  • FastLED.addLeds<WS2812, PIN, GRB>(...) uses the UART DMA channel path by default on LPC845 when FASTLED_LPC_UART_DMA=1.
  • FastLED.add(cfg) with cfg.options.mBus = fl::Bus::AUTO also selects UART DMA for clockless LPC845 output under the same flag.
  • cfg.options.mBus = fl::Bus::UART explicitly selects UART DMA.
  • cfg.options.mBus = fl::Bus::BIT_BANG remains a working explicit bit-bang override.
  • AutoResearch has a UART clockless loopback test that drives through the normal FastLED LED API, routes USART RXD through SWM to the configured --rx-pin, captures via USART RX-DMA, and byte-compares the encoded WS2812 data.
  • The existing raw transport bench still passes: bash autoresearch lpc845 --dma-uart.
  • New end-to-end acceptance passes on hardware: bash autoresearch lpc845 --uart --tx-pin <TX> --rx-pin <RX>, using fbuild deploy/serial only.

Related

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