Wiblocks --- Arduino Tools

Arduino Tools

The Arduino development environment works with the ZB1. Either the ATmega168 or the ATmega328 microcontroller can be used. Choose the appropriate board name from the Tools->Board menu.
ATmega168   Arduino NG or older w/ ATmega168
ATmega328Arduino Diecimila w/ ATmega328

Linux Installation

This is my summary of gcc and arduino tool installation for linux using information from the ladyada forums, spiffie.org and the gnu installation instructions.

Downloads

README FIRST

You need to install the packages in the order listed below.

The installation listed below installs all of the tools (except the arduino environment) in a single directory with the prefix /local/pub/avr-20081230. Change the prefix to install in a different place.

Installing binutils

tar jxf binutils-2.19.tar.bz2
cd binutils-2.19
mkdir obj-avr
cd obj-avr
../configure --prefix=/local/pub/avr-20081230 --target=avr --disable-nls
make
make install

Installing gmp

tar jxf gmp-4.2.4.tar.bz2
cd gmp-4.2.4
mkdir obj-avr
cd obj-avr
../configure --prefix=/local/pub/avr-20081230 --build=avr --disable-shared
make
make install
cd ..

Installing mpfr

tar jxf mpfr-2.3.2.tar.bz2
cd mpfr-2.3.2
mkdir obj-avr
cd obj-avr
../configure --prefix=/local/pub/avr-20081230 --target=avr --disable-shared \ 
    --with-gmp-build=../../gmp-4.2.4 --with-gmp-lib=/local/pub/avr-20081230/avr/lib \ 
    --with-gmp-include=/local/pub/avr-20081230/avr/include/ 
make
make install

Installing gcc

PATH=/local/pub/avr-20081230/bin:$PATH
export PATH
bunzip2 -c gcc-4.3.2.tar.bz2 | tar xf -
cd gcc-4.3.2
mkdir obj-avr
cd obj-avr
../configure --prefix=/local/pub/avr-20081230 --target=avr --enable-languages=c \ 
   --enable-languages=c++ --disable-nls --disable-libssp --with-dwarf2 \ 
   --with-gmp=/local/pub/avr-20081230 --with-mpfr=/local/pub/avr-20081230
make
make install

Installing AVR libc

cd avr-libc-1.6.4
./configure --prefix=/local/pub/avr-20081230 --build=`./config.guess` --host=avr
make
make install

Installing avrdude

tar zxf avrdude-5.5.tar.gz 
cd avrdude-5.5
mkdir obj-avr
cd obj-avr
../configure --prefix=/local/pub/avr-20081230
make
make install

Arduino 0012

I installed arduino-0012 in the directory /local/pub/arduino-0012
tar zxf arduino-0012-linux.tgz
cd arduino-0012
patch -p1 < ../Arduino328.diff

Replace iom328p.h

I have not looked into why this was necessary but it was.
mv /local/pub/avr-20081230/avr/include/avr/iom328p.h \ 
   /local/pub/avr-20081230/avr/include/avr/iom328p.h.original
mv iom328p.h in /local/pub/avr-20081230/avr/include/avr/iom328p.h

arduino-0012

To run the arduino environment I like to use a shell script. The shell script (below) is for version 12 of the code installed using the previous procedure. On my system the shell script is called arduino-0012. File /local/lan/bin/arduino-0012 could not be opened for input