Repository navigation
fix(stm32): guard fastspi <SPI.h> include on FASTLED_ALL_PINS_HARDWARE_SPI - #2596
Conversation
…E_SPI Every `stm32h747xi_giga` (Arduino Giga R1) build on master fails: platforms/arm/stm32/fastspi_arm_stm32.h:11:14: fatal error: SPI.h: No such file or directory `fastspi_arm_stm32.h` pulls in Arduino's `<SPI.h>` whenever `HAL_SPI_MODULE_ENABLED` is set, but the Arduino mbed-os core that drives the Giga doesn't auto-resolve `<SPI.h>` from PlatformIO's lib finder — `SPI` has to be listed in `lib_deps`, and it isn't. Apply the same pattern as the ESP8266 fix (#2570): also require `FASTLED_ALL_PINS_HARDWARE_SPI` before pulling in the HAL SPI path. Default builds fall through to bitbang. Users who want STM32 hardware SPI define the macro and add `SPI` to their `lib_deps`. This is a one-line FastLED-side fix; no fbuild / lib_deps wrangling needed. Matches the existing opt-in convention. Fixes #2595
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR tightens the conditional in ChangesSTM32 HAL Hardware SPI Conditional Guard
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
) (#2615) stm32h747xi_giga workflow has 44/0 fail/success on master, every recent run dying at: src/platforms/arm/compile_test.hpp:78:6: error: #error "STM32 platforms should have FASTLED_ALLOW_INTERRUPTS set to 0" Root cause: the gate at line 76 was #if defined(ARDUINO_ARCH_STM32) || defined(STM32F1) — too broad. It fires for any platform that defines ARDUINO_ARCH_STM32, which includes the Arduino Giga R1 (STM32H747XI). Giga runs on the Arduino Mbed core at 480 MHz and deliberately sets #define FASTLED_ALLOW_INTERRUPTS 1 in its led_sysdef_arm_giga.h. That choice is correct for H7: a 480 MHz clockless write has plenty of cycles to tolerate ISR latency, unlike STM32F1 at 72 MHz where any interrupt mid-write disrupts WS28xx timing. Fix: narrow the gate to exclude STM32H7 and Mbed-based STM32s: #if (defined(ARDUINO_ARCH_STM32) || defined(STM32F1)) \ && !defined(STM32H7xx) \ && !defined(FL_IS_STM32_MBED) `FL_IS_STM32_MBED` is already defined in is_stm32.h for Mbed STM32 boards; `STM32H7xx` is a stock CMSIS define. Both are reliably present at compile_test.hpp time. STM32F1 / STM32F4 builds remain gated (neither exclusion macro is defined for them) so the original safety net stays intact for the families where the rule actually applies. Local: bash test --cpp fl_gfx_rgbww passes. Fixes #2614. Refs #2596 (prior stm32h747xi_giga SPI.h fix — this is the next compile error that surfaced once that was unblocked).
Summary
stm32h747xi_giga(Arduino Giga R1) build on master fails withfastspi_arm_stm32.h:11:14: fatal error: SPI.h: No such file or directory.stm32_hal_conf.hdefinesHAL_SPI_MODULE_ENABLED, sofastspi_arm_stm32.hdoes#include <SPI.h>. But the Arduino mbed-os core that drives the Giga doesn't auto-resolve<SPI.h>via PIO's lib finder —SPImust be listed inlib_deps, and it isn't.FASTLED_ALL_PINS_HARDWARE_SPIbefore pulling in the HAL path. Default builds get bitbang. Users who want STM32 hardware SPI define the macro AND addSPIto theirlib_deps. One-line change insrc/platforms/arm/stm32/fastspi_arm_stm32.h.Fixes #2595
Test plan
bash lintclean.stm32h747xi_gigaworkflow should compile every example past the include error.SPIisn't in their lib_deps).Generated with Claude Code (https://claude.com/claude-code)
Summary by CodeRabbit
Bug Fixes