VAR-SOM-MX6 Yocto GS eclipse v3: Difference between revisions

From Variscite Wiki
m (Text replacement - "http://variwiki" to "https://variwiki")
 
(24 intermediate revisions by 2 users not shown)
Line 2: Line 2:


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. <br/>Detail information can be found:<br/> [http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#application-development-workflow http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#application-development-workflow]<br/>  
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. <br/>Detail information can be found:<br/> [http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#application-development-workflow http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#application-development-workflow]<br/>  
[http://variwiki.com/index.php?title=VAR-SOM-MX6_Yocto_GS_eclipse previous version]
[https://variwiki.com/index.php?title=VAR-SOM-MX6_Yocto_GS_eclipse previous version]


= Host tools =
= Host tools =
Line 12: Line 12:
</pre>
</pre>
Build the tools:
Build the tools:
<pre>$&nbsp;bitbake meta-ide-support
<pre>
$&nbsp;bitbake meta-toolchain adt-installer
bitbake meta-toolchain
</pre>
</pre>
The build creates the tools installer
The build creates the tools installer
Line 21: Line 21:
<pre>
<pre>
ls tmp/deploy/sdk/
ls tmp/deploy/sdk/
adt_installer.tar.bz2
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.sh
poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.manifest
poky-glibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.manifest
Line 45: Line 44:


= Eclipse installation =
= Eclipse installation =
 
Please follow : https://community.freescale.com/docs/DOC-172840
The following steps will guide you how to download and install Eclipse Kepler CDT SR1.
 
== Download and install ==
 
Download from:
 
[http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/luna/SR2/eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz eclipse-cpp-luna]
<pre>$&nbsp;cd ~/
$&nbsp;tar xvf ../Downloads/eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz
</pre>
Run Eclipse:
<pre>$&nbsp;eclipse/eclipse &
</pre>
Set your workspace:<br/> [[File:Eclipse ws.jpg]]<br/> You can select any folder you like.<br/> Close the "welcome window".<br/> You should be at:<br/> [[File:Eclipse main.jpg]]<br/>
 
== Eclipse installations of additional packages ==
 
Based on: [http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#application-development-workflow http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#application-development-workflow]
 
#Start the Eclipse IDE.
#Make sure you are in your Workbench and select "Install New Software" from the "Help" pull-down menu.
#Select Luna - [Mars - http://download.eclipse.org/releases/mars] from the "Work with:" pull-down menu.
#Expand the box next to "Linux Tools" and select the Linux Tools LTTng Tracer Control, Linux Tools LTTng Userspace Analysis, and LTTng Kernel Analysis boxes. If these selections do not appear in the list, that means the items are already installed
#Expand the box next to "Mobile and Device Development" and select the following boxes:
##C/C++ Remote Launch
##Remote System Explorer End-user Runtime
##Remote System Explorer User Actions
##Target Management Terminal
##TCF Remote System Explorer add-in
##TCF Target Explorer
#Expand the box next to "Programming Languages" and select the Autotools Support for CDT and C/C++ Development Tools boxes.
#Complete the installation and restart the Eclipse IDE.<br/>
{{note|Comment:<br/>Some of the packages may be already installed.|info}} An install window example:<br/> [[File:Eclipse install add.jpg]] <br/>
 
== Yocto plug-in ==
 
There are more then one option to get the plug-in. We selected to use: Pre-built Plug-in from the Yocto Project Eclipse Update Site
 
To install the Eclipse Yocto Plug-in from the update site, follow these steps:
 
#Start up the Eclipse IDE.
#In Eclipse, select "Install New Software" from the "Help" menu.
#Click "Add..." in the "Work with:" area.
#Enter [http://downloads.yoctoproject.org/releases/eclipse-plugin/1.8/luna  http://downloads.yoctoproject.org/releases/eclipse-plugin/1.8/luna] in the URL field and provide a meaningful name in the "Name" field.
#Click "OK" to have the entry added to the "Work with:" drop-down list.
#Select the entry for the plug-in from the "Work with:" drop-down list.
#Check the boxes next to Yocto Project ADT Plug-in, Yocto Project Bitbake Commander Plug-in, and Yocto Project Documentation plug-in.
#Complete the remaining software installation steps and then restart the Eclipse IDE to finish the installation of the plug-in. <br/>
<br/>
<br/> [[File:Eclipse install yoctop1.jpg]]
<br/>
 
= Configuring the Eclipse Yocto Plug-in =
 
Configuring the Eclipse Yocto Plug-in involves setting up the Cross Compiler options and the Target options. The configurations you choose become the default settings for all projects. You have opportunities to change them later when you configure the project (see the following section). To start, you need to do the following from within the Eclipse IDE:
 
*Choose "Preferences" from the "Windows" menu to display the Preferences Dialog.
*Click "Yocto Project ADT".
 
== Configuring the Cross-Compiler Options ==
 
To configure the Cross Compiler Options, you must select the type of toolchain, point to the toolchain, specify the sysroot location, and select the target architecture.
 
*Selecting the Toolchain Type:
 
Your Toolchanin path should be /opt/poky/1.7. Otherwise point to your build folder.
 
*Specify the Sysroot Location:
 
Your Toolchanin sysroots path will be /opt/poky/1.7/sysroots. Otherwise point to your build folder.
 
This location is where the root filesystem for the target hardware resides.
 
*Select the Target Architecture: The target architecture will be selected automatically based on your build.<br/>
<br/>
<br/> [[File:Configure_adt.png]]
<br/>


= Create and run a simple application =
= Create and run a simple application =

Latest revision as of 11:56, 10 June 2020

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

Host tools

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

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.

Eclipse installation

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

Create and run a simple application

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

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.

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