I recently set up Gentoo to work with my new Arduino Uno board, and since I ran into a few quirks I put together a quick how to on how to get things working. I also recommend reading this document, which is very helpful: http://www.arduino.cc/playground/linux/gentoo

Details
When attempting to install gcc-avr I ran into an issue with my USE flags, since I had C++ support disabled globally, which caused an emerge error about having both the "cxx nocxx" and "-cxx -nocxx" USE flags enabled. I believe this is because gcc was built with USE="-cxx", but instead of fiddling around with individual packages I just enabled the USE flags globally.

Add this line to your /etc/make.conf (or just append the USE flags to your USE= line):

Code:

USE="$USE cxx -nocxx"

You will now need to apply the new USE flags to world

Code:

emerge -DuN world

Step 3: Install gcc-avr

Code:

crossdev -t avr

Step 4: Install arduino frontend. There are two options here:
Step 4a: Install the arduino frontend in the main portage tree:

Step 4b (recommended): Install the latest arduino frontend from the arduino overlay: http://gitorious.org/gentoo-arduino. Use layman or your usual method to add the arduino ebuilds to Gentoo. (I maintain my own personal overlay, so I just downloaded the tarball of the complete overlay and copied the ebuilds to my local overlay.) Once you have added the ebuilds do the following:

Details
In the arduino IDE, you will likely want to select the option Tools->Board->Arduino Uno. Initially I had an incorrect board selected, which caused the following error:

Code:

avrdude: stk500_getsync(): not in sync: resp=0xfe

However, if I chose the correct board (Arduino Uno), I received this error:

Code:

Double check connections and try again, or use -F to override this check.

This error was because boards.txt was pointing to an incorrect protocol to communicate with the board. To fix, change the following line in:
/usr/share/arduino-0021/hardware/arduino/boards.txt under the section that starts with "uno.name=Arduino Uno"
Original:

Code:

change uno.upload.protocol=stk500

New:

Code:

uno.upload.protocol=arduino

Step 7: Fix linker errors

Details
I ran into a couple linker errors when attempting to build code with gcc-avr
Error 1:

Code:

/usr/libexec/gcc/avr/ld: cannot open linker script file ldscripts/avr5.x: No such file or directory

Fix 1:

Code:

ln -s /usr/lib/binutils/avr/2.22/ldscripts /usr/avr/lib/ldscripts

Error 2:

Code:

/usr/libexec/gcc/avr/ld: cannot find crtm328p.o: No such file or directory

Fix 2:

Code:

ln -s /usr/avr/lib/avr5/crtm328p.o /usr/avr/lib/crtm328p.o

Step 8: Make sure your kernel is configured correctly.

Details
You will need ftdi_sio & cdc_acm built into your kernel or compiled as modules. I personally have them added as modules. When plugging in the Arduino board, cdc_acm should automatically load, but you will need to have ftdi_sio manually loaded, or the board won't function properly. The following will add ftdi_sio to be loaded at boot (you won't need to do this if it is built directly into your kernel):

The first is that i only could (after use overlay) use arduino v 0.017 and not the last v 1.0 contained on their web. On the same way installs rxtx v2.1.7.2-r3 being required rxtx-2.2_pre2 (contained in the overlay) or upload code on AMD64 systems. The overlay don't works
and the second is that finalized the steps of your guide, when i run #arduino from console, nothing happen.

Is detailed on my post.

Please, if you could help me a bit, i will be greatful and arduino will be posible for me on linux

Salutes

Last edited by Yczo on Mon Jan 09, 2012 7:48 pm; edited 1 time in total

Now i need to install rxtx-2.2_pre2 or higher to upload code to board with AMD64, but i'm not sure how to do.

dev-java/rxtx-2.2_pre2 is packaged with the arduino overlay... It looks like the ebuild has the ~amd64, so I would imagine it should work fine for you. Grab the overlay, add the ebuild to your package.keywords, emerge it, and you should be all set.

at last i could use overlay. After upgrade rxtx and arduino, i had the problem of avrdude: AVR Part "atmega328p" not found. but update arvdude did not bring the solution for me.

I decided repeat the steps od the guide. From the steep 1, and now i have a new and serious problem when i try to compile code with arduino, that did not have before

In file included from /usr/lib/gcc/avr/4.5.3/../../../../avr/include/util/delay.h:44:0,
from /usr/lib/gcc/avr/4.5.3/../../../../avr/include/avr/delay.h:37,
from /usr/share/arduino-0021/hardware/arduino/cores/arduino/wiring_private.h:30,
from /usr/share/arduino-0021/hardware/arduino/cores/arduino/WInterrupts.c:33:
/usr/lib/gcc/avr/4.5.3/../../../../avr/include/math.h:426:15: error: expected identifier or ‘(’ before ‘double’
/usr/lib/gcc/avr/4.5.3/../../../../avr/include/math.h:426:15: error: expected ‘)’ before ‘>=’ token

uf, my head explodes, and think that probably i have to format and reinstall all the system makes me tremble.

Although, I noticed today in my `emerge --sync` that there appears that cross-avr/avr-libc-1.8.0 is now in portage. I'm currently running 1.7.1 on my system. Perhaps when you started again from scratch you went to version 1.8.0, which is causing the error?

Nice little tutorial. I am about halfway through...having an issue with the Arduino IDE itself. In this case, when I click on a menu, it stays open so long as the mouse button is depressed, and disappears upon release; also, I cannot select anything.

Is this a Java issue? I am using the sun-jre-bin-1.6, and emerged the stable arduino package (arduino-0017) as I am not very familiar with using overlays.

