Arduino cross-development kit on Gentoo.

Jun 19, 2009

While I’m sitting here hacking around, here’s the exact command that I needed to run to get the Arduino development kit to install properly on Windbringer:

It should be noted that I’m using Layman to manage my overlays, which is why I had to specify the environment variable on the command line.

I discovered that GCC v4.1.2 didn't support the Atmega328, which is what my Arduino Duemilanove is based upon, so I had to upgrade GCC to the latest stable release for Gentoo.  To generate code for the Atmega328, you need v4.2.2 or newer of GCC.

PORTDIR_OVERLAY=/usr/portage/local crossdev —gcc 4.3.2 —without-headers -t avr -s4

When compilation is finished, you then have to switch the profile to the new revision of avr-gcc:

gcc-config avr-4.2.4

source /etc/profile

The instructions I was following came from here.  To switch the version of avr-gcc in use, I followed the directions at the end of the /var/log/portage/cross-avr-gcc-stage2.log file on Windbringer when the crossdev build was done.

Various and sundry notes are after the cut.

If you happen to have one of LadyAda's Duemilanove Arduino boards and you find that you can't upload your code to the board no matter how hard you try using the Arduino IDE try changing the board you have the IDE configured for (Tools -> Board).  For example, when I had the IDE configured for "Arduino Duemilanove w/ ATmega328" I found that I couldn't upload any of my code to the flash memory.  When I changed the board to "LilyPad Arduino w/ ATmega328" it started working perfectly.

As much as I hate pimping gear, I strongly suggest that you look into buying a USBtinyISP AVR Programmer if your Arduino kit doesn't come with one because there is a good chance that you'll have to re-flash the ATmega's bootloader if you mess up your code.  I did a few times tonight and it helped me get back on my feet.  So did buying a couple of ATmega168's from HacDC's store.