Skip to content

fix(nrf52): honor SPI data rates - #2698

Merged
zackees merged 1 commit into
masterfrom
feat/2697-nrf52-followup
Jun 3, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/2697-nrf52-followup

Conversation

@zackees

@zackees zackees commented Jun 3, 2026 •

Copy link
Copy Markdown
Member

Summary

  • bump FastLED's fbuild pin to 2.2.15 so Adafruit nRF52 BSP quoted defines survive response-file builds
  • honor DATA_RATE_MHZ() / DATA_RATE_KHZ() on nRF52 hardware SPIM instead of always forcing 4 MHz
  • document the current nRF52 backend support boundaries for Adafruit/Bluefruit BSP, mbed OS boards, BLE-heavy clockless output, and WS2812/SK6812 latch timing

Verification

  • uv run python -c "import importlib.metadata as m; print(m.version('fbuild'))" -> 2.2.15
  • uv run ci/ci-compile.py nrf52840_dk --examples Blink
  • uv run ci/ci-compile.py nrf52840_dk --examples Apa102

Fixes #2697
Addresses #2694
Addresses #2695
Addresses #2696
Addresses #1246
Addresses #1275
Addresses #917
Addresses #1111

Summary by CodeRabbit

  • Bug Fixes

    • Fixed SPI clock frequency configuration for nRF52 platform LEDs.
  • Documentation

    • Enhanced nRF52 documentation with guidance on supported hardware, API requirements, and optimal LED configuration for both clocked SPI and clockless BLE scenarios.

@coderabbitai

coderabbitai Bot commented Jun 3, 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: fe55cc79-a67b-4e13-aacb-9bf4d8822009

📥 Commits

Reviewing files that changed from the base of the PR and between c84a0f9 and 3aeab5c.

📒 Files selected for processing (3)
  • pyproject.toml
  • src/platforms/arm/nrf52/README.md
  • src/platforms/arm/nrf52/fastspi_arm_nrf52.h

📝 Walkthrough

Walkthrough

The PR updates the nRF52 backend to compute SPI clock frequency dynamically via static constexpr helpers (spiClockHz() and spimFrequency()) instead of using a hardcoded value, documents the Adafruit nRF52/Bluefruit Arduino BSP as the supported target with behavior guidance for SPIM and clockless LEDs, and bumps the fbuild build dependency to version 2.2.15.

Changes

nRF52 SPI clock frequency and backend documentation

Layer / File(s) Summary
nRF52 SPI clock frequency helpers
src/platforms/arm/nrf52/fastspi_arm_nrf52.h
Added static constexpr helpers spiClockHz() to compute effective SPI clock from _SPI_CLOCK_DIVIDER, and spimFrequency() to map the computed clock to the fastest discrete nrf_spim_frequency_t that does not exceed it. Updated init() to use spimFrequency() instead of a hardcoded frequency selection.
nRF52 backend documentation
src/platforms/arm/nrf52/README.md
Documented the Adafruit nRF52/Bluefruit Arduino BSP as the maintained target and marked Arduino mbed OS nRF52 boards as unsupported. Added guidance on SPIM rate selection and default instance behavior for clocked LEDs, and PWM EasyDMA behavior, reliability caveats, and reset/latch timing for clockless LEDs under SoftDevice/BLE pressure.
fbuild dependency update
pyproject.toml
Pinned fbuild from version 2.2.14 to 2.2.15 with corresponding comment text update.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2671: Bumps fbuild from 2.2.12 to 2.2.13 in pyproject.toml, directly related to this PR's fbuild pin change (2.2.14 → 2.2.15).
  • FastLED/FastLED#2680: Modifies pyproject.toml's fbuild dependency entry in [project].dependencies, both updating the same CI dependency pin.
  • FastLED/FastLED#2652: Bumps fbuild from 2.2.11 to 2.2.12 in pyproject.toml, directly related at the dependency level.

Poem

🐇 A frequency finds its finest form,
When helpers map each SPI storm,
From dividers swift to SPIM delight,
The nRF52 now shines so bright!
Docs guide the way through BLE haze—
FastLED's rabbit dances through the maze! 🎆

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing nRF52 SPI driver to honor data rate settings instead of forcing a fixed frequency.
Linked Issues check ✅ Passed The PR addresses the parent issue #2697 by implementing core objectives: honoring SPI data rates, documenting nRF52 backend support boundaries, and updating fbuild dependency version.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the PR objectives: fbuild version bump for build compatibility, SPI driver fixes for data rate support, and documentation for backend support boundaries.

✏️ 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 feat/2697-nrf52-followup

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

meta-meta: nRF52840/nRF52 issue sweep follow-up

1 participant