AVR Plugin path management

Background

Early versions of the AVR Eclipse Plugin (prior 2.1) relied on the system path of the development system to execute the required tools (avr-gcc, avr-size, make etc.)

This had some drawbacks.

In both cases, the system path might not point to the toolchain the plugin user actually wants to use.

Also, as the AVR Eclipse Plugin grew in features, it required access to some specific files that are not on the system path, like the <avr/io.h> include file.

Another reason for implementing a path management was the inclusion of toolchain bundles in future versions of the plugin. A bundled toolchain will be a normal avr-gcc toolchain wrapped in a Eclipse plugin. This will allow ISV to compile an up-to-date toolchain and distribute it to users, using the Eclipse update mechanism. The user then has a fully working toolchain without needing to compile it himself.

Path sources

For each path the plugin requires, three different sources are possible:

  1. System paths

    This is the path as determined by the Plugin itself. The method of determining the system path is different on Windows and non-Windows machines:

    Windows

    The paths are taken from the Windows registry for the winAVR and AVR Tools applications.

    non-Windows

    The plugin currently assumes that all non-Windows platforms are Posix based.

    Each path has a test file associated with it, which will be searched for. To find this test file the following external commands are executed in order until a successful match is found:

    1. which command: Test if the test file is on the system $PATH
    2. find command: if the test file is not on the system $PATH, then the plugin will start searching the following directories (and their subdirectories) in order:
      /usr/local/ Some likely places for the avr-gcc toolchain
      /usr/
      /opt/
      /etc/ A likely place for configuration files like avrdude.conf
      ~/ The home of the current user
      /home/ All other home directories
    3. If all searches were unsuccessful an empty path is used.

    As these searches may take some time, they are performed at plugin startup and run in the background. However, if the searches have not been finished by the time the results are actually used, Eclipse will block until finished.

    As this startup delay can get quite long on large development systems, it can be inhibited on the path preference page.

  2. Bundle paths

    As of version 2.3 this is not yet implemented.

  3. Custom paths

    A path manually selected by the user. Each user supplied path is tested if it contains the test file as used for determining the system paths. Only paths that contain the required test file are accepted.

Optional vs. required vs. valid paths

Some of the files that the AVR Plugin accesses are not required for the basic operation. The paths to these files are marked as optional and may be empty if the required files are not available on the development system. This may cause some features to not work or be disabled.

A path is only valid if it contains a certain required test file (or is empty in case of an optional path). See below for a list of test files

Current paths

As of version 2.1, the plugin manages these paths

Name Description Required Test File

AVR-GCC

Path to the directory containing the AVR-GCC toolchain.

This directory must contain the avr-gcc compiler and all other used tools like avr-objdump, avr-size etc.

yes

avr-gcc(.exe)

GNU make

Path to the directory containing a GNU make. This is mainly used on Windows, where make is part of the winAVR distribution

yes

make(.exe)

AVR Header Files

Path to the directory containing the avr includes. This is currently only used for the AVR Device Explorer view to locate the <avr/io.h> file. It is not used for the compiler, as the avr-gcc compiler usually knows where to find its header files.

no

avr/io.h

AVRDude

Path to the directory containing the avrdude executable.

no

avrdude(.exe)

Atmel Part Description Files*

Path to the part description files directory, which is part of the AVR Tools application from Atmel

no

atmega16.xml

*unused in version 2.3 of the plugin. This path will be used in future versions of the plugin

backarrow Back: Concepts

Related Tasks
AVR Paths Preferences