Setting up the Eclipse IDE for Yocto Application Development

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting up the Eclipse IDE for Yocto Application Development

Setting up the Eclipse IDE for Yocto Application Development

This document shows the necessary steps to configure the Eclipse IDE for development of Yocto applications.

Requirements

1) Linux machine. Ubuntu 12.4 or higher is recommended.

2) Yocto Freescale BSP Release or Freescale Community BSP.

For this example we'll use the Freescale BSP Release L3.14.28 but you may use the FSL Community BSP.

- Freescale Community BSP

FSL Community BSP

- Freescale BSP Release  Documentation L3.14.28 (login required)

https://www.freescale.com/webapp/Download?colCode=L3.14.28_1.0.0_LINUX_DOCS&location=null&fpsp=1&WT_...

3) Poky Meta Toolchain (Poky 1.7 / L3.14.28 for our example but you should use the toolchain that corresponds to the BSP that will be used)

For information on how to extract and install the meta toolchain please follow the steps on the next document.

Task #7 - Create the toolchain

4) Eclipse Luna.

We’ll use the Luna SR2 (4.4.2) version of the Eclipse IDE. You may find it on the following website:

http://www.eclipse.org/downloads/packages/release/luna/sr2

Look for the “Eclipse IDE for C/C++ Developers”, which contains the Eclipse Platform, the Java Development Tools (JDT), and the Plug-in Development Environment.

Once you have downloaded the tarball extract it. The following command unpacks and installs the downloaded Eclipse IDE tarball into a clean directory using the default name eclipse:

     $ cd ~

     $ tar -xzvf ~/Downloads/eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz

Configuring the Eclipse IDE

Once with Eclipse Luna installed you may run the Eclipse IDE with the following command:

$ cd eclipse

$ ./eclipse

Select a new workspace.

01_Eclipse_Workspace.png

Chose "Install New Software" from the "Help" pull-down menu.

02_Eclipse_Install_new_SW.png

Select the "Luna - http://download.eclipse.org/releases/luna"

Find and expand the Linux Tools option and select:

  • Linux Tools LTTng Tracer Control
  • Linux Tools LTTng Userspace Analysis
  • LTTng Kernel Analysis

If some of these options are not listed it means that they are already installed. (To change this you may uncheck the Hide items that are already installed box)

05_Eclipse_Linux_Tools.png

Find and expand the Mobile and Device Development and select the following:

  •   C/C++ Remote Launch (Requires RSE Remote System Explorer)
  •   Remote System Explorer End-user Runtime
  •   Remote System Explorer User Actions
  •   Target Management Terminal (Core SDK)
  •   TCF Remote System Explorer add-in
  •   TCF Target Explorer

If some of these options are not listed it means that they are already installed. (To change this you may uncheck the Hide items that are already installed box)

07_Mobile_Dev_Packages.png

Expand Programming Languages and select:

  •   C/C++ Autotools Support
  •   C/C++ Development Tools

Chose Next and accept the necessary EULA

07_Eclipse_EULA.png

Clck on the Finish button. The selected packages will be downloaded and installed. You will be asked to restart Eclipse IDE to finish the installation.

11_Eclipse_Restart.png

Adding the Yocto Plug-in to the Eclipse IDE

Next step is to install the Eclipse Yocto Plug-in into the Eclipse IDE. We'll show how to install the pre-built plug in.

Start the Eclipse IDE

In Eclipse, select "Install new Software" from the "Help" menu

Click the "Add..." button to add a repository and enter:

Name: Any name, we will use Yocto Fio

Location: http://downloads.yoctoproject.org/releases/eclipse-plugin/1.8/luna

11_Eclipse_AddFido.png

Click "Ok" and then chose this new repository on the "Work with" drop-down menu and select the following plug-ins from the list:

  •   Yocto Project ADT Plug-in
  •   Yocto Project Bitbake Commander Plug-in
  •   Yocto Project Documentation plug-in

12_Eclipse_Yocto2Install.png

Install these plug-ins and click "OK" when prompted about installing software that contains unsigned content. You may be asked to restart the Eclipse IDE.

Configuring the Eclipse Yocto Plug-in

With all the necessary packages installed we'll now configure the Eclipse Yocto Plug-in. In this steps we will configure the Cross Compiler options and the Target options. These will then be used as default for your projects from within your working workspace.

Select "Preferences" from the "Window" menu.

14_WIndow_Preferences.png

Click on Yocto Project ADT from the left options and then under Cross Compiler Options select the Standalone pre-built toolchain radio button. We need to point to the Toolchain Root location of our installed toolchain. This is covered on the following community document:

Task #7 - Create the toolchain

In this case we'll be using poky 1.7 tollchain which has the following default location:

