Compiling for the 2560 I get a working image if I use avr-gcc 4.1.1 as shipped with WinAVR_2007012, but if I try and use avr-gcc version 4.3.0. (from WinAVR-20080610) the resulting images do not work - it is almost as if there is something corrupting the stack pointer; if I try and step through the code using the USB JtagMkII in AVR Studio I get weird behaviour where the code returns from function calls to unexpected places.
We are optimising for size. The command line options used are:
avr-gcc -Os -Wundef -Wall -gstabs -mcall-prologues -fno-strict-aliasing -frename-registers -DCOMPILER_GCC -mmcu=atmega2560
At the minute I can build with the older version but I would rather not be left behind as the toolchain matures.
Does anyone know what could be causing the problem? or how I might go about fixing it?
Thanks for any help you can provide.