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
Would it be feasible to port FastLED to the NXP LPC804 and/or LPC845?
Proposed solution
I have plenty of experience with these LPC8xx parts. I can do the porting work, but want to check first if it has already been done or can't be done for some reason.
Cortex M0+ 15MHz, 32k Flash, 4k RAM, USART, SPI, I2C, and a few timers. It does not seem to have any DMA. It does has a "Programmable Logic Unit" which is like a tiny FPGA, which has been demonstrated to generate the WS2812 data protocol.
Cortex M0+ 30MHz, 64k Flash, 16k RAM, all the typical MCU peripherals and has DMA. But I have not been able to find any examples in the wild of driving the WS2812 data stream from this chip.
I would probably try to adapt this approach of using 3 PWM generators to trigger DMA to write to GPIO outputs as shown here
Hi @phatpaul — short answer: yes, both are feasible, with the LPC804 being marginal-but-doable and the LPC845 being a clean port. Some research notes from the codebase to help you plan:
nRF51 (src/platforms/arm/nrf51/) — Cortex-M0 @ 16 MHz. This is the closest analogue to LPC804 in clock speed (16 MHz vs 15 MHz). It uses cycle-counted M0 assembly from src/platforms/arm/common/m0clockless_asm.h.
Teensy LC / KL26Z (src/platforms/arm/kl26/) — Cortex-M0+ @ 48 MHz. Closest M0+ template; declares FL_IS_ARM_M0_PLUS. Good structural reference for LPC845.
LPC804 (15 MHz) — bit-bang feasibility
Tight. The WS2812 timing macros in m0clockless_asm.h resolve roughly to:
T1 (350 ns) ≈ 5 cycles
T2 (800 ns) ≈ 12 cycles
T3 (450 ns) ≈ 7 cycles
That leaves only ~1 cycle of margin per phase once branch overhead is paid (3 cycles on M0, 2 on M0+). Bit-banging is on the edge of what works. Your PLU idea is the right call — offload the bit timing to dedicated hardware and let the CPU just shovel bytes.
The architectural pattern you want to mirror is the RP2040 PIO driver: src/platforms/arm/rp/rpcommon/clockless_rp_pio.h. PIO is conceptually similar to PLU (programmable bit-stream FSM driven by DMA/CPU). Study its do_dma_transfer() flow and CMinWait frame-rate gating; the LPC804+PLU driver would slot into the same ClocklessController template hierarchy.
LPC845 (30 MHz, DMA) — solid feasibility
Comfortable margins for either approach:
T1 ≈ 11 cycles, T2 ≈ 24 cycles, T3 ≈ 14 cycles — bit-banged ASM works cleanly. Use the KL26 driver (src/platforms/arm/kl26/clockless_arm_kl26.h) as your starting template.
Your PWM-channel + DMA-to-GPIO plan is also viable but novel in FastLED — no existing port does PWM→DMA→GPIO that way. Closest analogues are RP2040 PIO and the Teensy 4.x FlexIO driver (src/platforms/arm/teensy/teensy4_common/drivers/flexio/), which both coordinate hardware shift/output engines with DMA. If you start there, recommend bit-banged M0+ ASM first (smaller, proven, matches KL26 path), then PWM+DMA as a follow-up optimization.
Port wiring — where things plug in
Roughly what a new LPC subdir needs:
src/platforms/arm/lpc/is_lpc.h — detect via compiler macros (__LPC804__, __LPC845__, or whatever your toolchain provides)
src/platforms/arm/lpc/int.h — ARM 32-bit int typedefs
Hook into the ARM dispatcher: add #include "lpc/is_lpc.h" to src/platforms/arm/is_arm.h
Optional: SPI driver if you want APA102/SK9822 support
Recent ports like Renesas RA4 (UNO R4) and the SiLabs MGM240 show what a fresh ARM port looks like end-to-end — both are ~300–800 LOC per platform. Worth a git log src/platforms/arm/renesas/ and git log src/platforms/arm/silabs/ to see the actual diffs.
Porting reference
There's a platform-port agent/skill in this repo that walks through the steps in more detail — if you have Claude Code set up, /platform-port will guide you through it.
Happy to help review PRs once you get a skeleton up. Recommend starting with LPC845 + bit-banged M0+ driver (lowest-risk path), confirming WS2812 output works, then layering on the PLU/DMA variants.
Hardware verification (real SystemInit clock check, scope-traced WS2812 output on an LPCXpresso845, AutoResearch USART0 bring-up, fbuild CI flip from continue-on-error: true to required) and additional fbuild repo work (real SystemInit, vector table expansion, per-chip mcu_config split). These are tracked under #2845 along with the Stage 4 family expansion and APA102 SPI driver roadmap.
@phatpaul - cc you on the original ask. The code surface is ready for you (or any community member) to flash and validate on an LPCXpresso845 / LPC804 Breakout. The fbuild side is in fbuild v2.2.18; the FastLED platform code is in src/platforms/arm/lpc/.
Closing this issue since the feasibility question is conclusively answered as yes, and the concrete porting work has shipped at the code level via #2836 and the follow-on tracker #2845. Future LPC family / driver work continues in #2845.
@phatpaul — hardware bring-up offer for the LPC port
The LPC8xx / LPC11Uxx / LPC15xx FastLED port has now reached the point where every code-side piece that can land without silicon is shipped or in flight:
Stage 1 (fbuild bare-metal LPC804 / LPC845 support) — released as fbuild v2.2.18
What's blocked is Stage 3 — port completion on real silicon. From the roadmap meta #2845:
Hardware required — this stage cannot be completed by AI agents alone. Needs maintainer / @phatpaul / community member with an LPCXpresso845 (or LPC824 Lite / LPC845 Breakout Board) and a scope.
Specifically blocked:
3.1 / 3.2 real SystemInit — current LPC845 startup leaves the core at the 12 MHz IRC default while the board JSON advertises 30 MHz, so every bit-bang cycle-count macro is off by 2.5× until a board has been measured
3.5 linker memory-layout verification on hardware
3.6 AutoResearch UART integration (cycle counts must match real F_CPU first)
3.7 fbuild CI continue-on-error flip (gated on 3.5 + scope-verified blink)
Offer: if you'd like the hardware validation done so this port can graduate from "code compiles" to "WS2812 blinks on a real LPC845 board," I'm happy to take that on — but I need a board. If you'd be willing to send an LPCXpresso845 (or LPC845 Breakout Board, LPC824 Lite, or equivalent with an LPC11Uxx / LPC15xx variant if you have one to spare) to me, reach out at https://reddit.com/u/zachvorhies and we can arrange shipping.
Once silicon is on the bench: scope traces of the WS2812 / APA102 output, real-clock SystemInit, AutoResearch RPC over UART, and the CI continue-on-error flip would all land as follow-up PRs. The port becomes "shipped on hardware," not just "compiles."
cc/ this offer also goes to anyone else watching this issue with LPC hardware spare. The LPC11Uxx and LPC15xx variants would each unlock their own sub-tree of the same roadmap.
Activity
zackees commentedon Jun 5, 2026
Hi @phatpaul — short answer: yes, both are feasible, with the LPC804 being marginal-but-doable and the LPC845 being a clean port. Some research notes from the codebase to help you plan:
Existing LPC support
None.
src/platforms/arm/covers Kinetis (k20/k66/kl26), SAMD (d21/d51), nRF51/52, RP2040, SAM, STM32, Teensy 3.x/4.x, Renesas RA4, SiLabs MGM240 — but no NXP LPC family.Closest reference ports for you
src/platforms/arm/nrf51/) — Cortex-M0 @ 16 MHz. This is the closest analogue to LPC804 in clock speed (16 MHz vs 15 MHz). It uses cycle-counted M0 assembly fromsrc/platforms/arm/common/m0clockless_asm.h.src/platforms/arm/kl26/) — Cortex-M0+ @ 48 MHz. Closest M0+ template; declaresFL_IS_ARM_M0_PLUS. Good structural reference for LPC845.LPC804 (15 MHz) — bit-bang feasibility
Tight. The WS2812 timing macros in
m0clockless_asm.hresolve roughly to:That leaves only ~1 cycle of margin per phase once branch overhead is paid (3 cycles on M0, 2 on M0+). Bit-banging is on the edge of what works. Your PLU idea is the right call — offload the bit timing to dedicated hardware and let the CPU just shovel bytes.
The architectural pattern you want to mirror is the RP2040 PIO driver:
src/platforms/arm/rp/rpcommon/clockless_rp_pio.h. PIO is conceptually similar to PLU (programmable bit-stream FSM driven by DMA/CPU). Study itsdo_dma_transfer()flow andCMinWaitframe-rate gating; the LPC804+PLU driver would slot into the sameClocklessControllertemplate hierarchy.LPC845 (30 MHz, DMA) — solid feasibility
Comfortable margins for either approach:
src/platforms/arm/kl26/clockless_arm_kl26.h) as your starting template.src/platforms/arm/teensy/teensy4_common/drivers/flexio/), which both coordinate hardware shift/output engines with DMA. If you start there, recommend bit-banged M0+ ASM first (smaller, proven, matches KL26 path), then PWM+DMA as a follow-up optimization.Port wiring — where things plug in
Roughly what a new LPC subdir needs:
src/platforms/arm/lpc/is_lpc.h— detect via compiler macros (__LPC804__,__LPC845__, or whatever your toolchain provides)src/platforms/arm/lpc/int.h— ARM 32-bit int typedefssrc/platforms/arm/lpc/led_sysdefs_arm_lpc.h—FL_IS_ARM_M0_PLUS,F_CPU, interrupt policysrc/platforms/arm/lpc/fastpin_arm_lpc.h— pin/port mappingsrc/platforms/arm/lpc/clockless_arm_lpc.h(or_plu.h/_dma.hvariants) — driver#include "lpc/is_lpc.h"tosrc/platforms/arm/is_arm.hRecent ports like Renesas RA4 (UNO R4) and the SiLabs MGM240 show what a fresh ARM port looks like end-to-end — both are ~300–800 LOC per platform. Worth a
git log src/platforms/arm/renesas/andgit log src/platforms/arm/silabs/to see the actual diffs.Porting reference
There's a
platform-portagent/skill in this repo that walks through the steps in more detail — if you have Claude Code set up,/platform-portwill guide you through it.Happy to help review PRs once you get a skeleton up. Recommend starting with LPC845 + bit-banged M0+ driver (lowest-risk path), confirming WS2812 output works, then layering on the PLU/DMA variants.
zackees commentedon Jun 5, 2026
Hi, human here, i'm going to direct the AI to just do this.
k. thx bai.
feat(platform): LPC845 PWM+DMA-to-GPIO clockless driver (#2842)
feat(platform): LPC845 PWM+DMA-to-GPIO clockless driver (#2842) (#2850)
zackees commentedon Jun 6, 2026
Status — LPC8xx port shipped at the code/toolchain level
The feasibility analysis was confirmed and the port has shipped at the code surface. Where each chip stands today:
LPC845 (Cortex-M0+, 30 MHz, 64 KB Flash / 16 KB RAM)
LPC804 (Cortex-M0+, 15 MHz, 32 KB Flash / 4 KB RAM, PLU)
fbuild bare-metal toolchain support
Family expansion follow-ons (under #2845 Stage 4)
What remains
Hardware verification (real
SystemInitclock check, scope-traced WS2812 output on an LPCXpresso845, AutoResearch USART0 bring-up, fbuild CI flip fromcontinue-on-error: trueto required) and additional fbuild repo work (realSystemInit, vector table expansion, per-chipmcu_configsplit). These are tracked under #2845 along with the Stage 4 family expansion and APA102 SPI driver roadmap.@phatpaul - cc you on the original ask. The code surface is ready for you (or any community member) to flash and validate on an LPCXpresso845 / LPC804 Breakout. The fbuild side is in
fbuild v2.2.18; the FastLED platform code is insrc/platforms/arm/lpc/.Closing this issue since the feasibility question is conclusively answered as yes, and the concrete porting work has shipped at the code level via #2836 and the follow-on tracker #2845. Future LPC family / driver work continues in #2845.
feat(platform): LPC15xx (Cortex-M3) family detection scaffold
zackees commentedon Jun 6, 2026
@phatpaul — hardware bring-up offer for the LPC port
The LPC8xx / LPC11Uxx / LPC15xx FastLED port has now reached the point where every code-side piece that can land without silicon is shipped or in flight:
What's blocked is Stage 3 — port completion on real silicon. From the roadmap meta #2845:
Specifically blocked:
SystemInit— current LPC845 startup leaves the core at the 12 MHz IRC default while the board JSON advertises 30 MHz, so every bit-bang cycle-count macro is off by 2.5× until a board has been measuredF_CPUfirst)continue-on-errorflip (gated on 3.5 + scope-verified blink)Offer: if you'd like the hardware validation done so this port can graduate from "code compiles" to "WS2812 blinks on a real LPC845 board," I'm happy to take that on — but I need a board. If you'd be willing to send an LPCXpresso845 (or LPC845 Breakout Board, LPC824 Lite, or equivalent with an LPC11Uxx / LPC15xx variant if you have one to spare) to me, reach out at https://reddit.com/u/zachvorhies and we can arrange shipping.
Once silicon is on the bench: scope traces of the WS2812 / APA102 output, real-clock
SystemInit, AutoResearch RPC over UART, and the CIcontinue-on-errorflip would all land as follow-up PRs. The port becomes "shipped on hardware," not just "compiles."cc/ this offer also goes to anyone else watching this issue with LPC hardware spare. The LPC11Uxx and LPC15xx variants would each unlock their own sub-tree of the same roadmap.