« Previous | Next»

Updating avr-gcc, binutils to get the devices [update: now also includes deb files]

Posted by coldtobi | 19 Apr, 2007, 19:05

This mini-howto was created to assist anyone in building an updated avr-gcc supporting lots of new devices: (list not complete) to be installed with the debian packaging system.

at90pwm*, at90usb82, atmega164p, atmega165p, atmega169p, atmega324p, atmega325p, atmega329p, atmega3250p, atmega3290p atmega644p,
at90usb162

For a pointer: The versions currently in debian (unstable) are:

gcc-avr   1:4.1.0.dfsg.1-1 0

binutils-avr 2.16.1-1

[Update: Debian has released new updated packages, but not for all deviced. Additional infos here.] 

 

Ready-to-go Debian files

are now available at my site: (PLEASE NO DEEP LINKS!)

_ASIP_ 

How Build your own packages

1. Get the sources and build-dependencies.

apt-get source gcc-avr binutils-avr

apt-get build-dep  gcc-avr binutils-avr

2. Rename directorys 

mv gcc-avr-4.1.0.dfsg.1 gcc-avr-4.1.2
mv  binutils-avr-2.16.1 binutils-avr-2.17

3. Make binutils

3.1 clean up, get upstream source and apply my patch. (cd into binutils-2.17)

rm  binutils-2.16.1.tar.bz2 

wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2

wget http://frost.de/files/binutils-patch-2.16.1.1-2.17.gz -o binutils-patch-2.16.1.1-2.17.gz

gunzip -c binutils-patch-2.16.1.1-2.17.gz | patch -p 1

3.2 build the package 

    fakeroot dpkg-buildpackage -b -uc -us 

3.3 install package (as root)

     dpkg -i ../binutils-avr-2.17*.deb

4. Make gcc

4.1 clean up, get upstream source and apply my patch.

(cd into gcc-4.1.2)

rm  gcc-*-tar.bz2

wget ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-core-4.1.2.tar.bz2

wget  ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-4.1.2/gcc-g++-4.1.2.tar.bz2

wget http://frost.de/files/gcc-avr-patch-4.1.0-4.1.2.gz -o gcc-avr-patch-4.1.0-4.1.2.gz

gunzip -c  gcc-avr-patch-4.1.0-4.1.2.gz | patch -p1

3.2 build the package 

    fakeroot dpkg-buildpackage -b -uc -us 

3.3 install package (as root)

     dpkg -i ../binutils-avr-2.17*.deb

4. Recompile avr-libc

As avr-libc determines at compile time, which controllters are supported, you have to recompile the libraries. No patching is needed:

apt-get source --compile  avr-libc

dpkg -i avr-libc_1.4.5-2_all.deb

Install the package as root.  

Note: On an unstable debian, you might need to install texlive-extra-utils, if you get an error during the build of avr-libc

5. Test it.

go into the avr-gc-4.1.2 directory, and do a 

gcc -mmcu=at90pwm3 test1.c

If it works, you've succeded. 

 

[Credits to this forum thread]

_ASIP_ 

Linux / Debian, Electronics and Atmel AVR | Comments (3) | Trackbacks (0)

Related Articles:

3 Comments | "Updating avr-gcc, binutils to get the devices [update: now also includes deb files]" »

  1. JR Ridgely : Broken Links ?

    21/05/2007, at 02:05 [ Reply ]

    Hi, it seems that the sites from which patches can be downloaded are not accessible: ftp.dkuug.dk - cannot connect to host http://frost.de/...binutils-patch-2.16.1.1 - 404 Not Found
    Are there alternate sources? Thanks


    Thanks for reporting.... The style-sheet cut off the last letters. I'll fix it this evening. In the meantime, choose "Alben" and then "General" in the menu

  2. JR Ridgely : Working Now

    23/05/2007, at 00:10 [ Reply ]

    Things are working now -- thank you! Although ftp.dkuug.dk still does not respond, the file binutils-2.17.tar.bz2 can be found from other places, and I have successfully compiled and installed for i386 and AMD64. If it helps anyone, I could make the .deb files available.
  3. John Gilmore : -mccu=atmega168 is not recognized

    22/02/2009, at 23:05 [ Reply ]

    avr-gcc is not calling avr-as, it's trying to run "as" instead, which of course is NOT a cross-assembler. You may need to rebuild the .deb packages a little differently to correct this correctly. In the meantime I fixed it be renaming /usr/bin/as to /usr/bin/as.real, and "ln -s avr-as as"