You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tested on the newest master branch, with STM32duino 1.5.
In file included from C:\Software\Arduino IDE\portable\sketchbook\libraries\FastLED/led_sysdefs.h:32:0,
from C:\Software\Arduino IDE\portable\sketchbook\libraries\FastLED/FastLED.h:41,
from C:\Users\think\AppData\Local\Temp\arduino_modified_sketch_17966\Blink.ino:1:
C:\Software\Arduino IDE\portable\sketchbook\libraries\FastLED/platforms/avr/led_sysdefs_avr.h:12:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
I'm using platformIO and I'm getting the same error, did someone found solution for that?
It's looks for me like the library has some hardcoded #include from avr, coz when I compiled the same code from platformIO in ArduinoIDE where I have instaled avr and stm32 boards it compiled fine.
@Kashouryo what IDE are you using? if arduino try to install avr and stm32 cores.
Was sm able to run FastLED with STM32 in platformIO?
I ran into the same or a similar issue, with platformIO 4.0.3 and FastLED 3.3.2.
When using board = bluepill_f103_c8 i get the same errors with unsuccesful imports of avr/io.h.
If i use board = genericSTM32F103C8 i run into a different issue. The avr/io.h import seems to only happen when __STM32F1__ is not defined, then it will default to: #include "platforms/avr/led_sysdefs_avr.h" in /FastLED_ID126/led_sysdefs.h which later causes the avr/io.h import. Using board = genericSTM32F103C8 seems to correctly define __STM32F1__ but reveals further issues in /FastLED_ID126/platforms/arm/stm32/fastpin_arm_stm32.h, there it errors in Line 52:85 with "incomplete type '__gen_struct_GPIOB' used in nested name specifier"
Hi, I am getting same error can anyone please help me with the fix or is it still open? error: incomplete type '__gen_struct_GPIOB' used in nested name specifier
@avinashsaraf what I did is kind of stupid 😄 but I was tired of looking for a solution so to walk around it I copied files from PIO into Arduino IDE and compile it there.
btw, it's really strange for me that solution was still not found, PIO is really popular just like STM MCU and FastLED so You would think that this is gonna be a big/common issue.
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.
The STM32F103 blue-pill build path through fbuild now works end-to-end. Verified locally with bluepill_f103c8 board on ststm32 / framework=arduino (arm-none-eabi-gcc 15.2.1):
build succeeded in 18.6s (flash: 17712 bytes, ram: 2816 bytes)
Your original error fatal error: avr/io.h: No such file or directory was the result of FastLED's old platforms.h falling through to the AVR fallback because STM32duino wasn't being detected. That preprocessor dispatch is FastLED-side - fbuild does not patch FastLED's headers, it only sets the toolchain define environment.
fbuild gap status: none for STM32F1. Remaining work to actually compile FastLED is in FastLED's src/platforms/arm/stm32/ tree.
Status check with current master — the two symptoms in this thread have diverged.
1. avr/io.h: No such file or directory — can no longer happen.
This was the platform dispatch falling through to AVR when __STM32F1__ wasn't defined. Both halves are now guarded in src/led_sysdefs.h:
AVR is selected only on defined(__AVR__) || defined(__AVR_ATmega4809__) (line 61), so it is no longer a catch-all.
The terminal #else raises a clear diagnostic instead of picking a wrong platform:
#error "This platform isn't recognized by FastLED... yet. See comments in FastLED/led_sysdefs.h for options."
An unrecognised board now says so, rather than failing three headers deep inside AVR.
2. incomplete type '__gen_struct_GPIOB' — cannot be verified locally.
bash compile bluepill --examples Blink does not reach the compiler at all:
daemon error: daemon did not become healthy after 3 spawn attempts (10s each).
Twice, consistently. To rule out a broken local environment I ran bash compile uno --examples Blink immediately after: succeeds in 2m09s. So this is STM32-specific, not general breakage — which matches FastLED/fbuild#385 being open for STM32 / STM32duino build support.
I'm deliberately not proposing a fix for fastpin_arm_stm32.h on that basis. A pin-mux or register-struct change that compiles nowhere I can test is the kind of change that links cleanly and silently drives nothing; the honest state is "blocked on fbuild#385" rather than a patch nobody has built.
So this issue is really two: symptom 1 is fixed, symptom 2 is gated on STM32 build support landing. Once fbuild#385 makes bash compile bluepill work, the __gen_struct_GPIOB half becomes checkable in minutes.
Closing — this thread contained two distinct failures, and both have been structurally fixed. Taking them separately, since they got conflated at the time.
Failure 1 — avr/io.h: No such file or directory
@H4RL3K4SP3R diagnosed this exactly right in 2019:
The avr/io.h import seems to only happen when __STM32F1__ is not defined, then it will default to #include "platforms/avr/led_sysdefs_avr.h"
That's precisely what happened: AVR was the unconditional #else fallback in led_sysdefs.h, so any board whose defines FastLED didn't recognise silently landed on AVR and then died on a missing AVR header — a confusing error that says nothing about the real problem.
Fixed two ways.
The AVR arm is now guarded rather than a catch-all (src/led_sysdefs.h:61):
and the real #else is now an explicit unsupported-platform diagnostic pointing at PORTING.md, rather than a wrong #include. An unrecognised board now tells you it's unrecognised.
The STM32 detection also got much broader (led_sysdefs.h:46) — STM32F10X_MD, __STM32F1__, STM32F1, STM32F1xx, STM32F2XX, STM32F4, STM32U5*, STM32G0* and more. @markopl96 and @Kashouryo, that's why the same code compiled in one IDE but not the other: different cores emit different defines, and only some were recognised. Far fewer fall through now.
Failure 2 — incomplete type '__gen_struct_GPIOB' used in nested name specifier
The __gen_struct_GPIOx machinery no longer exists in src/platforms/arm/stm32/fastpin_arm_stm32.h — the file was rewritten around USE_NEW_STM32_PIN_DEFINITIONS, whose own comment explains the motivation:
The legacy definitions use incorrect Arduino pin numbers instead of STM32 pin names
It's selected automatically for Blue Pill, Maple Mini, generic F103C8/T, F4 variants and more. So both the crash and the mis-mapped pins behind it are gone.
Current status
The maintainer verified the bluepill_f103c8 path end-to-end via fbuild (ststm32 / framework=arduino, arm-none-eabi-gcc 15.2.1) at 17712 B flash / 2816 B RAM, and stm32f103c8, stm32f103cb and stm32f103tb are all in the CI board matrix.
Honest caveat: I tried to reproduce that build locally to confirm, and couldn't — my toolchain install wedged on a lock unrelated to this code. So the fix claims above are from source inspection plus the maintainer's verified build, not from a build I ran myself.
@markopl96 — your workaround of copying files into the Arduino IDE was a rational response to a genuinely misleading error, and you were right that it shouldn't have taken that. The error now names the actual problem.
If a current FastLED still fails on an F103 board, please open a fresh issue with the exact board = value and core version — the two failure modes above are gone, so it would be something new.
Activity
markopl96 commentedon Jun 22, 2019
I'm using platformIO and I'm getting the same error, did someone found solution for that?
It's looks for me like the library has some hardcoded #include from avr, coz when I compiled the same code from platformIO in ArduinoIDE where I have instaled avr and stm32 boards it compiled fine.
@Kashouryo what IDE are you using? if arduino try to install avr and stm32 cores.
Was sm able to run FastLED with STM32 in platformIO?
Kashouryo commentedon Jul 1, 2019
@markopl96
I am using the original Arduino IDE 1.8.10
H4RL3K4SP3R commentedon Sep 3, 2019
I ran into the same or a similar issue, with platformIO 4.0.3 and FastLED 3.3.2.
When using
board = bluepill_f103_c8i get the same errors with unsuccesful imports of avr/io.h.If i use
board = genericSTM32F103C8i run into a different issue. The avr/io.h import seems to only happen when__STM32F1__is not defined, then it will default to:#include "platforms/avr/led_sysdefs_avr.h"in /FastLED_ID126/led_sysdefs.h which later causes the avr/io.h import. Usingboard = genericSTM32F103C8seems to correctly define__STM32F1__but reveals further issues in /FastLED_ID126/platforms/arm/stm32/fastpin_arm_stm32.h, there it errors in Line 52:85 with"incomplete type '__gen_struct_GPIOB' used in nested name specifier"Fxlr8 commentedon Oct 15, 2019
same for me,
incomplete type '__gen_struct_GPIOA' used in nested name specifiererrorstm32f100CB, platformIO, fastled 3.3.2
avinashsaraf commentedon Oct 29, 2019
Hi, I am getting same error can anyone please help me with the fix or is it still open?
error: incomplete type '__gen_struct_GPIOB' used in nested name specifier
markopl96 commentedon Oct 29, 2019
@avinashsaraf what I did is kind of stupid 😄 but I was tired of looking for a solution so to walk around it I copied files from PIO into Arduino IDE and compile it there.
btw, it's really strange for me that solution was still not found, PIO is really popular just like STM MCU and FastLED so You would think that this is gonna be a big/common issue.
zackees commentedon Jun 3, 2026
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.
zackees commentedon Jun 3, 2026
Triage update from fbuild side, tracked under FastLED/fbuild#385.
The STM32F103 blue-pill build path through fbuild now works end-to-end. Verified locally with
bluepill_f103c8board onststm32/framework=arduino(arm-none-eabi-gcc 15.2.1):Your original error
fatal error: avr/io.h: No such file or directorywas the result of FastLED's oldplatforms.hfalling through to the AVR fallback because STM32duino wasn't being detected. That preprocessor dispatch is FastLED-side - fbuild does not patch FastLED's headers, it only sets the toolchain define environment.fbuild gap status: none for STM32F1. Remaining work to actually compile FastLED is in FastLED's
src/platforms/arm/stm32/tree.See FastLED/fbuild#385 and PR FastLED/fbuild#396.
zackees commentedon Aug 1, 2026
Status check with current master — the two symptoms in this thread have diverged.
1.
avr/io.h: No such file or directory— can no longer happen.This was the platform dispatch falling through to AVR when
__STM32F1__wasn't defined. Both halves are now guarded insrc/led_sysdefs.h:AVR is selected only on
defined(__AVR__) || defined(__AVR_ATmega4809__)(line 61), so it is no longer a catch-all.The terminal
#elseraises a clear diagnostic instead of picking a wrong platform:An unrecognised board now says so, rather than failing three headers deep inside AVR.
2.
incomplete type '__gen_struct_GPIOB'— cannot be verified locally.bash compile bluepill --examples Blinkdoes not reach the compiler at all:Twice, consistently. To rule out a broken local environment I ran
bash compile uno --examples Blinkimmediately after: succeeds in 2m09s. So this is STM32-specific, not general breakage — which matches FastLED/fbuild#385 being open for STM32 / STM32duino build support.I'm deliberately not proposing a fix for
fastpin_arm_stm32.hon that basis. A pin-mux or register-struct change that compiles nowhere I can test is the kind of change that links cleanly and silently drives nothing; the honest state is "blocked on fbuild#385" rather than a patch nobody has built.So this issue is really two: symptom 1 is fixed, symptom 2 is gated on STM32 build support landing. Once fbuild#385 makes
bash compile bluepillwork, the__gen_struct_GPIOBhalf becomes checkable in minutes.zackees commentedon Aug 1, 2026
Closing — this thread contained two distinct failures, and both have been structurally fixed. Taking them separately, since they got conflated at the time.
Failure 1 —
avr/io.h: No such file or directory@H4RL3K4SP3R diagnosed this exactly right in 2019:
That's precisely what happened: AVR was the unconditional
#elsefallback inled_sysdefs.h, so any board whose defines FastLED didn't recognise silently landed on AVR and then died on a missing AVR header — a confusing error that says nothing about the real problem.Fixed two ways.
The AVR arm is now guarded rather than a catch-all (
src/led_sysdefs.h:61):and the real
#elseis now an explicit unsupported-platform diagnostic pointing atPORTING.md, rather than a wrong#include. An unrecognised board now tells you it's unrecognised.The STM32 detection also got much broader (
led_sysdefs.h:46) —STM32F10X_MD,__STM32F1__,STM32F1,STM32F1xx,STM32F2XX,STM32F4,STM32U5*,STM32G0*and more. @markopl96 and @Kashouryo, that's why the same code compiled in one IDE but not the other: different cores emit different defines, and only some were recognised. Far fewer fall through now.Failure 2 —
incomplete type '__gen_struct_GPIOB' used in nested name specifierThis was the deeper bug, hit by @H4RL3K4SP3R, @Fxlr8 and @avinashsaraf once they did get past the AVR fallback.
The
__gen_struct_GPIOxmachinery no longer exists insrc/platforms/arm/stm32/fastpin_arm_stm32.h— the file was rewritten aroundUSE_NEW_STM32_PIN_DEFINITIONS, whose own comment explains the motivation:It's selected automatically for Blue Pill, Maple Mini, generic F103C8/T, F4 variants and more. So both the crash and the mis-mapped pins behind it are gone.
Current status
The maintainer verified the
bluepill_f103c8path end-to-end via fbuild (ststm32/framework=arduino, arm-none-eabi-gcc 15.2.1) at 17712 B flash / 2816 B RAM, andstm32f103c8,stm32f103cbandstm32f103tbare all in the CI board matrix.Honest caveat: I tried to reproduce that build locally to confirm, and couldn't — my toolchain install wedged on a lock unrelated to this code. So the fix claims above are from source inspection plus the maintainer's verified build, not from a build I ran myself.
@markopl96 — your workaround of copying files into the Arduino IDE was a rational response to a genuinely misleading error, and you were right that it shouldn't have taken that. The error now names the actual problem.
If a current FastLED still fails on an F103 board, please open a fresh issue with the exact
board =value and core version — the two failure modes above are gone, so it would be something new.