AVR toolchain on Linux

Kulmapaikasta
Siirry navigaatioon Siirry hakuun

AVR toolchain build instructions on Linux


Source: http://www.nongnu.org/avr-libc/user-manual/install_tools.html


- This shows how to install an AVR toolchain from source on Linux
- The toolchain consists of avr-binutils, avr-gcc and avr-libc
- They must be installed in that order

  • Note: If you have CC set to anything other than avr-gcc in your environment, this will cause the configure script to fail. It is best to not have CC set at all.
  • First set up the PATH, and also a convenience PREFIX environment variable
 PREFIX=/usr/local/avr
 export PREFIX
 PATH=$PATH:$PREFIX/bin
 export PATH
  • First of the three we'll install binutils:
 bunzip2 -c binutils-<version>.tar.bz2 | tar xf -
 cd binutils-<version>
 mkdir obj-avr
 cd obj-avr
 ../configure --prefix=$PREFIX --target=avr --disable-nls
 make
 sudo make install
 cd ../..
  • Next we'll install avr-gcc:
 bunzip2 -c gcc-<version>.tar.bz2 | tar xf -
 cd gcc-<version>
 mkdir obj-avr
 cd obj-avr
 ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2
 make
 sudo make install
 cd ../..
  • And finally we'll install avr-libc:
 gunzip -c avr-libc-<version>.tar.gz | tar xf -
 cd avr-libc-<version>
 ./configure --prefix=$PREFIX --build=`./config.guess` --host=avr
 make
 sudo make install
 cd ../..