Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using toolchain-atmelavr v5.4.0 vs v7.3.0 #224

Closed
gudnimg opened this issue Dec 30, 2020 · 7 comments
Closed

Using toolchain-atmelavr v5.4.0 vs v7.3.0 #224

gudnimg opened this issue Dec 30, 2020 · 7 comments

Comments

@gudnimg
Copy link

gudnimg commented Dec 30, 2020

Hello everyone :)

I was simply trying to include #include <cstdint> for ATmega2561 which didn't work on v5.4.0 or v7.3.0 so maybe avr doesn't support it (curious about some C++ features). Anyway... I saw a big difference in program size between using v5.4.0 or v7.3.0: 468 byte difference to be exact!

[env]
platform = atmelavr
framework = arduino
monitor_speed = 115200

board_build.f_cpu = 16000000L
board_hardware.uart = uart0
board_hardware.oscillator = external

upload_flags = -Pusb

; Use latest version (version 7.3.0)
platform_packages = 
    toolchain-atmelavr@~1.70300.191015

[env:megaatmega2561]
board = ATmega2561
board_build.mcu = atmega2561

I am curious why v7.3.0 is not the default? Are there some compatability issues? Also is it possible to use an even newer version for avr-gcc? I noticed Arduino IDE uses v7.3.0 in their latest version v1.8.13

toolchain-atmelavr v5.4.0

image

toolchain-atmelavr v7.3.0

image

@MCUdude
Copy link
Contributor

MCUdude commented Jan 1, 2021

I'm not sure why they aren't using v7.3.0 either. Arduino IDE have been doing this for a long time, and some of the gurus over at the Avrfreaks forum complains that MPLAB X and Atmel Studio 7 bundles v5.4.0 and not v7.3.0. BTW how did you switch between these two versions in PlatformIO?

@valeros any good reason to stay at v5.4.0?

@gudnimg
Copy link
Author

gudnimg commented Jan 1, 2021

You can do it like this:

; Use latest version (v7.3.0)
platform_packages = 
    toolchain-atmelavr@~1.70300.191015

@EmperorArthur
Copy link

Thank you so much @GunZi200 I have been searching everywhere for how to include a newer toolchain.

How did you find what version mapped to "~1.70300.191015"? I can't seem to find that information.

@gudnimg
Copy link
Author

gudnimg commented Jan 28, 2021

@maxgerhardt
Copy link

maxgerhardt commented Feb 13, 2021

Users also encounter actual compiler bugs in e.g. here and some Arduino libraries like FastLED need the newer compiler too to be compilable (see here). Also the avr-stub library sometimes doesn't compile without a newer compiler (see here). If the Arduino IDE is using it currently, I'd say we should upgrade immediately.

CC @valeros

@technik
Copy link

technik commented Feb 15, 2021

As a workaround, I downloaded GCC 10 for AVR from here https://blog.zakkemble.net/avr-gcc-builds/ and manually copied it all to ~/.platformio/packages/toolchain-atmelavr. Now I can use the latest C++ in my builds :)
It would be nice to see the main repo keep up with latest gcc by default though.

@EmperorArthur
Copy link

At the least the documentation around "toolchain-atmelavr" could be expanded. Especially since this will probably happen again in the future. Instead of stumbling around, trying to figure out where to get the latest version, there should be a page somewhere.

As an example:

  • The first google result, which is an old version of the docs, inaccurately says that "toolchain-atmelavr" contains multiple things, but has no links to the package itself
  • The latest version of the docs, just link to GCC's latest page on the AVR. Not even the one for the compiler we're using!
  • The packages page on the main site, also just links to GCC!
  • Searching Google for "toolchain-atmelavr 7.3" (without the quotes) now brings up fixes, but they don't explain why the version numbers correspond

Heck, I have no idea where the "toolchain-atmelavr" repository is, where PlatfomIO downloads it from, or even how it is built!

This might be another issue, but it certainly made something as easy as upgrading a dependency into a nightmare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants