PlatformIO is choosing the compilers to fit those which are used natively by the framework, e.g. Arduino or mbed-os or Zephyr. E.g., Arduino cores are usually based of older GCC versions, and to keep compatibility so that one code compiles just as in the other environment, PIO does the same. So, changing the compiler should be done with care.
PIO only works packages (and never native installs). The ARM GCC is in the packages toolchain-gccarmnoneeabi
. The documentation tells you how to choose a certain package version. Available package versions can be found by visiting the bintray and filtering for toolchain-gccarmnoneeabi-
. It’s then listed per-OS. E.g., the latest version for Windows x64 is 1.90301.200702
meaning GCC 9.3.1 and thus selectable via platform_packages = toolchain-gccarmnoneeabi@1.90301.200702
.
If you want the latest-greatest and it’s not available in the package repo, you must create a package yourself, by downloading the compiler archive sticking in a package.json
(format can be seen e.g. in a downloaded bintray pacakge), then pointing to a downloadable version of that archive in a platform_packages
directive.
Just create the project with any framework in that wizard, then modify the platformio.ini
to remove the framework = ...
line. That will remove compiling in a framework and you’re now baremetal. An example of that is given for an AVR Atmega328P in this project.