Nice little tutorial. I am about halfway through...having an issue with the Arduino IDE itself. In this case, when I click on a menu, it stays open so long as the mouse button is depressed, and disappears upon release; also, I cannot select anything.

Is this a Java issue? I am using the sun-jre-bin-1.6, and emerged the stable arduino package (arduino-0017) as I am not very familiar with using overlays.

Any advice or known issues similar to this? Thanks in advance.

I'm also using sun-jre-bin:1.6, and I did have arduino-0017 installed for a bit without this issue. Do you see any debugging output on the command line? If yes, post that here... also it may help to run the command with strace, to get some lower level debugging information.

The arduino overlays is easy to add, even without layman. Just download the full tarball of the overlay (it's linked to the link I posted in the tutorial), unpack them somewhere on your filesystem, and point to it using the PORTDIR_OVERLAY variable in your make.conf. I have a line like this in my make.conf. I unpacked the arduino overlay files in /usr/local/gentoo-arduino-arduino.

Nice little tutorial. I am about halfway through...having an issue with the Arduino IDE itself. In this case, when I click on a menu, it stays open so long as the mouse button is depressed, and disappears upon release; also, I cannot select anything.

Is this a Java issue? I am using the sun-jre-bin-1.6, and emerged the stable arduino package (arduino-0017) as I am not very familiar with using overlays.

Any advice or known issues similar to this? Thanks in advance.

I'm also using sun-jre-bin:1.6, and I did have arduino-0017 installed for a bit without this issue. Do you see any debugging output on the command line? If yes, post that here... also it may help to run the command with strace, to get some lower level debugging information.

The arduino overlays is easy to add, even without layman. Just download the full tarball of the overlay (it's linked to the link I posted in the tutorial), unpack them somewhere on your filesystem, and point to it using the PORTDIR_OVERLAY variable in your make.conf. I have a line like this in my make.conf. I unpacked the arduino overlay files in /usr/local/gentoo-arduino-arduino.

Code:

PORTDIR_OVERLAY="$PORTDIR_OVERLAY /usr/local/gentoo-arduino-arduino"

It might be worth mentioning that I have "dev-embedded/arduino ~amd64" in /etc/portage/package.keywords, and that without the ~amd64 flag the package is masked and cannot be emerged.

Here is the output of "strace arduino &> arduino.log"; the java.io.IOException line towards the bottom and the indented portion that follows popped up after trying to run a program that didn't exist, and everything after that popped up upon quitting the IDE. Also, even though the file menus are unusable, I can use keyboard shortcuts like CTRL+Q to quit or CTRL+O to open a file.

Yes, I would look to use the version in the overlay. It seems like this is a pretty common error with 0017, but I'm not sure why it's happening. Some googling suggests that it could have something to do with your preferences.txt... but I think the best option is to use the latest version of the IDE.

wow! this thread is simply great!!
thanks a lot for sharing your experiences, finally no use for windows on my notebook anymore
i use the xml file with layman, the overlay then is called luksans-arduino. it covers quite everything (except the two ln -s ... commands and the unmasking)._________________bill who? micro what?

Hello,
I use funtoo linux and thanks for this.
In funtoo or gentoo is very dificult to install avr toolset and arduino, but I did with layman/luksans-arduino
With this I have errors compilation in arduino (sanguino).

Then I downloaded the arduino-0023 from arduino.cc site and I got (copy) the toolset from wiring (tools directory) http://wiring.org.co/ and I put the toolset in arduino-0023 in hardware folder.
The I modified Sconstruct from http://code.google.com/p/arscons/ with new toolset path and I make compilation without errors.
Now I using arduino (sanguino) with qt-creator

But /usr/lib/gcc/avr/4.5.3/libgcc.a seems to be the only avr-libgcc I've got - how does this get incompatible?_________________mysql> SELECT question FROM life, universe, everything WHERE answer=42;
Empty set (2079460347 sec)

Joined: 21 Jul 2002Posts: 760Location: in a World created by a Flying Spaghetti Monster

Posted: Sat Feb 25, 2012 12:13 pm Post subject:

Got it.

The second patch from https://bugs.gentoo.org/show_bug.cgi?id=378387 did it for me.
Now both Arduinos work without any symlinks in /usr/avr/lib/_________________mysql> SELECT question FROM life, universe, everything WHERE answer=42;
Empty set (2079460347 sec)

I've got the Duemilanove 328 board running ok but not my Uno. The Uno device driver exists in /dev as ttyACM0 but not in the menu in the arduino-1.0 software. I'm running ~x86_64 and I've checked I'm in the correct groups. I've also checked with another Uno to prove it wasn't the board at fault.
The strange thing is that dmesg shows the board

Can anyone tell me if it is the Arduino software at fault or the USB system? I've checked the USB FTDI Single Port Serial Driver and the USB Modem (CDC ACM) support are enabled in the kernel so I don't think the kernel is at fault. I'm using kernel-3.2.9

Nice little tutorial. I am about halfway through...having an issue with the Arduino IDE itself. In this case, when I click on a menu, it stays open so long as the mouse button is depressed, and disappears upon release; also, I cannot select anything.

Is this a Java issue? I am using the sun-jre-bin-1.6, and emerged the stable arduino package (arduino-0017) as I am not very familiar with using overlays.

Any advice or known issues similar to this? Thanks in advance.

This was happening for me under xmonad, I fixed it by following the steps here in the XMonad Wiki. Hope it helps some people. Basically you get the WM to tell Java that it's one of the non reparenting WM's they have their small list.