Skip to content

Problem adapting FastLED library for stm32l476rg board #975

Open

Description

@rannomspp

Hi!

Im having a hard time adapting the library to my mbed_os

[Error] led_sysdefs.h@50,2: #error "This platform isn't recognized by FastLED... yet. See comments in FastLED/led_sysdefs.h for options." [Fatal Error] clockless_trinket.h@6,10: avr/interrupt.h: No such file or directory [ERROR] In file included from ./FastLED/FastLED.h:41, from ./FastLED/FastLED.cpp:2: ./FastLED/led_sysdefs.h:50:2: error: #error "This platform isn't recognized by FastLED... yet. See comments in FastLED/led_sysdefs.h for options." 50 | #error "This platform isn't recognized by FastLED... yet. See comments in FastLED/led_sysdefs.h for options." | ^~~~~ In file included from ./FastLED/platforms/avr/fastled_avr.h:6, from ./FastLED/platforms.h:39, from ./FastLED/FastLED.h:52, from ./FastLED/FastLED.cpp:2: ./FastLED/platforms/avr/clockless_trinket.h:6:10: fatal error: avr/interrupt.h: No such file or directory 6 | #include <avr/interrupt.h> // for cli/se definitions | ^~~~~~~~~~~~~~~~~ compilation terminated.