/opt/poky/1.7

As fo the Sysroot Location this would correspond to your build directory sysroot folder, which is located on the following path:

<YOCTO_BSP_DIR>/<BUILD_DIR>/tmp/sysroots/<MACHINE>

In our case our Tartget architecture would be the Cortex-A9, which correspond to the i.MX6 and which is also the only option installed on the chosen directory.

For Target Options we would be using the actual HW in order to test our application so keep the External HW option selected.

14_YoctoADT_Settings.png

Creating a Hello World Project

We are now ready to create our project. Just to test our configuration we'll create a Hello World project.We can do so by selecting File->New->C Project or C++ Project

We must then select a Project name and in project type we can chose either an Empty project or as in our case a Hello World Project, all this under the Yocto Project ADT Autotools Project folder. We will have the GNU Autotools Tolchain selected.

16_Eclipse_NewHWProject.png

The next screen will show some of the Basic Properties for our project, including the GNU license. Fill these as required. You may clock on Finish at this point.

17_Settings_for_project.png

We should see that the HelloWorld project was created. We should right-click on the project folder and then chose Reconfigure Project in order to fill the necessary libraries.

17_ReconfigureProject.png

After this is completed we can build our project either by choosing the hammer icon or in the Build Project option inside the Project menu. We can look for correct competition or any errors or warning on the Console tab.

18_Eclipse_BuildOK.png

Further Application Development

After this basic setup you may work on more complex examples like a GPU and a Gstreamer Application examples on the following nicely written document:

Yocto Application Development Using Eclipse IDE

Labels (2)
Comments

I follow the guide and build successfully

but I encounter three infos in Problem sheet

is there something wrong?

Screenshot from 2016-01-12 09^%21^%53.png

Hi,

As I see, there should not be any issue about it.

/Alejandro

Hi, i followed the steps above, but i'm stuck at the "Reconfigure Project" step i got this output when make thisScreenshot from 2016-07-20 07_55_33.png
I chmod the workspace file to have 'rwx' permissions also i got the 2.1 yocto plugin version and the toolchain that i'm using is the corresponding to the image targetScreenshot from 2016-07-20 08_07_14.png

Toolchain:core-image-sato-armv7a http://downloads.yoctoproject.org/releases/yocto/yocto-2.1/toolchain/i686/

Image: bitbake core-image-sato
Machine: imx6ulevk

Really need help with this one, thanks in regards

Hello,

I have built the toolchain for MACHINE=imx6ulevk using 'bitbake meta-toolchain'. After installing the  components in 'Luna Service Release 2 (4.4.2)' as pointed upwards, I have not been able to properly set the parameters in Yocto Project ADT plugin.

Initially, as I did not find the corresponding components, I decided to execute '/build_toolchain/tmp/deploy/sdk/fsl-imx-x11-glibc-x86_64-meta-toolchain-cortexa7hf-vfp-neon-toolchain-4.1.15-1.2.0.sh', which installed some components in /opt folder.

Then, I set:

-Toolchain (installed with the sh script): /opt/fsl-imx-x11/4.1.15-1.2.0

- Sysroot folder: build_toolchain/tmp/sysroots/imx6ulevk

However, when applying the parameters, I get an error message in the upper part of the configuration screen: "Specified toolchain ...e meta-ide-support".

Is there any solution to this? Should I work in another way or event bitbake another image?

Thanks for the nice article. I am able to set the eclipse for my project successfully

The solution was to select: "Standalone pre-built toolchain" in Window -> Preferences -> Yocto Project ADT

Hello,

Thanks for this tutorial.

I have followed all the steps and I hadn't got any problems, but I can arrive to configure the same project to compile with gcc Linux Compile to running in Linux x86 platform not in the iMX6.

Somebody can help me ?

Thanks,

Hi,

this tutorial is great. I have followed the tutorial but I am  having problems using headers files from a folder outside the project workspace.  I can see the folder included under the includes directory but when I try to reference a file from it, the file is not located by eclipse. Can anybody help me?

Thanks in advance.

Hi,

   I have gone through steps to add eclipse plug-in to add yocto.

   when Configuring the Eclipse Yocto Plug-in There i was facing an issue with Target Architecture  was disabled (Shown in below picture), can you guy's help to Enable Target Architecture Option.

                                          pastedImage_2.png

Thanks & Regards,

Ghalib khan c.

@gusarambula Can we use HOST PC OS Windows 10? 

It will be great help if you can share link of NXP forum article which gives steps to use Yocto on Eclipse and Host PC as Windows. 

#HOSTPC_Windows10 #YOCTO #GettingStatrted #Eclipse

No ratings
Version history
Last update:
‎09-10-2020 02:12 AM
Updated by: