Toolchain-atmelavr uses outdated avr-gcc toolchain

PlatformIO provides us with avr-gcc whose version is 7.3.0 but the latest is 10.1.0, need the latest toolchain to use C++ 17/20 just to mess around.

/home/whosethenerd/.platformio/packages/toolchain-atmelavr/bin/avr-gcc
/home/whosethenerd/.platformio/packages/toolchain-atmelavr/bin/avr-gcc-7.3.0
/home/whosethenerd/.platformio/packages/toolchain-atmelavr/bin/avr-gcc-ar
/home/whosethenerd/.platformio/packages/toolchain-atmelavr/bin/avr-gcc-nm
/home/whosethenerd/.platformio/packages/toolchain-atmelavr/bin/avr-gcc-ranlib

PlatformIO follows the toolchains used by the frameworks (e.g. Arduino) so it isn’t always up to do date.

Per platform_packages documentation you can arbitrarily change the source of a package, toolchain-atmelavr in your case. Just downlaod the a build from AVR-GCC 12.1.0 for Windows 32 and 64 bit | Zak’s Electronics Blog ~*, extract it, copy the ~/.platformio/packages/toolchain-atmelavr/package.json in the extracted folder file updating the version field, and point to the path using the file:// pseudoprotocol such as

platform_packages = 
   toolchain-atmelavr@file://<path to extracted 10.1.0 toolchain where package.json is>
1 Like