Skip to content

stm32h747xi_giga: compile_test gate too broad — STM32H7 needs FASTLED_ALLOW_INTERRUPTS=1 #2614

Closed

Description

@zackees

Symptom

stm32h747xi_giga workflow has 44 failures / 0 successes on master and every recent main push fails with:

src/platforms/arm/compile_test.hpp:78:6: error:
    #error "STM32 platforms should have FASTLED_ALLOW_INTERRUPTS set to 0"
   78 |     #error "STM32 platforms should have FASTLED_ALLOW_INTERRUPTS set to 0"
      |      ^~~~~

Reproducible: every recent stm32h747xi_giga workflow run on master.

Root cause

src/platforms/arm/compile_test.hpp lines 76-81:

#if defined(ARDUINO_ARCH_STM32) || defined(STM32F1)
    #if FASTLED_ALLOW_INTERRUPTS != 0
    #error "STM32 platforms should have FASTLED_ALLOW_INTERRUPTS set to 0"
    #endif
    #if FASTLED_USE_PROGMEM != 0
    #error "STM32 platforms should have FASTLED_USE_PROGMEM set to 0"
    #endif
#endif

The check is 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 with the H7's much higher clock (480 MHz), and its led_sysdef_arm_giga.h deliberately sets FASTLED_ALLOW_INTERRUPTS = 1:

// Default to allowing interrupts
#ifndef FASTLED_ALLOW_INTERRUPTS
#define FASTLED_ALLOW_INTERRUPTS 1
#endif

That choice is correct for H7: at 480 MHz a clockless write has plenty of cycles to tolerate ISR latency, unlike STM32F1 at 72 MHz where any interrupt mid-write disrupts the WS28xx timing. The compile-time gate makes a sweeping assumption that's true for STM32F1 / STM32F4 but wrong for STM32H7 / Giga / Mbed-based STM32s.

Same shape applies to the FASTLED_USE_PROGMEM != 0 check immediately below — Giga sets it to 0 already (matches the gate), but the same gate-too-broad concern stands.

Proposed fix

Narrow the gate to exclude H7 / Mbed-based STM32s:

-#if defined(ARDUINO_ARCH_STM32) || defined(STM32F1)
+#if (defined(ARDUINO_ARCH_STM32) || defined(STM32F1)) \
+    && !defined(STM32H7xx) \
+    && !defined(FL_IS_STM32_MBED)
     #if FASTLED_ALLOW_INTERRUPTS != 0
     #error "STM32 platforms should have FASTLED_ALLOW_INTERRUPTS set to 0"
     #endif

FL_IS_STM32_MBED is already defined in src/platforms/arm/stm32/is_stm32.h for Mbed-based STM32 boards. STM32H7xx is a stock CMSIS define.

Test plan

  • After the fix, stm32h747xi_giga workflow goes green on the next push that touches src/** (the workflow's path filter).
  • STM32F1 / STM32F4 builds remain green (still gated, because they don't define either of the exclusion macros).
  • Local: bash compile stm32h747xi_giga --examples Blink succeeds.

Related

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