view history edit print login register

Arduino on Slackware Linux

You will probably need to compile avr-gcc from source. Detailed instructions for this step are available from the user manual of avr-libc.

Installing avr-libc

In short, to compile/install avr-libc into the ~/local/ directory:

wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.19.1.tar.gz
tar xvfz binutils-2.19.1.tar.gz
cd binutils-2.19.1
PREFIX=$HOME/local/avr
export PREFIX
PATH=$PATH:$PREFIX/bin
export PATH
mkdir obj-avr
cd obj-avr
../configure --prefix=$PREFIX --target=avr --disable-nls
make
make install
cd ..
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.0/gcc-4.4.0.tar.bz2
tar xvfj gcc-4.4.0.tar.bz2
cd gcc-4.4.0
mkdir obj-avr
cd obj-avr
../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --disable-nls --disable-libssp --with-dwarf2
make
make install
cd ..
wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.6.7.tar.bz2
tar xvfj avr-libc-1.6.7.tar.bz2
cd avr-libc-1.6.7
./configure --prefix=$PREFIX --build=`./config.guess` --host=avr
make
make install

On plugging in the Arduino, the USB-Serial interface is recognised on stock Slackware (tested on 10.2 and onwards). You should see something vaguely like the following in /var/log/messages:

kernel: usb 3-2: new full speed USB device using uhci_hcd and address 9
kernel: ftdi_sio 3-2:1.0: FTDI USB Serial Device converter detected
kernel: drivers/usb/serial/ftdi_sio.c: Detected FT232BM
kernel: usb 3-2: FTDI USB Serial Device converter now attached to ttyUSB''n''

If you don't see this it the device hasn't been found by the kernel.

Install the Arduino software (check for latest version) and make sure your $PATH now contains the path to your new avr-gcc -- in the case of the example above, ~/local/avr/bin. You need to have a Java runtime environment installed, which comes with Slackware, so if you haven't already installed it just installpkg from your install CD (under 'l') or one of the Slackware mirrors.

Edit ~/.arduino/preferences.txt to tell the Arduino software about the serial port, eg:

serial.port=/dev/ttyUSB0

Troubleshooting

You may find that /dev/ttyUSBn doesn't exist, even if the kernel appears to have seen it and attached it to a device. This is likely because you're using Slackware with udev, and it has placed the device in /dev/tts/USBn. Check permissions; the default mode is 660 (or 600) and the group is tty, so your user either needs to be in group tty or you need to change the udev rules to change the permissions. The udev rules are in /etc/udev/rules.d/udev.rules

You may find that you don't have access rights to the device. This will become obvious upon starting the arduino software and attempting to upload anything to your board - the tools->serial port submenu will be grayed out. Follow the instructions above if using udev; if not, /dev/ttyUSB0 often seems to be owned by root, group uucp, so either add your user to group uucp or chmod 666 /dev/ttyUSB0.

With recent Arduino software, you may see the error:

"please see: How can I use Lock Files with rxtx? in INSTALL check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file."

The software needs to be able to write to /var/lock. For some systems this is fixable by adding the user to group 'lock', but Slackware doesn't currently seem to have such a group. One way to fix this is to chmod the /var/lock directory appropriately.