I've had a few questions about how to build the HID firmware for the atmega8u2 under linux. Here's a guide for getting the avr tools installed to be able to build the firmware. I've tested this on Ubuntu 10.04.
Build and install binutils for the AVR
Build and install libgmp (needed for gcc-4.5.3)
Install libmpfr and libmpc (needed for gcc-4.5.3)
- sudo apt-get install libmpfr-dev
- sudo apt-get install libmpc-dev
Build and install gcc-4.5.3 for AVR
Build and install avr-libc
Do a test build of Arduino-usbserial
The Arduino-usbserial firmware is the default firmware that the UNO comes installed with on its atmega8u2. It implements a serial interface over USB. Build this firmware to check that your avr-gcc toolchain and avr-libc are working.
- cd Arduino/hardware/arduino/firmwares/arduino-usbserial
- edit the makefile and make sure that MCU = atmega8u2 and ARDUINO_PID = 0x0001
- You should have an newly built Arduino-usbserial.hex file.