ESP32 with C++ 20 for std::span

Wut? Updating your local GCC installation that’s compiling for x86_64, aka your Desktop, has 0 effect on which toolchain PlatformIO uses for the XTensa32 architecture. PlatformIO strictly decouples the used build toolchain from whatever is regularly installed on your computer. The first thing that would be in order is to upgrade the actual toolchain package: https://registry.platformio.org/tools/espressif/toolchain-xtensa-esp32/versions

Per documentation.

platform_packages =
  espressif/toolchain-xtensa-esp32@12.2.0+20230208

You might then also need just -std=gnu++20 instead of 2a.

1 Like