I just noted that Microchip has made the jump from AVR-GCC 7 to 15 in September, and they offer the compiled toolchains on their website, GCC Compilers for AVR® and Arm®-Based MCUs and MPUs | Microchip Technology . Are there any plans to upgrade the toolchain in the Arduino IDE/CLI as well? Or, maybe, to offer an option of doing so?
Hi @fogg.
Each Arduino boards platform has complete freedom to define and provide its toolchain. So there is no need for any work whatsoever in the Arduino IDE or Arduino CLI codebases to enable this.
The work to be done is to specify the use of the newer version of avr-gcc in the configuration of the individual boards platforms that wish to do so:
https://arduino.github.io/arduino-cli/latest/package_index_json-specification/#tools-definitions
If suitable builds for each of the target host architectures (e.g., Linux, Linux ARM 64-bit, macOS, Windows) of avr-gcc are not already hosted on the Internet, then it will also be necessary for such builds to be produced and hosted. There is a related issue in the repository where Arduino hosts the infrastructure for producing the avr-gcc builds provided by the Arduino company: arduino/toolchain-avr#95. However, note that there is no inherent dependency on the Arduino company providing the builds. Anyone is free to publish their own builds and use those as the toolchain in Arduino boards platforms.
Hi @ptillisch :
So, in short, the answer is “no”. This is in contrast to what is stated in the README of the GitHub repo about this issue: “As soon as Atmel ships a newer toolchain, we pull the source code, patch it with some user contributed patches and deliver it with the Arduino IDE.” – provided that you substitute Atmel by Microchip. That is OK with me, but it should be stated in the README.
If you had asked 'Are there plans to update the toolchain of the "Arduino AVR Boards" and "Arduino megaAVR Boards" platforms to avr-gcc 17?', then that would be a reasonable conclusion. It does sadly appear that updating the version of avr-gcc used by the official Arduino boards platforms is unlikely to happen anytime in the near future due to a lack of development resources.
However, that IS NOT the question you asked. This is the question you asked:
That is the question I answered, and answered it very clearly. I'm perplexed as to how you could have possibly thought that the distillation of my answer is "no". The accurate distillation of my answer is "that is a nonsensical question".
It is very important that the Arduino community understand how powerful and flexible the Arduino boards platform framework is. If you assume that the version of avr-gcc is somehow hardcoded into Arduino IDE and Arduino CLI, and propagate that misunderstanding, then you harm the Arduino ecosystem by making it less likely for the community to understand the extent of what is possible to accomplish via the platform framework.
Any of the many excellent 3rd party boards platforms could update the version of avr-gcc used by their platform right now, without the need to wait on any action whatsoever from the Arduino company. The designers of the platform framework understood that a flexible design is required in order to allow the addition of support for any of the incredibly diverse range of potential target devices.
This is, I hope, less “nonsesical question” than this one:
Will be new avr-gcc included for Arduino UNO (ATmega328P) in default instalation of Arduino IDE ?
Can you give some insight when?
I downloaded the IDE from official Arduino source, when I bought my first UNO and few times upgraded, but on my new computer I again downloaded it from official source, to have if fresh and clean.
While I know, that I may make my own board definition for every developement board that I bought from Arduino, and I even know, that I can develop programs for them even without using Arduino offered software, I still sometime want to use the same environment as other here, so I am asking for this use case:
On new computer I install official Arduino IDE the easy way. There will be some avr-gcc included for those old models. When do you expect the version will be based on avr-gcc 15 or higher with the new toolchan from Microchip?
Does this question make some sense, that you can understood? Do you know, or can think of answer for it? What the ansver will be?
Hi @gilhad
As I explained above, it doesn't really make sense to talk about this in terms of "Arduino IDE" because tool dependencies are defined at the Arduino boards platform level. Each boards platform may define a completely different set of tool dependencies, which will be installed along with the platform by the Arduino Boards Manager system and used when compiling for the boards of that platform.
However, it is true that the "Arduino AVR Boards" platform is installed automatically on the first run of a fresh installation of Arduino IDE. So maybe what you are really asking is 'Will the avr-gcc tool dependency of the "Arduino AVR Boards" platform be updated to avr-gcc 17?'. I already answered that question:
It isn't necessarily required to make your own platform. There is already an amazing 3rd party boards platform that provides advanced support for the ATmega328P (including Arduino UNO):
The maintainer of that platform, MCUdude (hansibull here on Arduino forum) is much less conservative about using the state of the art in that platform than the Arduino company is in the "Arduino AVR Boards" platform.
@fogg even submitted a request for this:
but then closed the issue (note it was @fogg who closed the issue, not MCUdude), so it will not serve to effectively track the task of updating the version of avr-gcc used by the platform.
May I ask what you and @fogg expect from a newer version?
I'm not a compiler specialist so I have no idea.
@sterretje May I ask what you and @fogg expect from a newer version? (reply does not work well)
Basically fixed older bugs (and maybe better optimalisation)
Yes, the toolchans also have bugs sometime - this one bite me in ass in version 14.2 Making sure you're not a bot! http s://gcc.gnu.org/bugzilla/show_bug.cgi?id=119989 (please delete the space in https, editor makes some funny things with it) and there may be others, which did not bite me yet and I would like to not be bitten in the future ![]()
( I got wrong results in some scenario, when I removed debug prints from working code, as there was statements like:
DT = *IP; // value, where IP points
DT = *IP--; // the same value, and IP decreased later
and I expected the both DT to have the same value and they was same, when there was debug print of any kind between the two lines and they was different when there was nothing between the lines. (And it was bug in the generated code, not some interferrence of interrupts, not some undefined behavior - this one is exactly defined.)
It is already fixed, but it is something one cannot forsee, so bugfixes are important.
)
In general, newer versions of avr-gcc seem to be creating larger binary code than older versions (with v5.4 being "best")
For example, compiling Optiboot with the new Microchip toolchain overflows flash space by about 12 bytes; an increase of about 22 bytes over v7.3; that's over 4% bigger.
You clearly work at a different level than I do ![]()
Assuming that you mean "quote", it does work well. The only thing you can not do is a quote of a complete post (as far as I know if it ends up to be the next post). If you think it's a bug you can report it in the website and forum category of the forum.
It's not really the editor. I get the same page about "making sure you're not a bot" if I type the URL directly in Chrome. The editor tries to resolve the url to the title of the page by "visiting" the site and that is what is shown initially.
Maybe not really of interest to you but you can prevent that by using < and >
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119989>
which results in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119989
Alternatively typing e.g. bug 119989, next select it and paste the URL over it. The result in the composer will be
[bug 119989](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119989)
and it will show as bug 119989.
Same as @gilhad, I hope that bugs got fixed. I recently stumbled over a few while working on a debugging solution for AVR chips. One is that the compiler apparently sometimes generates wrong debugging information. Another bug is that, when using LTO (link time optimization), which is the default in the Arduino AVR board package, the compiler removes debugging information about global variables and class instances. And then, they may also use a more recent version of the libc (2.2.0), where it is finally possible to push PROGMEM data to the far end, …
Yes, it happens
We have saying with meaning like this: “The more you ask, the more you learn. If you don’t ask at all, you stay in the dark.” I asked a lot and read a lot and learned a lot ":)
Yes, that is what I wanted, but did not seen it anywhere. I asked chatGPT and he said to mark part of text and it will appear right there - this time his answer was even correct
(I am on couple forums, but there it is done different way, so I am not use to this style. But if it works, it works :))
Yes. I just copy the URL here and “it happened”, I had no time, so I solved it “somehow” and left finding right way to future. You solved it for me - thank you ![]()
well 4% usually does not matter too much in my projects, correctness is the most importatn thing ![]()
So the optimalisation was just “maybe”, while bugfixes was the main part ![]()