Figure 1. Get the avr-gcc tool chain.
Speaking of such, you’ll notice that “sudo” is
used a lot; this is a UNIX command that allows a
user to do something at root, or superuser. The
“su” stands for “SuperUser” and you can figure
out what the “do” means. When you use sudo,
the OS will ask you for the superuser password
which you create when you install your OS.
Step Zero: Know where we started!
I downloaded and installed Ubuntu 9. 10
(Kharmic Koala) as my Linux distribution of choice.
I chose Ubuntu because it seems to be the most
popular strain of Linux I’d been hearing about
lately. Here is where I got my it:
Step One: Install the avr-gcc tool chain.
After you have installed and configured your
Figure 2. Get Eclipse from the source.
14 SERVO 04.2010
Ubuntu system (or if you already have a version of
Linux that you like up and running), it is time to
get the avr-gcc tool chain. On Linux, apt-get is
your friend; we’ll use it to install and set up the
entire tool chain, largely auto-magically! Open a
terminal window and type the following: sudo apt-get install gcc-avr avr-libc avrdude librxtx-java
You’ll need the librxtx-java if you want to play
with the Arduino environment later on. I’m
planning on doing a quick tutorial on that install in
a later installment, so let’s just drop it in too. The
compiler is called avr-gcc, but for some reason the
apt-get package is called gcc-avr – don’t let that
What makes apt-get so nice to work with is
that it will download and build what you are
installing. While it does that, it sorts out any
dependencies that the package needs and
downloads and builds those too. So, when you
run apt-get, be ready to sit back for several
minutes while files are found, sorted, downloaded,
installed, and finally built.
This apt-get package will install the tool chain
in /usr/bin. This would not have been my choice —
I like to put things in their own little sandbox like
/usr/local/avr-gcc, for instance — but I didn’t want
to fuss with apt-get options to move the install
and perhaps mess up some path dependencies
down-stream. So, I left it where it put it. To prove
to yourself that all went well, type avr-gcc –v on
your command line (letter case matters!); you’ll
see that you are running version 4. 3. 3. Likewise,
type avrdude –v and it will report version 5. 8.
You’re good to go ... on with the next step!
Step Two: Get Eclipse CDT for
Why do we want Eclipse? What does it do?
Eclipse is a generic IDE (Integrated Development
Environment) that is designed to work with a
variety of programming languages. However, by
itself, Eclipse is really nothing more than a
customizable text editing program. If you add on
plugin modules, then Eclipse becomes a whole lot
more. The CDT version of Eclipse is customized for
C and C++ programming so that it recognizes
those types of syntax and can help you with a
variety of editing enhancers. With the AVR plugin,
Eclipse also handles building makefiles and
generating the correct build flags for the avr-gcc
command line compiler and linker. You can add
Subversion or any other software versioning plugin
supported, and you can debug your software with
GDB, as well. Many different platforms use Eclipse
as the IDE of choice. I’ll show you how to