Project

General

Profile

Actions

Setting up Arduino with Eclipse IDE

Note: These directions may be out of date due to the major rework of the Arduino code in the 1.0.1 series.

Installing Eclipse and AVR-GCC

  1. Install a Java JRE (or SDK if you need it for other things)
    1. http://java.com
  2. Follow the directions on the Eclipse website to install Eclipse for C/C++
    1. http://www.eclipse.org/downloads/moreinfo/c.php
    2. If you already have a different flavor installed, you need to install the CDT configuration
    3. http://eclipse.org/cdt/
  3. Winstall WinAVR http://winavr.sourceforge.net/

Eclipse plugins

Start eclipse before continuing.

Subversive (for SVN)

  1. MenuBar "Help" > Install New Software...
  2. Look at "Work with:" dropdown
  3. Pick Helios or Indigo
  4. The listing underneath should show a category "Collaboration". Expand it.
  5. Check the box next to "Subversive SVN Team Provider (Incubation)". If there are multiple, pick the latest version.
  6. Click Finish
  7. Answer all of the following menus which are mostly licensing.
  8. Restart eclipse

Setting up SVN in eclipse

  1. Click on the View icon in the bottom left corner. (It should look like a tiny window with a +)
  2. Click on "Other..."
  3. In the "Show View" window, expand SVN
    1. Now Choose SVN Repositories
  4. More dialogs will ask what kind of SVN Connector to install. Choose the pure java version SVNKit with the latest version number. !!!DO NOT CHOOSE JAVAHL!!!!
  5. Restart eclipse
  6. Click on "Other..."
  7. In the "Show View" window, expand SVN
    1. Now Choose SVN Repositories. A Tab should appear "SVN Repositories"
  8. In the SVN Repositories tab
    1. Click on the yellow cylinder with a green +. DO NOT CLICK ON THE ONE THAT SAYS SVN!
    2. The window "New Repository Location" should appear
    3. Type in the project URL in the URL: field. This is https://projects.cs.ru.is/svn/arduino
    4. Under Authentication, fill in the User: and Password:
    5. click on Finish
  9. A yellow cylinder with "https://projects.cs.ru.is/svn/arduino" should appear
  10. Expand it and see if the files in our project appear

eclipse-avr

  1. MenuBar "Help" > Install New Software...
  2. Click on "Add"
    1. Name: AVR Eclipse plugin
    2. Location: http://avr-eclipse.sourceforge.net/updatesite
    3. Click "OK"
  3. Make sure that it is selected under "Work with:"
  4. "CDT Optional features" should show up in the listing. Expand it.
  5. Check "AVR Eclipse Plugin"
  6. Click Finish
  7. Answer all of the following menus which are mostly licensing.
  8. Restart eclipse

Installing the ArduinoTemplate

  1. Grab the ArduinoTemplate.zip from https://projects.cs.ru.is/projects/arduino/files
  2. Unzip the ArduinoTemplate.zip somewhere
  3. Import the files as a new AVR C++ project
  4. Rename the project in the project explorer
  5. Check in the rename

Note, even with this template you will need to setup the AVRDUDE
programmer at least once

  1. Right click on the project and select "Properties"
  2. Expand the AVR section on the left
  3. Click on "Target Hardware"
    1. For the Arduino UNO, MCU type is ATmega328P
    2. For the Arduino Mega 256, MCU type is ATmega2561
    3. Both: The MCU Clock frequency is 16 000 000
  4. Click on "AVRDude" on the left
  5. Make sure "Programmer" tab is selected
  6. In the "Programmer configuration" are
  7. Click on New...
    1. Configuration name: "Arduino UNO"
    2. Description: "Arduino UNO on port PORT" Put your
      portname instead of PORT. This is something like COM3 on
      windows and /dev/ttyUSB0 on linux
    3. Programmer Hardware (-c): choose Arduino
    4. Override default port: choose the port that the Arduino is
      attached to
    5. Click on "OK"
  8. You may have to do this for multiple ports if the
    Arduino keeps changing which one it uses
  9. Click on "Apply"

Frequently Asked Questions

For some reason, it claims that it can't find avr-g++, even though I know I gave it right path. Why?

There are a few common reasons for this, mostly under Windows:
  1. The permissions on the folder you have given are wrong, so the program can't see the files
  2. You have a non-ASCII character (like ö) in the path.

The easiest way to fix these are to put the Arduino (or WinAVR/AVR-GCC) files into a folder that is safe. I recommend putting them in an Arduino folder in the C:\Program Files.

Updated by Joseph Foley almost 12 years ago · 5 revisions