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
In the New Project window, click C/C++, select C Project, and click Next
Enter your project's name (hello_world for this example) and click Finish.
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...
Click New to create a configuration for cross-compiling.
In the Name box, enter the name of the configuration (bb_debug). Under Copy setttings from, select Existing configuration and Debug.
Click OK and OK to return to the project.
In the Project Explorer, right-click hello_world and select Properties.
At the C/C++ Build item, click the arrow to expand the options and click 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.
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.
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.
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.
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.
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.