Repository navigation
Description
Meta: Replace all hand-rolled LPC register maps with vendor CMSIS PAL headers
Single rollup tracking the end-to-end fix across three repos. All work coordinates here.
Why this exists
The FastLED LPC drivers (src/platforms/arm/lpc/) ship hand-rolled register-map shim structs because the toolchain (zackees/ArduinoCore-LPC8xx) ships only stub LPC845.h and LPC804.h headers (~50 lines each, IRQ enums + CMSIS-Core constants only — no peripheral typedefs). Those shims have shipped wrong offsets twice (#3349 fixed SYSCON.SYSAHBCLKCTRL0 _resv0[16]→[32] and DMA CHANNEL.CFG bit composition). Cross-checking the shims against NXP's canonical CMSIS PAL during this meta uncovered a third latent offset bug in the SCT shim (LIMIT/HALT/STOP/START split into nonexistent _L/_H 32-bit pairs).
"This seems like a waste of time debugging AI hallucinated register maps, when it would be so much easier and safer to use the vendor provided CMSIS Peripheral Access Layer. ... I want to remove all the hand-rolled register maps and require the use of the vendor provided CMSIS PAL files to build."
The pin chain — what needs to change
FastLED ci/boards.py + platformio.ini
↓ pinned by SHA 2ee527ae80de98e9105329a7260edb003289dfda ✓ firm
zackees/platform-nxplpc-arduino [v0.1.0]
↓ NOT pinned — platform.json uses bare URL for framework-arduino-lpc8xx ✗ STEP 2
↓ opportunistically resolved to 195a2eddd31eba8472ceaffa6a1a1902f72439ae
zackees/ArduinoCore-LPC8xx [HEAD-of-main floating]
↓ ships
variants/lpc845/LPC845.h [54-line stub, no peripheral typedefs] ✗ STEP 1
variants/lpc804/LPC804.h [49-line stub, no peripheral typedefs] ✗ STEP 1
cores/lpc8xx/lpc8xx_registers.h [hand-rolled, missing SCT + DMA] (informational)
FastLED CI surface (5 board workflows)
All five route through the same package stack; fixing the two stub headers fixes all five:
| Workflow | Board | Variant dir |
|---|---|---|
build_lpc845.yml |
lpc845 |
variants/lpc845/ |
build_lpc845brk.yml |
lpc845brk |
+ variants/lpc845/ |
build_lpcxpresso845max.yml |
lpcxpresso845max |
+ variants/lpc845/ |
build_lpc804.yml |
lpc804 |
variants/lpc804/ |
build_lpcxpresso804.yml |
lpcxpresso804 |
+ variants/lpc804/ |
FastLED hand-rolled register-map audit (8 sites across 6 files)
These all migrate to vendor typedefs in step 3.
A. Hand-rolled struct shims (struct FL_..._Shim + #define LPC_*)
- 1.
FL_LPC_SCT_Shim+#define LPC_SCT—clockless_arm_lpc_pwm_dma.h:225,269→SCT_Type/SCT0 - 2.
FL_LPC_DMA_Shim+FL_LPC_DMA_ChannelShim+#define LPC_DMA—clockless_arm_lpc_pwm_dma.h:273,279,310→DMA_Type/DMA0 - 3.
FL_LPC_SYSCON_Shim+#define LPC_SYSCON—clockless_arm_lpc_pwm_dma.h:314,321→SYSCON_Type/SYSCON(the shim @phatpaul fixed in WIP: LPC845 PWM+DMA driver implementation #3349) - 4.
FL_LPC_SPI_Type—spi_arm_lpc.h:60-72→SPI_Type/SPI0/SPI1 - 5.
FL_LPC11_LEGACY_GPIO_Type+#define LPC_GPIO0..3—fastpin_arm_lpc11_legacy.h:57-82→ vendorLPC_GPIO_Type(LPC11xx upstream; out of CI for now)
B. Raw base + offset MMIO
- 6.
FL_LPC_GPIO_*_OFFSET+ fallback helpers —fastpin_arm_lpc.h:55-86→GPIO_Type(file already prefers vendorLPC_GPIO; delete#elsefallback) - 7.
kPluBase,kSysconBase,kOff*PLU offsets +reg32(base, off)—clockless_arm_lpc_plu.h:82-180→ LPC804 vendorPLU_Type+SYSCON_Type - 8.
kSctBase,kDmaBase,kSwmBase,kSysconBase, dozens ofkOff*+reg(base, off)—rx_sct_capture.cpp.hpp:80-220→SCT_Type,DMA_Type,SWM_Type,SYSCON_Type
Verified cross-checks against the vendor PAL
While preparing the now-reverted V1 prototype (commits 0365745f7 + c047a586b on feat/3437-lpc-cmsis-vendoring), each shim was cross-checked against nxp-mcuxpresso/mcux-sdk/devices/LPC845/LPC845.h (rev. 1.2, BSD-3-Clause):
- ✅
SYSCON_Type.SYSAHBCLKCTRL0at offset0x80— confirms @phatpaul's WIP: LPC845 PWM+DMA driver implementation #3349 fix. Pre-WIP: LPC845 PWM+DMA driver implementation #3349 master shim places it at0x40(wrong). - ✅
DMA_Type.CHANNEL[].CFG/CTLSTAT/XFERCFGper-channel layout matches the shim. The common-register block usesDMA0->COMMON[0].INTENSET(vendor) instead ofLPC_DMA->INTENSET0(shim) — a member-name rename for step 3. ⚠️ SCT_Typelatent offset bug — shim splitsLIMIT/HALT/STOP/STARTinto pairs of_L/_H32-bit registers (8 bytes each); vendor has each as a single 32-bit register (4 bytes), with optional 16-bit access via inner unions. Every shim member fromCOUNT_Uonward is 16 bytes too high. Driver doesn't dereference those today — latent.
End-to-end fix sequence
Step 1 — Content gap (upstream zackees/ArduinoCore-LPC8xx)
Replace variants/lpc845/LPC845.h and variants/lpc804/LPC804.h stubs with the full NXP CMSIS PAL headers from nxp-mcuxpresso/mcux-sdk/devices/LPC845/LPC845.h and devices/LPC804/ (BSD-3-Clause). Also vendor companion system_LPC845.h / system_LPC804.h. Tag a release once merged.
Provides peripheral typedefs (SCT_Type, DMA_Type, SYSCON_Type, SPI_Type, GPIO_Type, SWM_Type, IOCON_Type, PINT_Type, INPUTMUX_Type, PLU_Type for LPC804) and pointer macros (SCT0, DMA0, SYSCON, etc.).
Step 2 — Pin gap (upstream zackees/platform-nxplpc-arduino)
Pin framework-arduino-lpc8xx to a specific SHA / tag in platform.json (currently a bare URL). Bump to the post-step-1 SHA. Tag a release.
Today's platform.json:
"framework-arduino-lpc8xx": {
"type": "framework",
"optional": true,
"version": "https://github.com/zackees/ArduinoCore-LPC8xx.git"
}After step 1 lands:
"framework-arduino-lpc8xx": {
"type": "framework",
"optional": true,
"version": "https://github.com/zackees/ArduinoCore-LPC8xx.git#<post-step-1-sha>"
}Step 3 — FastLED consumes (this repo)
- V5a Bump
_NXPLPC_PLATFORMSHA inci/boards.py+platformio.inito the post-step-2 SHA - V5b Add
#include <LPC845.h>toled_sysdefs_arm_lpc.hinsideFL_IS_ARM_LPC_845guard; same for<LPC804.h>insideFL_IS_ARM_LPC_804 - V6 Delete the 8 hand-rolled sites listed above; migrate every call site to vendor typedefs (
SCT0->CONFIG,DMA0->CHANNEL[i].CFG,SYSCON->SYSAHBCLKCTRL0, etc.) - V7 Add
#errorguard inled_sysdefs_arm_lpc.hif the vendor header is missing — no silent fallback - Verify All 5 LPC CI workflows green:
build_lpc845,build_lpc845brk,build_lpcxpresso845max,build_lpc804,build_lpcxpresso804 - Update Retire the "Worked anti-example: LPC845" section in
agents/docs/register-maps.md
Fallback if upstream step 1 or step 2 declines
In-tree tier-2 vendoring under src/platforms/arm/lpc/third_party/cmsis/{LPC845.h,LPC804.h,system_LPC845.h,system_LPC804.h} from nxp-mcuxpresso/mcux-sdk (BSD-3-Clause). The third_party/ path inherits FastLED's existing linter exemption for vendored code. See reverted commits 0365745f7 + c047a586b on branch feat/3437-lpc-cmsis-vendoring for the working prototype + cmsis/README.md provenance template.
Out of scope (track separately when relevant)
- LPC11xx / LPC15xx — Compile-only in this repo today (no CI yet per LPC README). When they enter CI, file equivalent upstream issues against whatever toolchain package they use.
- AutoResearch hardware verification — Tracked separately at #2880.
Cross-references
- Originating PR: #3349 — @phatpaul's WIP LPC845 PWM+DMA; blocked on step 3
- Audit-list landing PR: #3438 — docs-only docs of the 8-site audit
- Authoring policy:
agents/docs/register-maps.md - Originating bug: #2990 (original
SYSAHBCLKCTRL0offset bug) - NXP UMs: UM11029 (LPC84x), UM11065 (LPC80x), UM10398 (LPC111x), UM10462 (LPC11U)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
Revert: drop vendoring, pivot to upstream fix in zackees/ArduinoCore-…
zackees commentedon Jun 28, 2026
Update — pivot to upstream fix. Investigation in PR #3438 revealed:
zackees/ArduinoCore-LPC8xx) ships only a 54-lineLPC845.hstub — IRQ enums + CMSIS-Core constants, no peripheral typedefs. That's the entire reason FastLED's hand-rolled shims exist.cores/lpc8xx/lpc8xx_registers.his itself a hand-rolled minimal subset (SYSCON, IOCON, SWM, USART, SPI — no SCT, no DMA) and its own SYSCON struct documents the LPC82x-vs-LPC845 offset bug @phatpaul fixed in WIP: LPC845 PWM+DMA driver implementation #3349.Path forward updated: tier-1 (upstream ships the full vendor header) is preferred over tier-2 (FastLED vendors). Upstream issue filed at zackees/ArduinoCore-LPC8xx#33 requesting the full NXP LPC845.h be shipped in
variants/lpc845/. Once that lands, FastLED can#include <LPC845.h>directly fromled_sysdefs_arm_lpc.hand delete every row in the audit list with zero in-tree vendoring.PR #3438 now reverts the original V1 vendoring and ships just the audit list + policy clarification.
Updated milestones
#include <LPC845.h>intoled_sysdefs_arm_lpc.h(tier-1, no vendoring)The cross-check evidence (SYSAHBCLKCTRL0=0x80, DMA CHANNEL layout, latent SCT
_L/_Hsplit bug) is preserved in #3438's body and the upstream issue.Fallback path
If upstream declines, V1-fallback = FastLED-side tier-2 vendoring under
src/platforms/arm/lpc/third_party/cmsis/. Thethird_party/path component would inherit the existing FastLED linter exemption for vendored code.🤖 Generated with Claude Code
zackees commentedon Jun 28, 2026
Gap analysis — what "completely solved" needs across all LPC test versions.
Pin chain audit
FastLED CI surface (5 board workflows)
All five route through the same package stack:
build_lpc845.ymllpc845(raw LPC845M301)build_lpc804.ymllpc804(raw LPC804M101)build_lpc845brk.ymllpc845brk(LPC845 Breakout Board)build_lpcxpresso845max.ymllpcxpresso845max(LPCXpresso845-MAX dev board)build_lpcxpresso804.ymllpcxpresso804(LPCXpresso804 dev board)All five compile against
cores/lpc8xx/+ the appropriatevariants/<board>/directory, which means all five see the stubLPC845.h/LPC804.hand have to fall back on FastLED's hand-rolled shims.End-to-end fix chain (now tracked)
Three repos must coordinate. Each issue below has the cross-references it needs to be picked up independently.
Step 1 — Upstream content gap
📌 zackees/ArduinoCore-LPC8xx#33 — ship full NXP CMSIS PAL into
variants/lpc845/LPC845.h+variants/lpc804/LPC804.h(both currently stubs).Step 2 — Upstream pin gap
📌 zackees/platform-nxplpc-arduino#8 — pin
framework-arduino-lpc8xxby SHA inplatform.json(currently a bare URL), then bump to the post-#33 SHA after step 1 lands.Step 3 — FastLED-side consumption (this meta)
After steps 1 + 2 ship:
_NXPLPC_PLATFORMSHA inci/boards.py+platformio.inito the newplatform-nxplpc-arduinorelease SHA#include <LPC845.h>(and<LPC804.h>) toled_sysdefs_arm_lpc.hinsideFL_IS_ARM_LPC_845/FL_IS_ARM_LPC_804guardsSCT0,DMA0,SYSCON,SPI0,SPI1,GPIO,SWM0,IOCON)#errorguard inled_sysdefs_arm_lpc.hif vendor header is missinglpc845,lpc804,lpc845brk,lpcxpresso845max,lpcxpresso804Fallback if upstream declines either step
Tier-2 in-tree vendoring under
src/platforms/arm/lpc/third_party/cmsis/{LPC845.h,LPC804.h,system_LPC845.h,system_LPC804.h}— thethird_party/path inherits FastLED's existing linter exemption for vendored code. See reverted commits0365745f7+c047a586bon branchfeat/3437-lpc-cmsis-vendoringfor the working prototype.Out of scope for this meta
LPC11xx / LPC15xx aren't currently in CI (README lists them as compile-only with bring-up pending). When they enter CI, the same three-step fix chain applies — file equivalents at
nxp-mcuxpresso/mcux-devices-lpcupstream for those chip families.🤖 Generated with Claude Code
feat: pin framework-arduino-lpc8xx by SHA, bump to v0.2.0 (#9)
feat(lpc): bump platform SHA to v0.2.0, include vendor CMSIS PAL
feat(lpc): migrate PWM+DMA driver + SPI driver to vendor CMSIS PAL
feat(lpc): migrate LPC804 PLU driver to vendor CMSIS PAL + protect IN…
feat(lpc): #error guard if vendor PAL missing + docs update (#3437)
zackees commentedon Jun 28, 2026
Closed by PR #3438 — merged to master at
defbb345.End-to-end resolution across 3 repos:
50d76e0d12265f76defbb345Audit sites resolved:
FL_LPC_SCT_Shimdeleted → vendorSCT0->FL_LPC_DMA_Shimdeleted → vendorDMA0->(+ @phatpaul's WIP: LPC845 PWM+DMA driver implementation #3349CHANNEL.CFGfix folded in)FL_LPC_SYSCON_Shimdeleted → vendorSYSCON->FL_LPC_SPI_Typedeleted → vendorSPI_Typefastpin_arm_lpc.hfallback retained for LPC11Uxx/LPC15xx until vendor CMSIS lands for those familiesPLU_Type(also uncovered 3 additional latent register-block offset bugs)rx_sct_capture.cpp.hpp(opt-in driver, ~48 register accesses, mechanical follow-up)5/8 sites migrated. 3 deferred sites tracked in
src/platforms/arm/lpc/README.md.Latent register-offset bugs eliminated structurally:
SYSCON.SYSAHBCLKCTRL0offset (was0x40pre-WIP: LPC845 PWM+DMA driver implementation #3349, vendor truth0x80— corroborates @phatpaul's WIP: LPC845 PWM+DMA driver implementation #3349)CHANNEL.CFGmissing PERIPHREQEN (@phatpaul's WIP: LPC845 PWM+DMA driver implementation #3349 fix applied)LIMIT/HALT/STOP/STARTinto_L/_H32-bit pairs (vendor has each as single 32-bit reg; every shim member fromCOUNTonwards was 16 bytes too high — newly uncovered)LUT_TRUTHat0x000instead of0x800(newly uncovered)OUTPUT_MUXat0x800instead of0xC00(newly uncovered)LUT_INP_MUXat0xC00instead of0x000(newly uncovered)Tier-1 path per
agents/docs/register-maps.mdnow operational across all 5 LPC8xx CI workflows. @phatpaul's #3349 is unblocked — he can rebase his PWM+DMA bring-up on a vendor-PAL foundation.feat(lpc): vendor NXP LPC845.h CMSIS PAL header (FastLED#3437 V1)
feat: ship full NXP CMSIS PAL in variants/lpc845/ + variants/lpc804/ (F…
docs(lpc): refresh README with SCT/DMA channels engine + SPI DMA driv…
fix(lpc): compile-time assert rx_sct_capture bases match vendor CMSIS…
fix(lpc): WWDT actually arms now (MOD/TC swap) + NMI wedge backtrace …
fix(lpc): SPI+DMA driver works on silicon — 6 stacked hardware bugs (c…
Delegate all flashing to fbuild + LPC845 drivers + ban raw pyserial i…