Activity

  1. rannomspp commented on Feb 20, 2020

    @rannomspp
    Author

    By far it seems to be defined in "led_sysdefs.h" for STM32F103 / STM32F10X_MD and I am not exactly sure what to add to fix it.

  2. added
    type: bug
    platform: stm32
    area: core
    status: stale
    status: triage
    on Apr 16, 2026
  3. zackees commented on Jun 3, 2026

    @zackees
    Member

    Tracked in FastLED/fbuild#385 for STM32 / STM32duino fbuild platform/build support validation.

    That fbuild issue is scoped to board metadata, toolchain/backend support, and FastLED smoke-build evidence. Any remaining FastLED source/platform-code blocker should stay linked from both sides.

  4. zackees commented on Jun 3, 2026

    @zackees
    Member

    Triage update from fbuild side, tracked under FastLED/fbuild#385.

    STM32L476RG (and the wider STM32L4 family) is an fbuild-side gap. fbuild's STM32 orchestrator currently only ships MCU configs for STM32F1, STM32F4, STM32H7, and STM32U5 - the L4 family (Cortex-M4F, no DSP) has no stm32l4.json config yet, so fbuild build ... -e nucleo_l476rg fails with:

    build error: config error: unsupported STM32 MCU: 'stm32l476rgt6' (supported prefixes: stm32f103, stm32f4, stm32h7, stm32u5/stm32u585; gaps tracked by FastLED/fbuild#385: stm32f0*, stm32l4*)
    

    A smoke fixture (tests/platform/nucleo_l476rg) has been added as a regression marker so this is unblocked once the L4 config lands. See PR FastLED/fbuild#396 and tracker FastLED/fbuild#385.

    Your original error This platform isn't recognized by FastLED... yet. is FastLED-side - even after fbuild adds L4 support, FastLED's src/platforms/arm/stm32/led_sysdefs_arm_stm32.h needs an STM32L4 branch (the existing STM32 detection there is mostly F1/F4/F7).

  5. added
    deferred
    on Aug 2, 2026
  6. zackees commented on Aug 2, 2026

    @zackees
    Member

    Deferred by automated triage: STM32L4 pin map is an unstarted port, not a bug: no families/stm32l4.h, no boards/l4/, and fbuild has no stm32l4 MCU config so it cannot be compile-verified here. pins/README.md already lists STM32L4 as 'Future'. Original 2020 symptom is fixed. Status posted on the issue.

  7. zackees commented on Aug 2, 2026

    @zackees
    Member

    Re-surveyed against current master. Marking deferred — the remaining work is a platform port I cannot compile-verify here, not a bug. Posting exactly what has changed and what is left, including a correction to the triage note above.

    Your original symptom is gone

    The 2020 failure was led_sysdefs.h falling all the way through to "This platform isn't recognized by FastLED... yet" and then pulling in platforms/avr/clockless_trinket.h, hence avr/interrupt.h: No such file or directory. That cannot happen now:

    • is_stm32.h:49-50 recognises the L4 family in the top-level FL_IS_STM32 test, and is_stm32.h:95-98 defines FL_IS_STM32_L4.
    • The STM32 tree now has a per-core split (core_detection.h) with a dedicated mbed arm and its own led_sysdefs/led_sysdefs_stm32_mbed.h — relevant since you were on mbed OS rather than STM32duino.
    • stm32_capabilities.h:50 carries an L4 entry.

    So no more AVR headers on an ARM target.

    Correction to the triage note above

    FastLED's src/platforms/arm/stm32/led_sysdefs_arm_stm32.h needs an STM32L4 branch (the existing STM32 detection there is mostly F1/F4/F7).

    That is no longer where the gap is — L4 detection landed. The actual missing piece is the pin map:

    src/platforms/arm/stm32/pins/families/     stm32f1.h  stm32f2.h  stm32f4.h  stm32g0.h  stm32u5.h     ← no stm32l4.h
    src/platforms/arm/stm32/pins/boards/       f1/  f2/  f4/  g0/  u5/                                   ← no l4/
    

    fastpin_dispatcher.h has no ARDUINO_NUCLEO_L476RG arm, so an L4 build reaches the fallback at the end of the chain and stops with a clear, actionable message:

    #error "STM32: Unknown board. Check your ARDUINO_* board macro and add it to src/platforms/arm/stm32/pins/fastpin_dispatcher.h. See src/platforms/arm/stm32/pins/README.md for architecture guide and examples."

    Which is a considerable improvement on 2020 — you now get told precisely what is missing and where to add it.

    This is already tracked in-tree, incidentally: pins/README.md:203 lists STM32L4 → 📋 Future, "Nucleo L476RG, Discovery L4" — your exact board, named.

    Why I am not just adding it

    The Nucleo-L476RG is a Nucleo-64 board, so it shares the Arduino/ST-Morpho header layout with the F401RE / F411RE / F446RE boards that already have files under boards/f4/. Writing an L4 map by analogy is tempting and would probably be close to right.

    I am not doing it blind, for two reasons:

    1. It cannot be compiled here. fbuild ships MCU configs for STM32F1/F4/H7/U5 only; stm32l4 is a known gap (track(platform): validate STM32 / STM32duino FastLED build support fbuild#385, smoke fixture tests/platform/nucleo_l476rg staged in test(stm32): add F0/L4 gap-tracking fixtures and document STM32 MCU coverage fbuild#396). An unbuildable pin map is an untested pin map.
    2. "Same connector" does not mean "same pin map." That assumption has bitten this repo before — Zero SAMD, not work using 0 & 1 pin #825 found the ARDUINO_SAMD_ZERO and ARDUINO_SEEED_ZERO maps disagreeing on pins 0/1/2/4 despite being nominally the same board class. A wrong GPIO in a pin map is worse than a clean #error: it compiles, links, and silently drives the wrong pin.

    What a complete L4 port needs

    1. pins/families/stm32l4.h — L4 GPIO has BRR, so it should follow the HAS_BRR pattern rather than the F1 legacy path.
    2. pins/boards/l4/nucleo_l476rg.h — pin table verified against the ST UM1724 Nucleo-64 user manual, not inferred from the F4 sibling.
    3. An ARDUINO_NUCLEO_L476RG arm in fastpin_dispatcher.h.
    4. stm32l4.json on the fbuild side (track(platform): validate STM32 / STM32duino FastLED build support fbuild#385) so it can actually be built and smoke-tested.
    5. If mbed support is wanted specifically, note that FL_IS_STM32_L4 currently keys on STM32L4 / STM32L4xx — the defines STM32duino emits. Arduino mbed emits TARGET_STM32L4 / STM32L476xx, which are not matched. Adding those is a one-liner, but it only moves the error to the pin dispatcher until step 2 exists.

    @rannomspp — if you still have the board and want to finish this, steps 1-3 are self-contained and pins/README.md documents the pattern; a PR with a datasheet-verified table would be very welcome. Otherwise this stays open as a tracked port request.

    (Minor in-tree drift noticed while checking: pins/MIGRATION_COMPLETE.md:234 still lists "Add STM32L4/G0/G4/U5 support" as unchecked, though G0 and U5 have since landed.)

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

    area: coredeferredplatform: stm32status: stalestatus: triagetype: bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions