Using different toolchain versions

I want to integrate my existing framwork with platformio. It requires GCC 10, so I must first enable the use of newer toolchains. I copied the avr-gcc-10.2.0-P0829, added a platform.json, installed it with pio platform install from a local directory. But when I now try to use it the second phase of the installation can’t find it:

$ pio platform install file://c:/ti-software/platformio/avr-gcc-10
Platform Manager: Installing file://c:/ti-software/platformio/avr-gcc-10
Platform Manager: toolchain-atmelavr @ 1.90300.191015 has been installed!
The platform 'file://c:/ti-software/platformio/avr-gcc-10' has been successfully installed!
The rest of the packages will be installed later depending on your build environment.

Wouter@DESKTOP-SPUBNQD MINGW64 /c/ti-software/platformio_test/native-blink
$ pio run -v
Processing uno (platform: atmelavr; board_build.mcu: atmega328p; board_build.f_cpu: 16000000L; upload_protocol: arduino; upload_speed: 115200; platform_packages: toolchain-atmelavr@~1.90300.191015)
Tool Manager: Installing platformio/toolchain-atmelavr @ ~1.90300.191015
Error: Could not find the package with 'platformio/toolchain-atmelavr @ ~1.90300.191015' requirements for your system 'windows_amd64'

What am I doing wrong?

Also, what would be the correct designation for this GGC 10.2, would it be “100200” ?

Usually you install platforms like that, not packages… In any case, packages installed like this will not take effect globally. The platform will dictate the package and version to use.

The override is the per-project option platform_packages.

So you must rather do

; override compiler
platform_packages = 

in the platformio.ini.

Note that the toolchain folder must also contain a package.json, analog to C:\Users\<user>\.platformio\packages\toolchain-atmelavr\package.json, preferably with the correctly updated version info.

More technical details about packages are discussed in here.

thanks, that worked, now using C++ 20 features :wink: