VAR-SOM-MX6 Yocto GS eclipse v3

From Variscite Wiki
VAR-SOM-MX6 Programming with Eclipse and Yocto version 3 (Yocto Fido)

Variscite's Yocto release includes the required packages to the build images fsl-image-qt5 with Eclipse debug support. This guide will describe how to use Eclipse to develop applications to run on the VAR-SOM-MX6.
Detail information can be found:
http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#application-development-workflow
previous version

1 Host tools

1.1 Build

Change directory to your build directory and verify that your environment settings is set correctly.

$ . ./setup-environment build_x11/

Build the tools:

bitbake meta-toolchain

The build creates the tools installer

$ ls tmp/deploy/sdk/

The outcome should be:

ls tmp/deploy/sdk/
poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.sh
poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.manifest

1.2 Install SDK

$ tmp/deploy/sdk/poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.sh

When system prompts "Enter target directory for SDK (default: /opt/poky/1.8):" hit enter.

When system prompts "You are about to install the SDK to "/opt/poky/1.8". Proceed[Y/n]?" hit Y and enter.

An installation log should look like:

variscite@baba:~/var-som-mx6-yocto-fido/build_x11$ tmp/deploy/sdk/poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.sh 
Enter target directory for SDK (default: /opt/poky/1.8): 
The directory "/opt/poky/1.8" already contains a SDK for this architecture.
If you continue, existing files will be overwritten! Proceed[y/N]?y
[sudo] password for variscite: 
Extracting SDK...done
Setting it up...
done
SDK has been successfully set up and is ready to be used.

2 Eclipse installation

Please follow : https://community.freescale.com/docs/DOC-172840

3 Create and run a simple application

3.1 Create the Project

You can create two types of projects: Autotools-based, or Makefile-based. This section describes how to create Autotools-based projects from within the Eclipse IDE. To create a project based on a Yocto template and then display the source code, follow these steps:

  • File->New->C Project
  • Click Yocto Project ADT Project.
  • Select Hello World ANSI C Autotools Project. This is an Autotools-based project based on a Yocto template.

Prj1.jpg

  • Put a name in the Project name: field. Do not use hyphens as part of the name.
  • Click "Next".
  • Add information in the Author and Copyright notice fields.
  • Be sure the License field is correct.

Prj2.jpg

  • Click "Finish".
  • If the "open perspective" prompt appears, click "Yes" so that you in the C/C++ perspective.
  • The left-hand navigation pane shows your project. You can display your source by double clicking the project's source file.
  • "hit Ctrl B" It will build your project.

Prj3.jpg

3.2 Create communication link

Using the console of your target set a password with "passwd" command. choose a simple one named "root". The target should be connected to the network via Ethernet or WIFI. Use the "ifconfig" command to get the target ip address. From Eclipse

  • Window->Open Perspective->Other
  • Double click on Remote System Explorer

Tcf1.jpg

  • In the left bar right click and New->Connection
  • Choose TCF and Next

Tcf2.jpg

  • Set the Host name to the target IP

Tcf3.jpg

  • Hit Finish
  • On the left bar right click on the taget IP and select connect
  • Set "User ID:" to root, "Password:" to root and check the "Save password"

Tcf4.jpg

  • enter the root password again in the next poop up.

Once connected you can browse target file system, browse target process and lunch a terminal to the target.

3.3 Remote debug

Follow the below steps to remotely debug your application on the VAR-SOM-MX6.

  • Select "Debug Configurations..." from the "Run" menu.
  • In the left area, expand C/C++Remote Application.
  • Locate your project and select it to pop up a new tabbed view in the Debug Configurations Dialog.
  • Enter the absolute path which you want to deploy the application to. Use the "Remote Absolute File Path for C/C++Application:" field. For example, enter /home/root/hello

Dbg1.jpg

  • Click on the "Debugger" tab to see the cross-tool debugger you are using.
  • Click on the "Main" tab.
  • Hit Debug
  • Accept the debug perspective.

Dbg2.jpg