Bare Metal Micro

Eclipse for AVR Development

3. Create the Project

In this step, we will create the initial project for a simple application that blinks an LED on the Arduino Uno.

  1. Start Eclipse CDT.
  2. From the main menu, choose File -> New -> C Project.
    This will open the C Project creation wizard that will walk us through setting up some of the basic settings of the project.
  3. Give the project a name, Blink.
    The name is fairly important since it gets used throughout the project for various settings. I recommend keeping it relatively short and free of spaces.
  4. For Project type, select Executable -> Empty Project.
    An executable project is one that will create an application that will run on the AVR. We will be adding our own source files later, so we don’t need Eclipse to help us out with any example files.
  5. For Toolchains, select Cross GCC.
    The AVR toolchain is a GCC cross compiler. A cross compiler is simply a compiler that builds applications to run on a target different from the host.
  6. Press Next.
  7. Select the Debug configuration and deselect the Release configuration.
    We have no need for a Release configuration since the flash image generated will be the same in either case.
  8. Press Next.
  9. Enter avr- for the Cross compiler prefix.
    GCC cross compilers all have executables with the same base name prefixed with a string that indicates the target of the cross compiler. Eclipse needs to know this, so that it knows the names of the tools it is looking for.
  10. For the Cross compiler path, enter the bin directory of the AVR toolchain installation.
    This helps Eclipse find where the toolchain executables are located.
  11. Press Finish.
  12. Eclipse will now create the project and open it in the Project Explorer view.