Skip to content

fix(arm): exclude STM32H7/Giga from interrupts-must-be-off gate - #2615

Merged
zackees merged 1 commit into
masterfrom
fix/stm32h7-compile-test-gate-2614
May 30, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/stm32h7-compile-test-gate-2614

Conversation

@zackees

@zackees zackees commented May 30, 2026 •

Copy link
Copy Markdown
Member

Summary

stm32h747xi_giga workflow has been 44/0 fail/success on master. Every recent run fails 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 FASTLED_ALLOW_INTERRUPTS = 1 in led_sysdef_arm_giga.h:

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

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. The compile-time gate was making a sweeping assumption that's true for STM32F1 / STM32F4 (STM32duino) but wrong for STM32H7 / Giga / Mbed-based STM32s.

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

Fix

Narrow the gate to exclude STM32H7 and Mbed-based STM32s:

-#if defined(ARDUINO_ARCH_STM32) || defined(STM32F1)
+#if (defined(ARDUINO_ARCH_STM32) || defined(STM32F1)) \
+    && !defined(STM32H7xx) \
+    && !defined(FL_IS_STM32_MBED)
  • FL_IS_STM32_MBED is defined in src/platforms/arm/stm32/is_stm32.h:122-124 for FL_IS_STM32 && ARDUINO_ARCH_MBED.
  • STM32H7xx is a stock CMSIS define.

STM32F1 / STM32F4 builds remain gated (neither exclusion macro is defined for them) so the original safety net stays intact for the families where the interrupts-off rule actually applies.

Test plan

  • Local: bash test --cpp fl_gfx_rgbww passes (compile_test.hpp is compiled by host tests).
  • CI stm32h747xi_giga workflow: should turn green on next master push that touches src/**.
  • CI other STM32 boards (bluepill = STM32F1): should remain gated and pass (their led_sysdefs already set FASTLED_ALLOW_INTERRUPTS = 0).

Related

Fixes #2614

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced STM32 microcontroller platform compatibility by refining interrupt handling restrictions to apply only to specific lower-end variants, improving support for STM32H7xx series and Arduino Mbed core implementations.
  • Documentation

    • Added clarification on timing constraints and interrupt handling requirements for affected STM32 microcontroller families.

Review Change Stack

)

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).
@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

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: edbbcf33-0e6d-42ce-9c63-45d711f61762

📥 Commits

Reviewing files that changed from the base of the PR and between 2461b7d and e9d7691.

📒 Files selected for processing (1)
  • src/platforms/arm/compile_test.hpp

📝 Walkthrough

Walkthrough

The compile-time gate enforcing FASTLED_ALLOW_INTERRUPTS == 0 is refined to exclude STM32H7xx and FL_IS_STM32_MBED targets. Documentation clarifies that the restriction applies to lower-performance STM32 families, while higher-speed variants and Arduino Mbed-based boards are exempted because they tolerate interrupt latency during LED writes.

Changes

STM32 Interrupt Allowance Gate

Layer / File(s) Summary
STM32 compile-time gate refinement
src/platforms/arm/compile_test.hpp
The preprocessor condition is narrowed from a blanket ARDUINO_ARCH_STM32 check to explicitly exclude STM32H7xx and FL_IS_STM32_MBED, allowing higher-performance STM32 variants and Arduino Mbed boards to set FASTLED_ALLOW_INTERRUPTS = 1. Multi-line comments document the timing constraints for affected families and the rationale for the exclusions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A gate too broad caught the speedy H7,
So we carved out exceptions, now builds reach heaven—
Mbed boards and Giga run interrupts free,
While F1s stay safe at seventy-two MHz! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 describes the main change: narrowing the compile-time gate to exclude STM32H7 and Giga boards from the interrupts-must-be-off requirement.
Linked Issues check ✅ Passed The PR changes fully implement the proposed fix from issue #2614 by narrowing the gate with STM32H7xx and FL_IS_STM32_MBED exclusions and documenting the timing/ISR restriction.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #2614: narrowing the compile-time gate in compile_test.hpp and adding clarifying documentation for the affected STM32 families.

✏️ 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/stm32h7-compile-test-gate-2614

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 1fd3439 into master May 30, 2026
5 of 6 checks passed
@zackees
zackees deleted the fix/stm32h7-compile-test-gate-2614 branch August 21, 2026 19:16
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.

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

1 participant