[SOLVED]'#include <avr/io.h>' No such file or directory

I am currently programming my 7³ RGB LEDCube and using an Arduino Mega. With its 8kB RAM is the Mega pretty good for LEDCubes but some animations use up to 6.5kB RAM and the Mega starts to limit me by coding animations. Because of this did I order a STM32 which should have enough RAM for even bigger cubes. I can compile and upload simple sketches but the FastLED library causes include problems:

In file included from C:\Program Files (x86)\Arduino\libraries\FastLED/led_sysdefs.h:27:0,

                 from C:\Program Files (x86)\Arduino\libraries\FastLED/FastLED.h:44,

                 from C:\Program Files (x86)\Arduino\libraries\LEDCube3/utilities.h:3,

                 from C:\Program Files (x86)\Arduino\libraries\LEDCube3/LEDCube.h:3,

                 from C:\Users\Wieland\Documents\Arduino\LEDCube_VS\LEDCube_VS.ino:1:

C:\Program Files (x86)\Arduino\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 do not really understand why this error appears because the file ‘io.h’ exists in the correct folder.

I do not really understand why this error appears because the file 'io.h' exists in the correct folder.

That might be but the STM32 is not an AVR processor, so it probably won't look there for include files. Which folder did you think is the correct one for this file?

In led_sysdefs.h there is a handling for one STM32 processor:

#elif defined(STM32F10X_MD)
#include "platforms/arm/stm32/led_sysdefs_arm_stm32.h"

but your's seem to be different. Maybe you have to patch the library to get support for your system.

1 Like

I was able to solve this problem after several hours: https://github.com/evq/FastLED/tree/stm32f103