ESP32, gcc 8 toolchain

I’m confused about the current state of ESP32 support. I see there’s been a recent update of the ESP32 platform ( great, no problem with that ). I’ve installed that update. It says it contains ESP32 IDF 3.3.

I’m keen to get a recent toolchain update that Expressif made, which switches the version of gcc from 5.2 to 8, because otherwise I have to put workarounds in my code to use some std functions. They also fix a number of other issues.

It appears that the ESP32 platform update did not update the toolchain, because I still need the workaround to use std::to_string().

So I would like to know a couple of things. Firstly, how can I verify the status/version of the current ESP32 toolchain that platformIO is using ? Secondly, can I somehow independently update that toolchain to the latest version from Espressif git ?

1 Like

Look into your PIO home folder (C:\Users\<user>\.platformio), go to packages\toolchain-xtensa32\bin, open a shell in that folder and execute xtensa-esp32-elf-g++.exe --version. For me this outputs xtensa-esp32-elf-g++ (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a5) 5.2.0.

You can override the toolchain-xtensa32 packages with your own one as described in the documentation.

Now together with e.g. you can create a new ZIP file which has the needed folder structure (and package.json file). Which OS are you using?

If true this is a bug in GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO. What is your source for “ESP-IDF 3.3 uses GCC 8”?

As far as I can tell from Espressif’s web site, ESP-IDF v3.3 still uses version 5.2 of the toolchain (e.g. see Standard Setup of Toolchain for Mac OS). And as PlatformIO is still at ESP-IDF v3.3, the toolchain version seems correct.

The toolchain documentation has changed with version 4 [see Step 3. Set up the tools).