3 months on - rebuilding a working project fails

I have had a pause in development - I come back to a know working project and recompile it and get a failure.
What could possibly have changed - has platform IO updated something - how do I know and how can I control this?

The project has an #include<freertos.h> a copied section of code from the web which worked.
Now I get the can’t find freertos.h and advice to sort out the library path.

Where is <freertos.h> in my installation and why would it now be missing.
Where is the library path and why would it have changed?
???

TIA.

This is way too vague. We need at least the full error message, the platformio.ini and the file structure of your project. If the project is too big, try reproducing the error in a smaller project with similar platformio.ini.

Understood.

There are a lot of errors that occurred.
The first was

src/main.cpp:9:10: fatal error: FreeRTOS.h: No such file or directory

To resolve it I added the freertos.h file to the ‘libs’ folder and add a directive build_flags = -I"lib" to find it. ( I needed to find what to do here from web help )

Subsequent to that there were then other compiler warnings preventing a successful compile requiring a change to the pio.ini
From this:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
lib_deps =
bodmer/TFT_eSPI@^2.5.23
contrem/arduino-timer@^3.0.0
bblanchon/ArduinoJson@^6.21.2
me-no-dev/ESP Async WebServer@^1.2.3
ayushsharma82/AsyncElegantOTA@^2.2.7
board_build.partitions = default_16MB.csv

To this:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
build_flags = -I"lib"
lib_deps =
bodmer/TFT_eSPI@^2.5.23
contrem/arduino-timer@^3.0.0
bblanchon/ArduinoJson@^6.21.2
GitHub - me-no-dev/ESPAsyncWebServer: Async Web Server for ESP8266 and ESP32
ayushsharma82/AsyncElegantOTA@^2.2.7
board_build.partitions = default_16MB.csv

Essentially, the environment must have changed requiring me to amend these things which was a worry, so I get concerned that maybe tomorrow something else changes that demands my time to resolve.

Where / which folder would the <FreeRTOS.h> normally reside.
Why would it move or why would the compiler suddenly no longer find it?
The Async webserver at version 1.2.3 clearly needed updating as there was an error preventing it compiling.

The project now compiles and links although I haven’t tried it on a target.
What worries me is why these changes were needed from a stable project and how can I control what must have been updated automatically when I opened VS Code.

No no no. FreeRTOS is built into the Arduino-ESP32 core. It should already be in there.

With the current espressif32 platform version, it should use Arduino-ESP32 v2.0.11. Which means this freertos/FreeRTOS.h file should be available.

If FreeRTOS can’t be found, that sounds more like broken packages. Given you have not modified any PlatformIO-package internal files (in C:\Users\<user>\.platformio), I would suggest:

  1. Delete your project-local FreeRTOS files in the lib/ folder completely
  2. Remove any build_flags =-Ilibs reference to it in the platformio.ini
  3. Close VSCode
  4. Delete the C:\Users\<user>\.platformio\platforms folder
  5. Delete the C:\Users\<user>\.platformio\packages folder
  6. Delete the C:\Users\<user>\.platformio\.cache folder
  7. Restart VSCode
  8. Wait for reinit
  9. Build again.

Done that … I get in the output window :

[11/2/2023, 3:56:56 PM] Unable to resolve configuration with compilerPath “C:/Users/lumef/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe”. Using “cl.exe” instead.
[11/2/2023, 3:56:56 PM] Unable to resolve configuration with compilerPath “C:/Users/lumef/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe”. Using “cl.exe” instead.

Then a message:

Cannot validate since a PHP installation could not be found. Use the setting ‘php.validate.executablePath’ to configure the PHP executable.

The main.c file still shows the error

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\lumef\OneDrive\Documents\PlatformIO\Projects\Smoke 3 -OTA - Copy - for recompileerros\src\main.cpp).C/C++(1696)
cannot open source file "FreeRTOS.h"C/C++(1696)

So I’m still stuck. :frowning:

Is normal after packages/ have been deleted and PlatformIO is reinstalling them.

This is caused by the PHP extension for VSCode and completely unrelated to PlatformIO or the current problem.

OneDrive has many reported problems. Can you move your project out of OneDrive and File → Open Folder in VSCode at the new location?

