Difference between revisions of "BeagleBoardEclipse"
m (Add link to YAGARTO description) |
m (Start example project description) |
||
Line 127: | Line 127: | ||
==Example project== | ==Example project== | ||
+ | |||
+ | First, we download source code and control files for a small stand alone program we can run on BeagleBoard. For this, we use Magnus' [http://github.com/mlu/cortal_dendrites/tree/6ed04b7e838981f594eb6b701a17c220fff952dd/cortex_a8/standalone/LEDblink LEDblink] program. While Beagle is running at U-Boot prompt, this can be downloaded by OpenOCD JTAG to Beagle and let Beagle's LEDs blink. | ||
+ | |||
+ | Note: You need [http://www.elinux.org/ARMCompilers#Recommendations ARM cross compiler] installed for this (e.g. CodeSourcerys' 2009q1-203 version, or newer). | ||
+ | |||
+ | * From Magnus code, we need four files: | ||
+ | ** [http://github.com/mlu/cortal_dendrites/blob/6ed04b7e838981f594eb6b701a17c220fff952dd/cortex_a8/standalone/LEDblink/crt0.S crt0.S] | ||
+ | ** [http://github.com/mlu/cortal_dendrites/blob/6ed04b7e838981f594eb6b701a17c220fff952dd/cortex_a8/standalone/LEDblink/LEDblink.c LEDblink.c] | ||
+ | ** [http://github.com/mlu/cortal_dendrites/blob/6ed04b7e838981f594eb6b701a17c220fff952dd/cortex_a8/standalone/LEDblink/ldscript ldscript] | ||
+ | ** [http://github.com/mlu/cortal_dendrites/blob/6ed04b7e838981f594eb6b701a17c220fff952dd/cortex_a8/standalone/LEDblink/Makefile Makefile] | ||
+ | |||
+ | Note: Depending on your tool chain, in Makefile edit "TYPE" variable | ||
+ | |||
+ | * To be able to run Eclipse default configuration "make all" edit Makefile and add an "all" target. Result should look like | ||
+ | |||
+ | ... | ||
+ | CFLAGS=-g -Os -c -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard | ||
+ | |||
+ | '''all: LEDblink''' | ||
+ | |||
+ | LEDblink: LEDblink.o Makefile $(LDSCRIPT) crt0.o | ||
+ | ... | ||
+ | |||
+ | * After we have the source now, we can start a new Eclipse C project: | ||
+ | |||
+ | File -> New -> C Project | ||
+ | |||
+ | and there create a new empty Makefile project "LEDblink": | ||
+ | |||
+ | |||
+ | [[File:Eclipse 9.jpg]] | ||
+ | |||
tbd. | tbd. |
Revision as of 23:50, 1 October 2009
This page is about using Eclipse IDE for BeagleBoard. It is focused on JTAG debugging with e.g. OpenOCD, but can be extended to additional topics, e.g. C/C++ development. And, while the examples focus on Beagle, stuff shown here will most probably easily apply to other boards.
Contents
Installation
Here, installation of Eclipse for C/C++ development and embedded GDB/JTAG debugging will be described. This is done in three steps:
- Install base Eclipse tooling, called 'Eclipse Classic'
- Install plug in for C/C++ development, called 'CDT' (C/C++ Development Tooling)
- Install some extensions for embedded development from Zylin (Zylin Embedded CDT)
Note: The file names and versions given here are based on October 2009. They may change.
Eclipse Classic
- Download Eclipse Classic 3.5.x.
In October 2009 this was version 3.5.1. 32-bit Linux version download resulted in file eclipse-SDK-3.5.1-linux-gtk.tar.gz.
- Installation is done by extracting downloaded (tar.gz) file (e.g. tar xvfz eclipse-SDK-3.5.1-linux-gtk.tar.gz).
- Start Eclipse by calling
cd eclipse ./eclipse
You might want to add this to your path and/or add a start icon/shortcut on your desktop/start menue.
Starting Eclipse, you are asked for the directory where you want to have your workspace:
After doing this, Eclipse starts...
... and presents the start screen:
CDT
- To install CDT, in Eclipse select
Help -> Install new software...
- There, use
Add...
dialog and enter:
- Name: CDT
- Location: http://download.eclipse.org/tools/cdt/releases/galileo
Note: Check CDT download page for up to date link.
Press, OK, select both CDT components ...
... and click Next, accept license agreement and Finish. Then download and installation of CDT and dependencies starts.
- Wait until CDT installation finished. Then, you are asked to restart. Do this.
Zylin Embedded CDT
- To install Zylin Embedded CDT, in Eclipse select
Help -> Install new software...
- There, use
Add...
dialog and enter:
- Name: Zylin Embedded CDT
- Location: http://opensource.zylin.com/zylincdt
Note: Check Zylin Embedded CDT page for up to date link.
Press, OK, select Zylin Embedded CDT ...
... click Next and Finish. Accept message about unsigned components and restart Eclipse again.
CDT perspective
Now, everything is installed. We can switch to C/C++ mode now. For this:
- Switch to "Workspace" (clicking Workspace button)
- Make sure you are in C/C++ mode. In upper right corner, C/C++ perspective has to be enabled. If this isn't enabled (e.g. Java is enabled), do Window -> Open Perspective -> Other ... and select "C/C++":
Usage
To demonstrate usage an example is the best way. Here a small stand alone program is used. It is downloaded to BeagleBoard which is running U-Boot prompt and then debugged using OpenOCD JTAG debugger. So in this example we do:
- Get a small stand alone program (LEDblink) from internet and create an Eclipse project with it
- Start OpenOCD and configure Eclipse debug environment
- Download build example and debug it
Example project
First, we download source code and control files for a small stand alone program we can run on BeagleBoard. For this, we use Magnus' LEDblink program. While Beagle is running at U-Boot prompt, this can be downloaded by OpenOCD JTAG to Beagle and let Beagle's LEDs blink.
Note: You need ARM cross compiler installed for this (e.g. CodeSourcerys' 2009q1-203 version, or newer).
- From Magnus code, we need four files:
Note: Depending on your tool chain, in Makefile edit "TYPE" variable
- To be able to run Eclipse default configuration "make all" edit Makefile and add an "all" target. Result should look like
... CFLAGS=-g -Os -c -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard all: LEDblink LEDblink: LEDblink.o Makefile $(LDSCRIPT) crt0.o ...
- After we have the source now, we can start a new Eclipse C project:
File -> New -> C Project
and there create a new empty Makefile project "LEDblink":
tbd.
Debugging
tbd.
Reading
Additional plug ins
- There is an Eclipse plug-in available which provides a graphical view of an Open Embedded tree.