Cannot compile ESP8266 with Arduino framework


#1

Hi,

first of all thanks to all creators of platformio. It’s a fantastic project.

However I’m trying to compile some code for the ESP8266 with Arduino framework.

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino

But as soon as I include ESP8266WiFi.h I get the following error message.

Converting main.ino
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(light)
Collected 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> v1.0
|   |-- <FreeRTOS> v10.0.0-10
Compiling .pioenvs\nodemcuv2\src\main.ino.cpp.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\croutine.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\event_groups.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\event_groups.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\heap_3.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\list.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\port.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\queue.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\stream_buffer.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\tasks.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\timers.c.o
Compiling .pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\variantHooks.cpp.o
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\croutine.c:29:
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\heap_3.c:48:
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\list.c:31:
CC:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\port.c:31:27: fatal error: avr/interrupt.h: No such file or directory
#include <avr/interrupt.h>
^
compilation terminated.
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\event_groups.c:38:
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\stream_buffer.c:39:
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\queue.c:37:
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^^
compilation terminated.
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\timers.c:37:
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
In file included from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\Arduino_FreeRTOS.h:53:0,
from C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\tasks.c:39:
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\FreeRTOSConfig.h:32:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
C:\users\xxx\.platformio\lib\FreeRTOS_ID507\src\variantHooks.cpp:28:20: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^
compilation terminated.
Archiving .pioenvs\nodemcuv2\liba3d\libESP8266WiFi.a
Compiling .pioenvs\nodemcuv2\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pioenvs\nodemcuv2\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pioenvs\nodemcuv2\FrameworkArduino\IPAddress.cpp.o
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\croutine.c.o] Error 1
Compiling .pioenvs\nodemcuv2\FrameworkArduino\MD5Builder.cpp.o*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\heap_3.c.o] Error 1

*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\list.c.o] Error 1
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\port.c.o] Error 1
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\event_groups.c.o] Error 1
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\stream_buffer.c.o] Error 1
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\queue.c.o] Error 1
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\timers.c.o] Error 1
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\tasks.c.o] Error 1
*** [.pioenvs\nodemcuv2\libea8\FreeRTOS_ID507\variantHooks.cpp.o] Error 1
==================================================================================================================== [ERROR] Took 2.20 seconds

This seems strange because I don’t want to use RTOS for my project.
I’ve also installed libraries for the ESP32 including RTOS a while ago and that works perfectly fine.

Probably it’s just a wrong setting somewhere so I hope someone could point me in the right direction.

I’m using:
VSCode (latest)
PIO updated today

If you need any more please let me know.

Thanks.
br Marc

EDIT:
added lib_ignore = FreeRTOS to my platformio.ini which seems to help. Ist that meant to be like so?


#2

I cannot reproduce this when compiling the WiFi Scan example and using the newest platform updates (pio platform update). What main sketch code are you compiling exactly? The inclusion of ESP8266WiFi.h should not cause the inclusion of FreeRTOS.


#3

I used the Wifi Scan too, but could also reproduce it without any code inside loop() and setup().
Do you have the ESP32 framework incl. FreeRTOS installed too? Maybe there is a conflict when having both installed.


#4

Yes I also have the ESP32 framework installed. Could you maybe try to re-install the frameworks? pio platform uninstall espressif8266 and pio platform uninstall espressif32 then rebuild again (automatically re-downloads stuff)


#5

Unistalled both, only compiled esp8266 project, rebuilt esp8266 project only, and still the same issue. However if I ignore the FreeRTOS lib in the ini it works.


#6

I have a similar problem! A solution is found?


#7

Did you added lib_ignore = FreeRTOS to your platformio.ini yet. That worked for me, so I stopped further investigation.


#8
  1. PlatformIO Library Dependency Finder works in soft mode by default and checks only for a compatibility with “frameworks”. In your case, https://platformio.org/lib/show/507/FreeRTOS is compatible only with AVR architecture.
  2. “added lib_ignore = FreeRTOS to my platformio.ini which seems to help. Ist that meant to be like so?” - it is a normal solution
  3. You can change http://docs.platformio.org/en/latest/librarymanager/ldf.html#compatibility-mode to “strict” mode instead of lib_ignore = FreeRTOS. PlatformIO will automatically ignore incompatible libraries according to your “platform” used in platformio.ini. Please note that you will need the latest dev/version of PIO Core. You can upgrade it via pio upgrade --dev.