Skip to content

stm32h747xi_giga: build fails — fastspi_arm_stm32.h pulls in <SPI.h> unconditionally on HAL detection #2595

Closed

Description

@zackees

Symptom

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
   11 |     #include <SPI.h>

Every example (AnalogOutput, Animartrix, ...) hits the same error. Reproducible run: most recent build_giga_r1 workflow on master.

Root cause

src/platforms/arm/stm32/fastspi_arm_stm32.h (line ~8):

#if defined(HAL_SPI_MODULE_ENABLED)
    #define FASTLED_STM32_USE_HAL 1
    #include <SPI.h>
#else
    #define FASTLED_STM32_USE_HAL 0
#endif

The STM32H7 / Giga R1 board's stm32_hal_conf.h defines HAL_SPI_MODULE_ENABLED, so the #include <SPI.h> fires. But the Arduino mbed-os core that drives the Giga does not auto-resolve <SPI.h> via PlatformIO's lib finder — SPI has to be explicitly listed in lib_deps. It isn't, so the include 404s and every TU that pulls in fastspi.h (via FastLED.h:240) explodes.

Affected jobs

  • stm32h747xi_giga (every example)

Fix

Same pattern as my ESP8266 fix (#2570): guard the include with FASTLED_ALL_PINS_HARDWARE_SPI. The macro is an explicit user opt-in for hardware SPI; users who define it on STM32H7 also need to add SPI to their lib_deps. Default builds get the bitbang fallback.

- #if defined(HAL_SPI_MODULE_ENABLED)
+ #if defined(HAL_SPI_MODULE_ENABLED) && defined(FASTLED_ALL_PINS_HARDWARE_SPI)
      #define FASTLED_STM32_USE_HAL 1
      #include <SPI.h>
  #else
      #define FASTLED_STM32_USE_HAL 0
  #endif

This is a one-line FastLED-side fix; no fbuild changes required.

Test plan

  • bash lint clean.
  • CI: stm32h747xi_giga workflow should compile every example past the include error.
  • No regression on other STM32 boards (the default path drops to bitbang for the same HAL_SPI_MODULE_ENABLED && !FASTLED_ALL_PINS_HARDWARE_SPI combination — matches what end-users on stock STM32F* configs already get when SPI isn't in their lib_deps).

Repro

bash compile stm32h747xi_giga --examples Blink


Filed during a coordinated CI-green sweep; fix PR landing immediately.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions