Repository navigation
Fix compilation for NRF52 chips with a single GPIO port such as NRF52832 - #900
Conversation
nrf52832, nrf52810, and nrf52811 have a single GPIO port, and do not define NRF_P1_BASE. If NRF_P1_BASE is not defined, do not define the generated structures requried to access GPIO port 1.
|
@etmeister -- this looks like it might resolve your issue in #919. |
|
@focalintent -- FYI, this is hitting multiple folks now. This fix is small and targeted. I strongly support merging this PR. |
|
Hi Henry, and thank you very much for your contribution. As you may or may not have heard, we lost Dan @focalintent in a boat fire off the California coast in early September. FastLED will continue; I’m working out how best to proceed and hope to have some things in place in the next couple of weeks. Thank you again for your patience, and for your understanding. |
|
@kriegsman -- I was not aware... I am so sorry to hear that, Mark. 😞 Let me know if there's anything I can do to help. |
|
@maddogjt Hey Jason! I just got a new Adafruit Feather nRF52840 Express and I am attempting to get this to compile. I have edited the /Arduino/libraries/FastLED/platforms/arm/nrf52/fastpin_arm_nrf52.h file with your changes but I am still getting these same errors: |
|
See #938. |
|
Looks like some PRs are being integrated again! 🎉 |
|
Thanks for the contributions and help with the FastLED library! |
…#3468) (#3475) While validating the #3468 harness on real LPC845-BRK silicon (VID:PID 1FC9:0132 on COM10), three separate blockers prevented `bash compile lpc845brk --examples AutoResearch --build-flag -DFASTLED_LPC_PWM_DMA=1` from producing a firmware image. Each is a legitimate bug fix and lands here together because they are only observable end-to-end when the LPC compile path actually gets exercised. ## Fix 1 — `ci/boards.py`: nxplpc@ prefix workaround fbuild 2.3.15 shipped 2026-06-30 20:09 UTC; my platform-matcher fix FastLED/fbuild#900 merged 2026-06-30 21:47 UTC (after 2.3.15 was cut). 2.3.15's matcher still only substring-matches `nxplpc` (no separator) and rejects the hyphenated `nxp-lpc` in the raw GitHub URL. Prepending `nxplpc@` to the platform URL is valid PlatformIO name-at-source syntax and makes the substring match, unblocking the build under 2.3.15. Once fbuild 2.3.16 ships with #900 the prefix becomes redundant but stays syntactically valid. ## Fix 2 — `led_sysdefs_arm_lpc.h`: define `FASTLED_HAS_CMSIS` `src/platforms/arm/common/m0clockless_c.h:51` guards the local `__get_PRIMASK` / `__enable_irq` / `__disable_irq` stubs with `#if !defined(FASTLED_HAS_CMSIS)`, and the comment on that guard says "LPC builds set FASTLED_HAS_CMSIS in led_sysdefs". But the define was never actually added — so LPC builds got the local stubs plus the vendor CMSIS versions from `core_cm0plus.h` and gcc rejected the pair with error: redefinition of 'fl::u32 __get_PRIMASK()' Adding `#define FASTLED_HAS_CMSIS 1` in `led_sysdefs_arm_lpc.h` immediately after the vendor `<LPC845.h>` / `<LPC804.h>` include matches the intent of the m0clockless guard and silences the collision. ## Fix 3 — `platforms/shared/bitbang/bus_traits.h`: LPC845 gate `ChannelEngineLpcSctDma` registers under `BusTraits<Bus::BIT_BANG>` (see `src/platforms/arm/lpc/drivers/sct_dma/bus_traits.h` — FastLED #3459 / PR #3460). The shared `BitBangChannelDriver` also specialises `BusTraits<Bus::BIT_BANG>` unconditionally. On LPC845 both TUs land in the same translation unit and gcc rejects the pair with error: redefinition of 'struct fl::BusTraits<fl::Bus::BIT_BANG>' error: redefinition of 'struct fl::BusSupports<fl::Bus::BIT_BANG, fl::ClocklessChipset, 0>' Gate the shared bit-bang specialization on `!FL_IS_ARM_LPC_845` so the dedicated SCT+DMA engine owns the slot on that platform. Every other platform continues to use the universal-GPIO fallback. ## Verification Applied all three fixes and confirmed: bash compile lpc845brk --examples AutoResearch \ --build-flag "-DFASTLED_LPC_PWM_DMA=1" Board: NXP LPC845-BRK / LPC845 @ 24MHz Toolchain: arm-none-eabi-gcc 15.2.1 Flash: 53.52KB / 64.00KB (83.6%) RAM: 9.07KB / 16.00KB (56.7%) Artifact: firmware.elf (159.79KB) / firmware.bin (53.54KB) build succeeded in 212.2s bash test --cpp → 343/343 passed C++ lint → clean ## What's still open on the actual on-wire verification - fbuild-side: an additional blocker surfaced during this bring-up — the FastLED/framework-arduino-lpc8xx tarball SHA256 changed after the 2026-06-28 org transfer (`e6bbcc3392…` → `e64f0cb81a…`). This needs a fbuild-side update to `ACLPC_CHECKSUM` in `crates/fbuild-packages/src/library/arduino_core_lpc8xx.rs`; I filed the change on a local fbuild branch during this session and will push it as a follow-up PR to the fbuild repo. - Flash + serial monitoring: `bash autoresearch --pwm-dma-cl` still hits pre-existing infrastructure gaps unrelated to #3468 — `ci/util/port_utils.py` only recognises the LPCXpresso VCOM fingerprint (VID:PID 16C0:0483), not the LPC-Link2 CMSIS-DAP variant (1FC9:0132) that ships on this specific LPC845-BRK unit, and fbuild's LPC deploy path uses `lpc21isp` which requires ISP-mode entry rather than the board's default CMSIS-DAP SWD. Both are tracked separately. The host TX→RX byte-flow readback contract (the #3468 primary acceptance criterion) is already confirmed in PR #3472 (`tests/fl/channels/lpc_sct_dma_engine.cpp` "#3468: end-to-end TX→RX readback through engine.show()", passing 343/343). This PR takes the verification one step further by making the compile path work on the LPC845 target so any user with an LPC845-BRK can now build and flash the firmware and run the on-silicon self-loopback via `pwmDmaClCaptureSelf`. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
nrf52832, nrf52810, and nrf52811 have a single GPIO port, and do not define NRF_P1_BASE. If NRF_P1_BASE is not defined, do not define the generated structures requried to access GPIO port 1.