I wondered … so I did move it out of there .
It’s in a dropbox subfolder now…( same problem I will move it someone simple and try one more time, but this is the current output .

** EDITED ** Same result in a top level folder

  • Executing task: C:\Users\lumef.platformio\penv\Scripts\platformio.exe run

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 32 (6.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:

  • framework-arduinoespressif32 @ 3.20011.230801 (2.0.11)
  • tool-esptoolpy @ 1.40501.0 (4.5.1)
  • toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 41 compatible libraries
    Scanning dependencies…
    Dependency Graph
    |-- TFT_eSPI @ 2.5.23
    |-- arduino-timer @ 3.0.0
    |-- ArduinoJson @ 6.21.2
    |-- ESP Async WebServer @ 1.2.3
    |-- AsyncElegantOTA @ 2.2.7
    |-- Wire @ 2.0.0
    |-- WiFi @ 2.0.0
    |-- SPIFFS @ 2.0.0
    |-- AsyncTCP @ 1.1.1
    |-- HTTPClient @ 2.0.0
    |-- SPI @ 2.0.0
    |-- WiFiClientSecure @ 2.0.0
    Building in release mode
    Compiling .pio\build\esp32dev\src\buttons.cpp.o
    Compiling .pio\build\esp32dev\src\control.cpp.o
    Compiling .pio\build\esp32dev\src\display.cpp.o
    Compiling .pio\build\esp32dev\src\io.cpp.o
    Compiling .pio\build\esp32dev\src\machine.cpp.o
    Compiling .pio\build\esp32dev\src\main.cpp.o
    Building .pio\build\esp32dev\bootloader.bin
    Generating partitions .pio\build\esp32dev\partitions.bin
    esptool.py v4.5.1
    Creating esp32 image…
    Merged 1 ELF section
    Successfully created esp32 image.
    Compiling .pio\build\esp32dev\lib75f\SPI\SPI.cpp.o
    Compiling .pio\build\esp32dev\lib024\FS\FS.cpp.o
    Compiling .pio\build\esp32dev\lib024\FS\vfs_api.cpp.o
    src/machine.cpp: In member function ‘bool Machine::tryset(byte, channelstate_t)’:
    src/machine.cpp:233:5: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
    In file included from src/display.cpp:6:
    .pio/libdeps/esp32dev/TFT_eSPI/TFT_eSPI.h:970:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp]
    #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available!
    ^~~~~~~
    Compiling .pio\build\esp32dev\libba7\SPIFFS\SPIFFS.cpp.o
    Compiling .pio\build\esp32dev\libd4a\LittleFS\LittleFS.cpp.o
    src/display.cpp: In function ‘bool clearDisplay()’:
    src/display.cpp:271:1: warning: no return statement in function returning non-void [-Wreturn-type]
    }
    ^
    Compiling .pio\build\esp32dev\lib318\TFT_eSPI\TFT_eSPI.cpp.o
    In file included from src/main.cpp:7:
    .pio/libdeps/esp32dev/AsyncElegantOTA/src/AsyncElegantOTA.h:4:2: warning: #warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release. [-Wcpp]
    #warning AsyncElegantOTA.loop(); is deprecated, please remove it from loop() if defined. This function will be removed in a future release.
    ^~~~~~~
    src/main.cpp:9:10: fatal error: FreeRTOS.h: No such file or directory

  • Looking for FreeRTOS.h dependency? Check our library registry!
  • CLI > platformio lib search “header:FreeRTOS.h”
  • Web > PlatformIO Registry

#include <FreeRTOS.h>
^~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\esp32dev\lib7ef\AsyncTCP\AsyncTCP.cpp.o
Compiling .pio\build\esp32dev\libcd6\WiFi\WiFi.cpp.o
*** [.pio\build\esp32dev\src\main.cpp.o] Error 1
In file included from .pio/libdeps/esp32dev/TFT_eSPI/TFT_eSPI.cpp:16:
.pio/libdeps/esp32dev/TFT_eSPI/TFT_eSPI.h:970:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp]
#warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available!
^~~~~~~
=================================================================== [FAILED] Took 8.33 seconds ===================================================================

Oh actually I just checked in a separate project and

  • you must do #include <freertos/FreeRTOS.h> instead of #inculde <FreeRTOS.h>
  • this line is already included in Arduino.h, so if you already do #include <Arduino.h>, you don’t need to include it manually
  • the FreeRTOS.h → freertos/FreeRTOS.h may or may not have changed in a Arduino-ESP32 update.

Well Thankyou! That fixed that particular problem
I still don’t’ know why I (we) needed that change since clearly the project compiled ok previously.
Any insight into that would of course be useful.
Edit - ESP UPDATE…
If it happened I didn’t notice… but it probably did. I’m sure there’s a way to lock a build state with a particular version… but I don’t know how.