Resources » Developing for the ATmega328P under Linux »3. Compiling avr-gccThe latest versions of GCC (4.2.3 and up) include support for the ATmega328P, as well as the ATmega48P, ATmega88P, and ATmega168P. Checking the currently installed version of avr-gccRun the following command: avr-gcc --version You can test for support by creating an empty file unknown MCU 'atmega328p' specified ... test.c:1: error: MCU "atmega328p" supported for assembler only Installing prerequisitesRecent versions of GCC (4.3.x) depend on GMP and MPFR, which can be installed from their web pages. Under Ubuntu, you can get these packages by running the following command. sudo apt-get install libgmp3-dev libmpfr-dev Other distributions probably provide similar packages. Downloading the source codeGet gcc-4.3.3.tar.bz2 or a later version from the GCC FTP site or from a mirror closer to you if possible. We recommend getting the full GCC, which includes the C++ compiler, not just gcc-core. Unpack the archiveRun the following command: tar xjf ~/Desktop/gcc-4.3.3.tar.bz2 cd gcc-4.3.3 Configure, compile, and install GCCNote that you need to compile GCC from a separate directory, and that we are specifying that only C and C++ be included. If you want to try compiling FORTRAN, ObjectiveC, or GCJ for the AVR, you’re on your own! mkdir obj cd obj ../configure --prefix=/usr/local --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp make sudo make install Next stepsThe latest version of avr-gcc should now be on your path. Next, proceed to Section 2 to install the latest binutils. |
|
Log In
|
Wish Lists
|
BIG Order Form
|
Shopping Cart
US toll free: 1-877-7-POLOLU ~
(702) 262-6648 |
|||||||||||||
| Catalog | Forum | Resources | Distributors | Ordering | About | Contact | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|