Go Down

Topic: Update WinAVR (no update since 2008?!!) (Read 163 times) previous topic - next topic

WinAVR (which is installed on windows to support the Arduino IDE) has (apparently) not been updated for the Arduino IDE since 2008.  There appears to be an updated installer (from 2010) for the WinAVR project, but that's it (and it does not appear to be compatible with Arduino from what I can tell).

Compilers and tools for Linux and FreeBSD and other operating systems (particularly those that compile from source) have been regularly tracking the latest development, but Windows developers are left in the dust.

OK I shouldn't complain unless I have a solution.  here's my solution:

https://github.com/XMegaForArduino/patches/tree/master/WinAVR

My suggestion is to incorporate the compiler source and patches that I've made available at the abovementioned web site.  Ok I'm currently working on my own 'installer' that would post-patch the IDE but wouldn't it be better if the Arduino environment has this already?

I have specifically included patches to support the ATXMega16E5 and ATXMega32E5 (which is part of the 'XMega For Arduino' project) as well as a couple of patches that are needed to compile properly under Cygwin.  The newer compiler and tools support most of the ATXMega processors already, so I simply added more support for these additional two (that was my main goal here).

Further, since gcc has modified their license terms (see https://www.gnu.org/licenses/gcc-exception.html), any concern about shipping 'closed source' binaries as a part of your project (something that might justify using a 2008 version of gcc) is no longer applicable, in case people had been concerned about it before.  There was a lot of debate surrounding GPLv3 for gcc and its libraries at one point, solved by the license exception in 2009.

So what I'm suggesting is that the Arduino project adopt what I've done in lieu of using the old 2008 version of WinAVR.  Having the Arduino team completely take over the WinAVR project development [starting with my build files and patches for the newer tools, you're welcome] would be ideal.

As of now, my 'updated WinAVR' sub-project builds and runs under cygwin.  I have not yet fully tested it with the Arduino IDE, however (I have tested the compiler and tools on another OS, just not windows).  It should (I hope) simply be a matter of copying some libraries and overwriting existing EXE files within the Arduino IDE's directory structure.  In any case, I'll fully document the process completely within my project once I have it working.

westfw

1.5.7 and 1.5.8 upgrade the compiler and other tools, using the (non-IDE) "Toolchain" from Atmel.  This is close to the latest available version of the compiler (for better or worse.)  It contains some annoying incompatibilities with older arduino code.

Quote
Compilers and tools for Linux ... have been regularly tracking the latest development
Actually, they stopped doing that a while ago (1.0.3?), because it was a complete disaster.  Many of the linux "packages" of avr-gcc were defined incorrectly and didn't work, and many other installed versions of the compiler that were not compatible with Arduino.  Recent versions of the IDE for linux include their own static version of the compiler tools.


bperrybap

#2
Nov 16, 2014, 10:33 pm Last Edit: Nov 16, 2014, 10:34 pm by bperrybap
1.5.7 and 1.5.8 upgrade the compiler and other tools, using the (non-IDE) "Toolchain" from Atmel.  This is close to the latest available version of the compiler (for better or worse.)  It contains some annoying incompatibilities with older arduino code.
So far I've only seen issues related to the AVR PROGMEM hack.
While there are some incompatibilities, the real problem was with the older arduino code rather
than the compiler since the older compiler was too lax on how it treated certain data declarations.
Once the declarations are done correctly, they work with both the old and new versions of the compiler.
It would have been nice if the progmem examples on the Arduino site used proper declarations
which would have helped avoid some of the issues people are now having.

Quote
Actually, they stopped doing that a while ago (1.0.3?), because it was a complete disaster.  Many of the linux "packages" of avr-gcc were defined incorrectly and didn't work, and many other installed versions of the compiler that were not compatible with Arduino.  Recent versions of the IDE for linux include their own static version of the compiler tools.
I have not found this to be the case. The avr-gcc package and related tools supplied by Ubuntu and Linux Mint have worked with the Arduino IDE for me.
In fact, I usually rename or remove the IDE supplied avr-gcc package so I can run
my local version  of the compiler tools and custom built avrdude.
I have had a few issues with broken code in the IDE where they
attempt to override some of the match functions where I have had to go in and fix Arduino IDE header
files.

There was an avr-gcc Ubuntu package back in the 2009 time frame
where the compiler was broken and it didn't properly save registers in the ISR prolog of ISR functions.
That was a total disaster and required getting a different package or building your own package
from source.

--- bill


pYro_65

#3
Nov 19, 2014, 07:33 am Last Edit: Nov 19, 2014, 07:34 am by pYro_65
Quote
So far I've only seen issues related to the AVR PROGMEM hack.
Yup, even then its just needs the declaration to be marked const. I have C++11 turned on as well and so far I have not run into any other issues.

When I test peoples code, it usually compiles a lot smaller on gcc 4.8.1, over the outdated 4.3.7

Go Up