Project

General

Profile

Building Applications for MitySOM-5CSx using Eclipse and Yocto

This page will talk about creating an application using the Eclipse Yocto plugin. The plugin simplifies setting up eclipse to use the toolchain that is created by Yocto for cross-compiling.

Prerequisites

Eclipse needs to be installed

For the provided VM, run the following from the terminal to install:

cd Downloads
wget http://ftp.osuosl.org/pub/eclipse/technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk-x86_64.tar.gz
cd
tar -xzvf Downloads/eclipse-cpp-kepler-SR2-linux-gtk-x86_64.tar.gz
sudo apt-get update
sudo apt-get install default-jre

Eclipse can now be launched from the terminal:

~/eclipse/eclipse

We suggest using the Kepler C/C++ release of Eclipse.

The Yocto plugin needs to be installed

The plugin can be found here. We suggest installing the 1.7.1 version.

Steps to install:
  1. Open eclipse
  2. Go to Help->Install New Software...
  3. Paste the following into the Work with: text box: http://downloads.yoctoproject.org/releases/eclipse-plugin/1.7.1/kepler/
  4. Check all the Yocto plug-ins
  5. Click Next
  6. Click Next
  7. Select I accept
  8. Click Finish
  9. Click OK for the Security Warning popup
  10. Click Yes to restart Eclipse

The SDK needs to be created and installed for the Yocto image that is being used

If you would rather not do the yocto build you can use the one we provide: https://support.criticallink.com/redmine/attachments/download/9462/poky-eglibc-x86_64-mitysom-5csx-dev-kit-cortexa9hf-vfp-neon-toolchain-1.5.4.sh

For the root file system shipped with our dev kits we used the mitysom-5csx-dev-kit image. So if you followed Yocto for MitySOM-5CSX guide to build the file system you need run the following command to build the sdk:

bitbake mitysom-5csx-dev-kit -c populate_sdk

After this done the sdk will be in the build folder under tmp/deploy/sdk/poky-eglibc-x86_64-mitysom-5csx-dev-kit-cortexa9hf-vfp-neon-toolchain-1.5.4.sh

Run this shell script in order to install the sdk, which will by default install to /opt/poky/1.5.4

Using Yocto with Eclipse

Setup

You will need to initially setup the yocto plugin to use the SDK we just setup.

  1. Open Eclipse
  2. Goto Window->Preferences
  3. Select Yocto Project ADT
  4. Select Standalone pre-built toolchain
  5. Set Toolchain Root Location to /opt/poky/1.5.4
  6. Set Sysroot Location to /opt/poky/1.5.4/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
  7. Press OK

You're now all set to create a new project that uses the cross-compile toolchain made by Yocto

Example Project

To quickly test your setup you can try the built in Yocto Hello World project.

  1. Open Eclipse
  2. Goto File->New->C++ Project
  3. Set a Project Name
  4. Select Yocto Project ADT Autotools Project->Hello World C++ Autotools Project
  5. Click Next
  6. Set the Author
  7. Click Finish

You now have a autotools project that is setup to use the yocto toolchain!

Go to top
Add picture from clipboard (Maximum size: 1 GB)