Contextual Computing Group

CCG Home | People | Research | Publications | Resources | Contact

Compiling gcc for AVR Microcontrollers

(Feb 15, 2001)

AVR microcontrollers are a fairly new entry into the arena by the folks from Atmel. They are neat little devices which come in a number of models most of which can be programmed serially in-system. Best of all they are supported by gcc.

To compile GCC you first need to get a copy of binutils. Recent releases of binutils have AVR support built in, but the one i tried (binutils-2.10.1) didn't allow gcc to compile correctly. Instead i used a snapshot of binutils (binutils-010109). To compile simply 'cd' into the unpacked source, type './configure --target=avr', and then 'make'. Finally as root, do a 'make install'.

Now we are ready to compile gcc. Again you need to grab a current snapshot or the CVS version. I used the gcc-20010205 snapshot. Unpack the source, and follow the same procedure as with the binutils.

There are a few rough edges with the snapshot, and the attempt to build libiberty will fail, but this doesn't seem to matter, and you can go ahead and install without it. The cross compiler should now be available as 'avr-gcc' (check your path if it isn't).

The last thing you need to do to get a working gcc is install a libc for the AVR. You can pick it from here. Just follow the instructions.

Links

AVR micro page at ETH
 
 
  

CCG Home | People | Research | Publications | Resources | Contact

[GVU Center] [College Of Computing] [Georgia Tech]