I've tried to recompile the toolchain (binutils 2.20 (patched); GCC 4.4.3; avr-libc 1.6.8).
I noticed that gcc 4.4.3 doesn't include the support for atmegaXXu2 MCUs. Due to this lack of support in GCC, avr-libc compiles without the atmegaxxU2 serie. Then, I've tried to add the support in gcc 4.4.3. You'll find the patch in attachment. I should have missed something, because I have this kind of errors when I compile my firmware /usr/local/avr-4.4.3/lib/gcc/avr/4.4.3/../../../../avr/bin/ld: avr:35 architecture of input file `output/main.o' is incompatible with avr:5 output I didn't find what's wrong in the patch I made. It's the first time I try to patch something like that. The problem comes probably from my inexperience... So, I decided to test the toolchain with GCC 4.5. (binutils 2.20 (patched); GCC 4.5 (from SVN at rev 156830); avr-libc 1.6.8). I had some problems to compile avr-libc (many devices were not supported, especially the atxmega series. As I just need the atmegaxxU2 support, I've bypassed almost all the other MCUs during the compilation. Now, I'm able to compile my firmware. I didn't tested my code. I'll do it soon. Using the unstable version of GCC for this firmware is too critical. I don't like the idea to produce a device in which the firmware is compiled with an unstable / untested version of GCC. So, I really want to find a way to add the support to GCC 4.3.x. Is there some patches for this somewhere ? Or can someone have a look at my patch, and see what I've done wrong ? Thanks in advance, Paul Rathgeb On Wed, 2010-02-17 at 10:31 +0100, Joerg Wunsch wrote: > As Weddington, Eric wrote: > > > I just tried to send patches to the avr-gcc-list ML for binutils > > 2.20, but my corp email server was having some difficulty. I'll try > > again later. > > Forwarded on Eric's behalf, Cc goes to avr-gcc-list, as the question > came up there recently as well. > > Eric wrote: Special thanks to Anitha Boyapati for doing the porting > work. >
--- gcc/config/avr/avr.c 2009-08-25 21:03:53.000000000 +0200 +++ gcc/config/avr__/avr.c 2010-02-18 07:48:16.969805018 +0100 @@ -205,6 +205,9 @@ { "avr35", ARCH_AVR35, NULL }, { "at90usb82", ARCH_AVR35, "__AVR_AT90USB82__" }, { "at90usb162", ARCH_AVR35, "__AVR_AT90USB162__" }, + { "atmega8u2", ARCH_AVR35, "__AVR_ATmega8U2__" }, + { "atmega16u2", ARCH_AVR35, "__AVR_ATmega16U2__" }, + { "atmega32u2", ARCH_AVR35, "__AVR_ATmega32U2__" }, { "attiny167", ARCH_AVR35, "__AVR_ATtiny167__" }, { "attiny327", ARCH_AVR35, "__AVR_ATtiny327__" }, /* Enhanced, <= 8K. */ --- gcc/config/avr/avr.h 2009-03-28 22:09:50.000000000 +0100 +++ gcc/config/avr__/avr.h 2010-02-18 07:48:16.921804849 +0100 @@ -836,6 +836,9 @@ mmcu=at76*|\ mmcu=at90usb82|\ mmcu=at90usb162|\ + mmcu=atmega8u2|\ + mmcu=atmega16u2|\ + mmcu=atmega32u2|\ mmcu=attiny16*|\ mmcu=attiny32*: -m avr3}\ %{mmcu=atmega8*|\ @@ -965,6 +968,9 @@ %{mmcu=atmega103|mmcu=avr31:crtm103.o%s} \ %{mmcu=at43usb320:crt43320.o%s} \ %{mmcu=at90usb162|mmcu=avr35:crtusb162.o%s} \ +%{mmcu=atmega8u2|mmcu=avr35:crtm8u2.o%s} \ +%{mmcu=atmega16u2|mmcu=avr35:crtm16u2.o%s} \ +%{mmcu=atmega32u2|mmcu=avr35:crtm32u2.o%s} \ %{mmcu=at90usb82:crtusb82.o%s} \ %{mmcu=attiny167:crttn167.o%s} \ %{mmcu=attiny327:crttn327.o%s} \ --- gcc/config/avr/t-avr 2009-03-28 22:09:50.000000000 +0100 +++ gcc/config/avr__/t-avr 2010-02-18 07:48:16.909816384 +0100 @@ -67,6 +67,9 @@ mmcu?avr31=mmcu?at43usb320 \ mmcu?avr35=mmcu?at90usb82 \ mmcu?avr35=mmcu?at90usb162 \ + mmcu?avr35=mmcu?atmega8u2 \ + mmcu?avr35=mmcu?atmega16u2 \ + mmcu?avr35=mmcu?atmega32u2 \ mmcu?avr35=mmcu?attiny167 \ mmcu?avr35=mmcu?attiny327 \ mmcu?avr4=mmcu?atmega48 \
_______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev