ESP32 Arduino failing to initialise since August 2022


Since sometime around August 2022, my ESP32 Arduino-based project is failing to initialise.

For support of C++17, we switched to the unofficial ESP-IDF from Marcovannoord.
See full platformio.ini:

platform = espressif32
board = esp32dev

framework = arduino
monitor_speed = 115200
board_build.f_cpu = 240000000L

build_unflags = 
     -std=gnu++11   ; Disable the use of gnu++11, as we want to move to c++17
build_flags = 
     -std=c++17     ; Enable the use of c++17
     -I "test/integration"
     -I "test"

platform_packages =
     toolchain-xtensa32 @ 3.80200.200512
     framework-arduinoespressif32 @

Everything was working flawlessly until about August 2022 when I started getting this error, when ever I try to initialise and compile this project on a new machine, compile on machines that were initialised until that point work without a problem.

 *  The terminal process "C:\Users\***\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------Error! Failed to extract upstream toolchainconfigurations:
Bad package version `1.22.0-80-g6c4433a-5.2.0`
You can disable this feature via the `board_build.arduino.upstream_packages = no` setting in your `platformio.ini` file. 

Based on the package version given, I believe I have tracked it to the xtensa-esp32-elf-gcc compiler defined as a dependency of the unofficial ESP-IDF by Marcovannoord (see here).

When I access the source url defined in the file shared above, I can download the xtensa-esp32-elf-gcc at the specified version without a problem.

I also tried switching to the newer official ESP-IDF version from Espressif (see here) and while that seems to resolve the initialisation issue, I get a bunch of compile errors instead.

One last thing I have tried so far is getting the library from already initialised machines and pasting it within the Arduino15 folder on the new machines, but also with no luck.

Any ideas how I could fix this? Thank you very much for your help!

With the latest stable versions, there are no problems when using C++17, see What's the latest on using C++17? - #4 by maxgerhardt.

I don’t think using the newest platform code is a good idea here when you want to use the older fork stuff, as I remember it people were doing that in the time where Arduino-ESP32 was supported at 1.0.6 but 2.0.x came out and it wasn’t supported yet. So, a better choice should be platform = espressif32@3.5.0 in accordance to the releases.

This seems to be coming from the PlatformIO core. If you have a working machine, open a CLI and ask for its pio --version. In the non-working machine, also open the same CLI, and uses the pip as designated by the pio system info command to pip uninstall platformio and pip install platformio=='yourversion'.

When you use the regular new platform with the regular arduino core version 2.0.4, you already have ESP-IDF v4.4 as the base, see arduino-esp32/tools/sdk at 2.0.4 · espressif/arduino-esp32 · GitHub. What are the compile errors you get with this?