User Tools

Site Tools


Eclipse for AVR development

Description of how to setup Eclipse on Ubuntu for AVR development, using GCC, GDB and AVeRICE.

Basic install instructions can be found here.

These are my special notes about the process, and should be merged with the basic instructions where appropriate.

Install toolchain

sudo apt-get install avrdude avr-libc binutils-avr gcc-avr simulavr avarice

Install gdb-avr from sources, to get the newest version:

sudo apt-get source gdb
cd gdb*
sudo ./configure --prefix=/usr/local/avr --program-prefix="avr-" --target=avr --disable-werror
sudo make
sudo make install

I had to make a symlink to the avr-gdb program:

sudo ln -s /usr/local/avr/bin/avr-gdb /usr/bin/avr-gdb

AVR Dude

The basic instructions for setting up avrdude is working. I found it impossible to debug a program if I didn't load it with avrdude before debugging. Simply build the project and pres the AVR Upload button to do so.

Create a project

In order to use an already existing project with the avr plugin, I only found this solution:

  1. Delete the old eclipse project.
  2. Create a new project of type “C Project” and set the location to the already existing source directory.

Fix paths

If a project uses an external makefile, it might be necessary to change some environment variables for the project:

  1. Select Project→Properties and goto C/C++ Build→Environment
  2. Change the PWD and CWD variables to the project directory

Setup debugger

To use GDB an interface is required to use the mkII ICE debugger.

  1. Select Run→External Tools→External Tools Configurations
  2. Add a new launch and name it AVeRICE
  3. Location is /usr/bin/avarice
  4. Working Directory should be the project root
  5. For arguments I use
    --jtag usb

Now setup avr-gdb:

  1. Select Run→Debug Configurations
  2. Select the Debugger tab
  3. Choose gdbserver Debugger
  4. GDB debugger: avr-gdb
  5. GDB command file: leave empty
  6. Select Connection tab
  7. Choose TCP, localhost and port 4242

Now to debug simply run External Tools→AVeRICE. Then start the debugger.

Final Note

My setup is not very stable. As I mentioned above the program crashes for good if I don't load it with avrdude before debugging.

Also I have problems catching a breakpoint after a longer time period. It seems like AVeRICE looses connection to the mkII. It might be a problem with the mkII firmware, AVeRICE or both. If there is a problem with the mkII it could explain why debugging with AVR Studio on Windows is such a pain also.

eclipse-avr.txt · Last modified: 2019/07/21 20:03 (external edit)