Skip to content

fix(nrf52): unbreak xiaoblesense_adafruit by reusing nrf52840_dk_adafruit variant - #2636

Merged
zackees merged 1 commit into
masterfrom
fix/2634-xiaoblesense-adafruit-variant
May 31, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2634-xiaoblesense-adafruit-variant

Conversation

@zackees

@zackees zackees commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Unblock CI job build_xiaoblesense_adafruit (and its adafruit_xiaoblesense workflow). The board was using https://github.com/maxgerhardt/platform-nordicnrf52, whose xiaoblesense_adafruit board JSON references a build.variant directory that the Adafruit nRF52 BSP at 1.10601.0 doesn't ship.

  • Switch XIAOBLESENSE_ADAFRUIT_NRF52 (and its typo-alias) to the stock nordicnrf52 platform with framework-arduinoadafruitnrf52@^1.10601.0 and real_board_name="nrf52840_dk_adafruit" — a board JSON whose variant actually exists in the framework package.
  • Add TARGET_XIAOBLE_NRF52840_SENSE define so the existing Seeed XIAO BLE Sense fastpin variant block in src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h fires regardless of which BSP variant directory provided Arduino.h — keeping the FastLED-side pin mapping correct for the actual XIAO physical layout.

Same shape as the SuperMini / nice!nano / nRFMicro fixes from #2422 / commit 1a62b13.

Closes #2634.

Failing run before fix

https://github.com/FastLED/FastLED/actions/runs/26698725759/job/78687852124 — delay.h:28:10: fatal error: variant.h: No such file or directory.

Test plan

  • bash compile xiaoblesense_adafruit --examples Blink succeeds on Linux CI (Windows local hits a separate Adafruit BSP ARDUINO_BSP_VERSION quote-stripping bug in fbuild — out of scope here, affects all Adafruit-BSP nRF52 boards on Windows).
  • build_xiaoblesense_adafruit and adafruit_xiaoblesense workflows go green.
  • Existing ARDUINO_Seeed_XIAO_nRF52840_Sense-keyed variant block continues to work unchanged for users compiling against a BSP that ships the Seeed variant directly.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced Seeed XIAO BLE Sense board configuration for improved build system compatibility
    • Strengthened pin mapping support for Seeed XIAO nRF52840 Sense microcontroller boards

…ruit variant

CI job `build_xiaoblesense_adafruit` red on master with:

  cores/nRF5/delay.h:28:10: fatal error: variant.h: No such file or directory

Root cause: the previous `XIAOBLESENSE_ADAFRUIT_NRF52` board entry pointed
at the `https://github.com/maxgerhardt/platform-nordicnrf52` platform fork,
whose `xiaoblesense_adafruit` board JSON sets `build.variant` at a
variant directory that does NOT ship in `framework-arduinoadafruitnrf52`
1.10601.0. The Adafruit BSP variants folder only contains Adafruit's own
boards (feather/clue/itsybitsy/metro/pca10056) plus a couple of community
ones — no Seeed XIAO.

Mirror the SuperMini / nice!nano / nRFMicro pattern from #2422:

- Switch `platform` to stock `nordicnrf52`.
- Keep `framework-arduinoadafruitnrf52@^1.10601.0`.
- Set `real_board_name="nrf52840_dk_adafruit"` so the BSP picks a variant
  that actually exists.
- Add a new `TARGET_XIAOBLE_NRF52840_SENSE` define and have the existing
  fastpin variant block (`ARDUINO_Seeed_XIAO_nRF52840_Sense`) in
  `src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h` also fire on
  that target so the FastLED pin mapping for the Seeed XIAO BLE Sense
  physical layout stays correct without depending on the Seeed variant
  folder being present in the framework package.

Applied to both `xiaoblesense_adafruit` and the `xiaoblesense_adafrui`
typo-alias.

Closes #2634

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

coderabbitai Bot commented May 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a003896a-d87b-405e-a3d2-616660d672a7

📥 Commits

Reviewing files that changed from the base of the PR and between 23349cc and 3433375.

📒 Files selected for processing (2)
  • ci/boards.py
  • src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h

📝 Walkthrough

Walkthrough

Updated CI board definitions for Seeed XIAO BLE Sense nRF52840 to use the nordicnrf52 platform with Adafruit nRF52 BSP and an explicit TARGET define, and extended code-side FastPin variant selection to recognize this define so correct pin mapping is selected when the Seeed variant folder is absent.

Changes

nRF52 XIAO BLE Sense Platform Configuration

Layer / File(s) Summary
nRF52 XIAO board configuration
ci/boards.py
XIAOBLESENSE_ADAFRUIT_NRF52 and XIAOBLESENSE_ADAFRUI_ALIAS board entries updated to specify nordicnrf52 platform, Adafruit nRF52 Arduino BSP package (framework-arduinoadafruitnrf52@^1.10601.0), TARGET_XIAOBLE_NRF52840_SENSE and FASTLED_USE_COMPILE_TESTS=0 defines, board_build_core="nRF5", and real_board_name="nrf52840_dk_adafruit". Removes custom platform repos and platform_needs_install=True flags.
XIAO Sense pin variant gating
src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h
Preprocessor condition for Seeed XIAO nRF52840 Sense pin mapping extended to activate when TARGET_XIAOBLE_NRF52840_SENSE is defined, enabling CI builds that reuse the Adafruit nrf52840_dk_adafruit variant to select the correct Seeed pin layout. Comments added documenting the CI/BSP reuse scenario.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • #2634: Directly addresses the root cause of the xiaoblesense_adafruit CI build failure by switching to the Adafruit BSP with proper variant support and adding the TARGET define for pin mapping.

Possibly related PRs

  • FastLED/FastLED#2627: Modifies fastpin_arm_nrf52_variants.h to condition FastPin variant blocks on TARGET_* defines, extending the same target-based variant selection pattern.
  • FastLED/FastLED#2447: Modifies fastpin_arm_nrf52_variants.h to adjust XIAO nRF52840 pin definitions, working with the same variant mapping infrastructure.

Poem

🐰 A rabbit hops through Nordic fields,
With XIAO boards on nRF shields,
BSP variants now aligned,
TARGET defines refined,
CI builds dance with pins compiled! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(nrf52): unbreak xiaoblesense_adafruit by reusing nrf52840_dk_adafruit variant' accurately and concisely describes the main change: fixing a broken board configuration by switching to reuse an existing board variant.
Linked Issues check ✅ Passed The PR fully addresses all coding requirements from issue #2634: switched platform to nordicnrf52, set real_board_name to nrf52840_dk_adafruit, added TARGET_XIAOBLE_NRF52840_SENSE define, and updated the fastpin variant block to recognize the new define.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the xiaoblesense_adafruit build failure: board configuration updates in ci/boards.py and fastpin variant detection in src/platforms/arm/nrf52/fastpin_arm_nrf52_variants.h with no unrelated alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-xiaoblesense-adafruit-variant

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 49ffa4f into master May 31, 2026
7 of 8 checks passed
zackees added a commit that referenced this pull request May 31, 2026
…2638)

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]>
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-xiaoblesense-adafruit-variant 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.

build: xiaoblesense_adafruit CI red — variant.h missing from Adafruit nRF52 BSP

1 participant