platformio / platform-atmelmegaavr

Atmel megaAVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelmegaavr
Apache License 2.0
29 stars 22 forks source link

Platform atmelmegaavr installs old gcc by default #66

Open jblang opened 10 months ago

jblang commented 10 months ago

atmelmegaavr installs toolchain-atmelavr@1.70300.191015 instead of platformio/toolchain-atmelavr@3.70300.220127 by default. The old version of gcc lacks the spec files, includes, and libraries needed for the new AVR Dx parts and many of the newer ATtiny parts. This can be worked around by adding the following line to platformio.ini:

platform_packages = platformio/toolchain-atmelavr@^3.70300.220127

But why isn't it installing the latest version by default?

BTW, if platformio.ini includes framework = arduino, then both versions of GCC will get installed and it will use the new one by default, so you may not notice the issue. But if you are doing native development (e.g., using the native-blink example), it won't compile for newer parts without explicitly specifying the newer gcc version. See this thread for more details.

chemicstry commented 8 months ago

Having the same issue with ATtiny426, compiling throws avr-gcc: error: device-specs/specs-attiny426: No such file or directory.

The suggested line in platformio.ini fixed the issue, thanks!