This article illustrates how to use Eclipse to cross compiling your C/C++ code on a Windows PC.
Written by Andrea Leganza & Sergio Tanzilli
Eclipse is a multi-language software development environment comprising an IDE and a plug-in system to extend it. It is written primarily in Java and can be used to develop applications in Java and, by means of the various plug-ins, in other languages as well, including C, C++, Python, Perl, PHP, and others (read more...).
Download Eclipse IDE for C/C++ Developers for Windows from the Eclipse website:
Uncompress the file directly in the working directory (i.e. c:\eclipse) then to execute it just launch eclipse.exe. No installation procedure is required.
To made easy the cross compilation procedure install the plugin called GNU ARM Eclipse Plug-in.
To do that open the menu Help –> Install New Software… then copy this URL http://gnuarmeclipse.sourceforge.net/updates in the Work with field then type enter.
Uncheck the “Group items by category” to display the ARM plugins available.
Check the GNU ARM C/C++ Development Support item and press the Next button.
Sourcery G++ ARM lite is a complete C/C++ development environment based on the GNU Toolchain which is freely available and has a quick installer that manages also the path variables to simplify the calls to the executable everywhere inside your computer
Got o this link http://www.codesourcery.com/sgpp/lite/arm/portal/release1039 and download the IA32 Windows Installer (direct link).
Run the executable file to install the toolchain.
When appears the message box Chose Install Folder provide a simple path like c:\codesourcery. Avoid to use the default one (on my Windows 7 PC the default value is C:\Program Files (x86)\CodeSourcery\Sourcery G++ Lite) because probably Eclipse can't manage it.
The last step to do is to rename the binary files located in c:\codesourcery\bin from arm-none-linux-gnueabi… to arm-none-eabi…) used by default by the Eclipse ARM plugin.
Change:
Eclipse should be able now to call the xcross executables needed to deploy to the FOXG20 ARM processor.
Create a new C Project from the menu File→New→C Project.
Insert a project name, select the toolchains ARM Windows GCC (Sourcery G++ Lite) and press the Finish button.
If the welcome screen is still open close it clicking on the X near the Welcome tab.
Create a new file, i.e. hello.c and fill with the classic Hello World ! example.
#include <stdio.h> int main(void) { printf("Hello world !\n"); return 0; }
Now configure the builder and set where to find the correct libc libraries:
Open the menu Project > Properties
Click on C/C++ Build item and set:
Now click on the small triangle near the C/C++ Build item to view the subitems then select Settings and set:
Go back on C/C++ General, select Paths and Symbols then the tab Includes. Under the Languages column select GNU C and add the following paths:
Change codesourcery with the path you chose during the ARM toolchain installation.
Install now the plugins to develop remotely on FOX Board G20. These softwares allow to control remotely your FOX Board G20 and trasferring/deleting/moving files as a normal file manager does, they provide also the support for tftp, ssh and dstore; a console is also provided.
Using actions you can create simple/complex bash scripts to be run on one file or in a folder (see later in this paragraph).
Open the menu Help –> Install New Software…. In the Work with drop down list select the item –All Available Sites–.
In the type filter type field type remote, after a while, depending on your internet connection, you will receive a list of software available to install.
Under the category General Purpose Tools check these three items:
Click on Next to confirm, accept the licence terms then Finish and accept to restart Eclipse.