The developer's resource for computer interfacing, especially USB, serial (COM) ports, mass storage, and embedded networking. (Formerly Lvr.com)

Home > USB Central > USB OTG and Embedded Hosts > BeagleBoard Code for Accessing USB Devices > Using Eclipse to Cross-compile Applications for Embedded Systems

Using Eclipse to Cross-compile Applications for Embedded Systems

Jan Axelson

Part 1: Install a Toolchain
Part 2: Install Eclipse and C/C++ Development Tools
Part 3: Create and Configure a Project
Part 4: Compile and Run an Application
Part 5: Set Up Remote Debugging

Click the images to enlarge.

Send comments, suggestions, etc. to jan (at) janaxelson.com.

Part 3: Create and Configure a Project

With Eclipse installed, you're ready to create and configure a project.

Create a Project

Run eclipse and select File -> New -> Project

Open Project

In the New Project window, click C/C++, select C Project, and click Next

New Project

Enter your project's name (hello_world for this example) and click Finish.

Create Project

If the Open Associated Perspective window appears, click Yes.

Create a Build Configuration

The project requires defining a builld configuration that tells Eclipse how to cross-compile the project for the BeagleBoard-xM.

In the Project Explorer, right-click the project name and select Build Configurations -> Manage...

Build Configurations

Click New to create a configuration for cross-compiling.

Manage Configurations

In the Name box, enter the name of the configuration (bb_debug). Under Copy setttings from, select Existing configuration and Debug.

Create Build Configuration

Click OK and OK to return to the project.

In the Project Explorer, right-click hello_world and select Properties.

Project Properties

At the C/C++ Build item, click the arrow to expand the options and click Settings.

Project Settings

In the Configuration box, select bb_debug.

Click GCC Compiler, and set the Command text box to:

/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc

or your path to arm-angstrom-linux-gnueabi-gcc or your compiler if different.

Compiler Settings

Under GCC C Compiler, click Includes. In the Include paths (-l) window (the top one), click the icon with an arrow to add a directory path. Add:

/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include

or your path to arm-angstrom-linux-gnueabi/usr/include or your include directory if different.

Click OK.

Includes Settings

Click GCC Linker, and replace the text in the Command text box with:

/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc

or your path to arm-angstrom-linux-gnueabi-gcc or your compiler if different.

Linker Settings

Under GCC C Linker, click Libraries. In the Library search path (-L) window (the bottom one), click the icon with an arrow to add a directory path. Add:

/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/lib

or your path to arm-angstrom-linux-gnueabi/lib or your libraries if different.

Library Path

Click OK.

Click GCC Assembler and replace the text in the Command text box with:

/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-as

or your path to arm-angstrom-linux-gnueabi-as or your assembler if different.

Assembler Settings

Click OK.

In the Project Explorer, right-click the project name and select Build Configurations -> Set Active and select bb_debug or whatever you named your build configuration.

Set Configuration

Go to Part 4: Compile and Run an Application.