Skip to content

fix(nrf52): defer PCA10056 pin map for TARGET_XIAOBLE_NRF52840_SENSE - #2638

Merged
zackees merged 1 commit into
masterfrom
fix/2634-followup-xiaoble-target-override
May 31, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2634-followup-xiaoble-target-override

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #2636. The xiaoblesense_adafruit board now reuses the nrf52840_dk_adafruit BSP variant (which defines ARDUINO_NRF52840_PCA10056). The post-merge master build 26700041082 failed with:

```
fastpin_arm_nrf52_variants.h:857:10: error: #error "Cannot define more than one board at a time"
fastpin_arm_nrf52_variants.h:48:26: error: redefinition of 'class fl::FastPin<0>'
... (and ~30 more redefinitions)
```

Both the PCA10056 variant block and the new TARGET_XIAOBLE block were firing.

Same shape as PR #2627 (which fixed the same collision for SuperMini / nice!nano / nRFMicro). Add TARGET_XIAOBLE_NRF52840_SENSE to the __FASTLED_NRF52_USER_TARGET_OVERRIDE OR-chain so the PCA10056 block stands down when the XIAO target is set.

Closes the regression introduced by #2636.

Test plan

  • build_xiaoblesense_adafruit job on master is green after merge
  • adafruit_xiaoblesense workflow on master is green after merge
  • Existing SuperMini / nice!nano / nRFMicro builds remain green (no semantic change to their guard)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for XIAOBLE NRF52840 Sense hardware platform.

Follow-up to #2636. After switching `xiaoblesense_adafruit` to reuse the
`nrf52840_dk_adafruit` BSP variant (which defines
`ARDUINO_NRF52840_PCA10056`), the master post-merge build failed with
"#error Cannot define more than one board at a time": both the PCA10056
pin map block and the new TARGET_XIAOBLE block fired.

Same shape as PR #2627 fixed for SuperMini / nice!nano / nRFMicro. Add
`TARGET_XIAOBLE_NRF52840_SENSE` to the `__FASTLED_NRF52_USER_TARGET_OVERRIDE`
OR-chain at the top of `fastpin_arm_nrf52_variants.h` so the PCA10056
block stands down when the XIAO target is set.

Refs #2634 (#2636 post-merge run 26700041082).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented May 31, 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: b8dee736-26fb-41c1-b257-beed594f0a04

📥 Commits

Reviewing files that changed from the base of the PR and between d8de199 and b3e9cda.

📒 Files selected for processing (1)
  • src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h

📝 Walkthrough

Walkthrough

The PR extends the nRF52 fastpin platform configuration to recognize the XIAO BLE Sense target by adding TARGET_XIAOBLE_NRF52840_SENSE to the compile-time variant sentinel that gates user-target pin-mapping overrides.

Changes

nRF52 Platform Variant Support

Layer / File(s) Summary
XIAO BLE Sense variant support
src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h
The __FASTLED_NRF52_USER_TARGET_OVERRIDE preprocessor condition is reformatted and extended to include TARGET_XIAOBLE_NRF52840_SENSE alongside existing target macros (TARGET_SUPERMINI_NRF52840, TARGET_NICE_NANO_V2, TARGET_NRFMICRO), enabling the platform to recognize this board at compile time.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • FastLED/FastLED#2634: Directly addresses the requested fix to add TARGET_XIAOBLE_NRF52840_SENSE to the fastpin variant chain for XIAO BLE Sense pin-mapping support.
  • FastLED/FastLED#2626: Related through the same sentinel in fastpin_arm_nrf52_variants.h; both manage when user-target overrides prevent the default PCA10056 pin-map conflict.
  • FastLED/FastLED#2446: Touches the same file to manage per-target pin specializations and opt-in macros for nRF52 variants.

Possibly related PRs

  • FastLED/FastLED#2627: Both PRs modify the same __FASTLED_NRF52_USER_TARGET_OVERRIDE sentinel in fastpin_arm_nrf52_variants.h to control when the ARDUINO_NRF52840_PCA10056 pin-map block is active.
  • FastLED/FastLED#2636: Adds the companion XIAO BLE Sense pin-mapping block in the same file that is gated by the TARGET_XIAOBLE_NRF52840_SENSE macro now enabled by this PR's sentinel change.
  • FastLED/FastLED#2445: Related through parallel updates to nRF52 variant target handling in the same header file, extending compile-time TARGET macro recognition for community boards.

Poem

🐰 A tiny XIAO board hops into place,
Its BLE Sense finds the fastpin's embrace,
With one TARGET define to the list we add,
The compiler now knows—no conflicts so bad!
A preprocessor whisper, a variant's delight.

✨ 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 fix/2634-followup-xiaoble-target-override

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 and usage tips.

@zackees
zackees merged commit 1d9a638 into master May 31, 2026
5 of 6 checks passed
zackees added a commit that referenced this pull request May 31, 2026
… LTO bug (#2642)

Post-#2636 / #2638 post-merge build still fails — but now on a
pre-existing toolchain bug, not on the variant.h issue this PR addressed.

arm-gnu-toolchain 15.2.rel1 + Adafruit nRF52 BSP + LTO emits thousands
of "offset out of range" assembler errors in the LTO-temp output:

  .lto-tmp/ccXXXXXX.s:13834: Error: offset out of range
  lto-wrapper: fatal error: arm-none-eabi-gcc returned 1 exit status
  collect2: error: ld returned 1 exit status

Affects xiaoblesense_adafruit, supermini_nrf52840, and likely the other
nRF52840 Adafruit-BSP boards. Tracked separately in #2641.

CI-unblock: add `build_unflags=[-flto]` + `build_flags=[-fno-lto]` to the
xiaoblesense_adafruit board entries so this board's CI goes green now.
Other affected boards can adopt the same workaround once verified.

Refs #2634 (variant.h), #2636 (variant fix), #2638 (PCA10056 guard),
#2641 (LTO toolchain bug).

Co-authored-by: Claude Opus 4.7 <[email protected]>
zackees added a commit that referenced this pull request May 31, 2026
#2655)

xiaoblesense_adafruit post-merge run 26700835813 succeeded at every
compile step (all 65 example builds green — the variant.h / PCA10056 /
LTO fixes from #2636 / #2638 / #2642 all worked) but the runner was
killed 37 minutes after the last log line during the Optimization Report
step (`uv run ci/optimization_report.py --first`).

Both Symbol Analysis and Optimization Report are post-build analysis
steps already marked `continue-on-error: true`, so they should never
turn a green build red. A 5-minute `timeout-minutes` cap keeps them from
hanging the entire job when a downstream script (e.g. fbuild vs PIO
artifact-path divergence — readelf/nm/objdump returned exit 1 on the
firmware.elf earlier in the same run) gets stuck in a wait loop. The
build itself still passes; the report is just skipped for that run.

Filed the underlying optimization_report.py / symbol_analysis_runner.py
fbuild-path bug separately for proper investigation.

Refs #2641.

Co-authored-by: Claude Opus 4.7 <[email protected]>
@zackees
zackees deleted the fix/2634-followup-xiaoble-target-override branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant