From 3277d8d307d580711870ca0a3901225b053a4171 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 2 Sep 2016 17:24:56 -0700 Subject: sdk-manual: Updates to "Working With Eclips" for Neon Fixes [YOCTO #7546] Applied changes throughout this section to move it from Luna to the Neon version (latest) of Eclipse. We now provide a single thread for Eclipse, which is based on the latest version (Neon). Information for Mars, which is also supported) is in a new Appendix C. (From yocto-docs rev: 82995d9c49e4c55707591a1375c5d86874c589b0) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/sdk-manual/sdk-using.xml | 713 +++++++++++++++++++-------------- 1 file changed, 420 insertions(+), 293 deletions(-) (limited to 'documentation') diff --git a/documentation/sdk-manual/sdk-using.xml b/documentation/sdk-manual/sdk-using.xml index 70c1bf5c77..6b14f1b575 100644 --- a/documentation/sdk-manual/sdk-using.xml +++ b/documentation/sdk-manual/sdk-using.xml @@ -558,7 +558,7 @@ Once your application is deployed, you need to test it. Within the Eclipse IDE, you can use the debugging environment along with supported performance enhancing - tools. + Linux Tools. @@ -567,20 +567,9 @@
Working Within Eclipse - - This section needs to be updated to use Eclipse Neon throughout. - It is out of date at the moment. - - The Eclipse IDE is a popular development environment and it fully supports development using the Yocto Project. - - This release of the Yocto Project supports both the Luna - and Kepler versions of the Eclipse IDE. - Thus, the following information provides setup information for - both versions. - @@ -598,27 +587,31 @@ allow you to perform remote profiling, tracing, collection of power data, collection of latency data, and collection of performance data. + + This release of the Yocto Project supports both the Neon + and Mars versions of the Eclipse IDE. + This section provides information on how to use the Neon + release with the Yocto Project. + For information on how to use the Mars version of Eclipse + with the Yocto Project, see + "Appendix C. + - - This section describes how to install and configure the Eclipse IDE - Yocto Plug-in and how to use it to develop your application. - - -
- Setting Up the Eclipse IDE +
+ Setting Up the Neon Version of the Eclipse IDE To develop within the Eclipse IDE, you need to do the following: - Install the optimal version of the Eclipse - IDE. + Install the Neon version of the Eclipse + IDE. Configure the Eclipse IDE. - + Install the Eclipse Yocto Plug-in. - + Configure the Eclipse Yocto Plug-in. - + Do not install Eclipse from your distribution's package @@ -628,110 +621,120 @@ -
- Installing the Eclipse IDE - - - It is recommended that you have the Luna SR2 (4.4.2) - version of the Eclipse IDE installed on your development - system. - However, if you currently have the Kepler 4.3.2 version - installed and you do not want to upgrade the IDE, you can - configure Kepler to work with the Yocto Project. - +
+ Installing the Neon Eclipse IDE - If you do not have the Luna SR2 (4.4.2) Eclipse IDE - installed, you can find the tarball at - . - From that site, choose the appropriate download from the - "Eclipse IDE for C/C++ Developers". - This version contains the Eclipse Platform, the Java - Development Tools (JDT), and the Plug-in Development - Environment. - - - - Once you have downloaded the tarball, extract it into a - clean directory. - For example, the following commands unpack and install the - downloaded Eclipse IDE tarball into a clean directory - using the default name eclipse: - + Follow these steps to locate, install, and configure + Neon Eclipse: + + + Locate the Neon Download: + Open a browser and go to + http://www.eclipse.org/neon/. + + + Download the Tarball: + Click through the "Download" buttons to + download the file. + + + Unpack the Tarball: + Move to a clean directory and unpack the tarball. + Here is an example: + $ cd ~ - $ tar -xzvf ~/Downloads/eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz - + $ tar -xzvf ~/Downloads/eclipse-inst-linux64.tar.gz + + Everything unpacks into a folder named + "eclipse-installer". + + + Launch the Installer: + Use the following commands to launch the installer: + + $ cd ~/eclipse-installer + $ ./eclipse-inst + + + + Select Your IDE: + From the list, select the "Eclipse IDE for + C/C++ Developers". + + + Install the Software: + Accept the default "cpp-neon" directory and click + "Install". + Accept any license agreements and approve any + certificates. + + + Launch Neon: + Click the "Launch" button and accept the default + "workspace". + +
-
- Configuring the Eclipse IDE - - - This section presents the steps needed to configure the - Eclipse IDE. - +
+ Configuring the Neon Eclipse IDE - Before installing and configuring the Eclipse Yocto Plug-in, - you need to configure the Eclipse IDE. - Follow these general steps: + Follow these steps to configure the Neon Eclipse IDE. + + Depending on how you installed Eclipse and what you have + already done, some of the options will not appear. + If you cannot find an option as directed by the manual, + it has already been installed. + - Start the Eclipse IDE. - Make sure you are in your Workbench and - select "Install New Software" from the "Help" - pull-down menu. + Be sure Eclipse is running and + you are in your workbench. + + Select "Install New Software" from + the "Help" pull-down menu. + Select - Luna - &ECLIPSE_LUNA_URL; + "Neon - http://download.eclipse.org/releases/neon" from the "Work with:" pull-down menu. - - For Kepler, select - Kepler - &ECLIPSE_KEPLER_URL; - - 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. - - For Kepler, select - LTTng - Linux Tracing Toolkit - box. - + Expand the box next to + "Linux Tools" and select the following: + + C/C++ Remote (Over TCF/TE) Run/Debug Launcher + TM Terminal + Expand the box next to "Mobile and - Device Development" and select the following boxes. - Again, if any of the following items are not - available for selection, that means the items are - already installed: - - 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 - - Expand the box next to "Programming - Languages" and select the - C/C++ Autotools Support - and C/C++ Development Tools - boxes. - For Luna, these items do not appear on the list - as they are already installed. + Device Development" and select the following + boxes: + + C/C++ Remote (Over TCF/TE) Run/Debug Launcher + Remote System Explorer User Actions + TM Terminal + TCF Remote System Explorer add-in + TCF Target Explorer + + + Expand the box next to + "Programming Languages" and select the + following box: + + C/C++ Development Tools SDK + + + + Complete the installation by clicking through + appropriate "Next" and "Finish" buttons. - Complete the installation and restart - the Eclipse IDE.
-
- Installing or Accessing the Eclipse Yocto Plug-in +
+ Installing or Accessing the Neon Eclipse Yocto Plug-in You can install the Eclipse Yocto Plug-in into the Eclipse @@ -740,12 +743,12 @@ install the plug-in from the latest source code. -
+
Installing the 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: + To install the Neon Eclipse Yocto Plug-in from the + update site, follow these steps: Start up the Eclipse IDE. @@ -753,27 +756,24 @@ Software" from the "Help" menu. Click "Add..." in the "Work with:" - area. - Enter - &ECLIPSE_DL_PLUGIN_URL;/luna + area. + + Enter + &ECLIPSE_DL_PLUGIN_URL;/neon in the URL field and provide a meaningful name in the "Name" field. - - If you are using Kepler, use - &ECLIPSE_DL_PLUGIN_URL;/kepler - in the URL 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. + Check the boxes next to the following: + + Yocto Project SDK Plug-in + Yocto Project Documentation plug-in + Complete the remaining software installation steps and then restart the Eclipse @@ -788,61 +788,55 @@
-
- Installing the Plug-in Using the Latest Source Code +
+ Installing the Plug-in Using the Latest Source Code - - To install the Eclipse Yocto Plug-in from the latest - source code, follow these steps: + + To install the Neon Eclipse Yocto Plug-in from the + latest source code, follow these steps: Be sure your development system - is not using OpenJDK to build the plug-in - by doing the following: - - Use the Oracle JDK. - If you don't have that, go to - - and download the latest appropriate - Java SE Development Kit tarball for - your development system and - extract it into your home directory. - - In the shell you are going - to do your work, export the location of - the Oracle Java. - The previous step creates a new folder - for the extracted software. - You need to use the following - export command - and provide the specific location: - - export PATH=~/extracted_jdk_location/bin:$PATH - - - + has JDK 1.7+ - In the same shell, create a Git - repository with: + install X11-related packages: + + $ sudo apt-get install xauth + + + In a new terminal shell, create a + Git repository with: $ cd ~ $ git clone git://git.yoctoproject.org/eclipse-poky - Be sure to checkout the correct - tag. - For example, if you are using Luna, do the - following: + Use Git to create the correct + tag: + + Developer's Note + + Because the 2.2 tag will not exist until after + the release, I must first do the following + before running the + git checkout mars/yocto-&DISTRO; + command in this step: + + $ cd ~/eclipse-poky + $ git tag neon/yocto-2.2 origin/neon-master + + + - $ git checkout luna/yocto-&DISTRO; + $ cd ~/eclipse-poky + $ git checkout neon/yocto-&DISTRO; - This puts you in a detached HEAD state, which + This creates a local tag named + neon/yocto-&DISTRO; + based on the branch + origin/neon-master. + You are put into a detached HEAD state, which is fine since you are only going to be building and not developing. - - If you are building kepler, checkout the - kepler/yocto-&DISTRO; - branch. - Change to the scripts @@ -856,27 +850,29 @@ $ ./setup.sh - - When the script finishes execution, + When the script finishes execution, it prompts you with instructions on how to run the build.sh script, which is also in the scripts directory of the Git repository created earlier. - Run the build.sh + + Run the build.sh script as directed. Be sure to provide the tag name, documentation - branch, and a release name. - Here is an example that uses the - luna/yocto-&DISTRO; tag, the - master documentation - branch, and - &DISTRO_NAME_NO_CAP; for the - release name: + branch, and a release name. + + Following is an example: - $ ECLIPSE_HOME=/home/scottrif/eclipse-poky/scripts/eclipse ./build.sh luna/yocto-&DISTRO; master &DISTRO_NAME_NO_CAP; 2>&1 | tee -a build.log + $ ECLIPSE_HOME=/home/scottrif/eclipse-poky/scripts/eclipse ./build.sh -l neon/yocto-&DISTRO; master yocto-&DISTRO; 2>&1 | tee build.log + The previous example command adds the tag you + need for + mars/yocto-&DISTRO; + to HEAD, then tells the + build script to use the local (-l) Git checkout + for the build. After running the script, the file org.yocto.sdk-release-date-archive.zip is in the current directory. @@ -887,12 +883,13 @@ Select "Install New Software" from the "Help" pull-down menu. - Click "Add". + Click "Add". + Provide anything you want in the "Name" field. Click "Archive" and browse to the - ZIP file you built in step eight. + ZIP file you built earlier. This ZIP file should not be "unzipped", and must be the *archive.zip file created by running the @@ -902,10 +899,20 @@ Check the boxes that appear in the installation window to install the - Yocto Project ADT Plug-in, - Yocto Project Bitbake Commander Plug-in, - and the - Yocto Project Documentation plug-in. + following: + + Developer's Note + + Right now, a check box for BitBake Commander + is appearing. + This probably needs removed. + Do not check this box. + + + + Yocto Project SDK Plug-in + Yocto Project Documentation plug-in + Finish the installation by clicking through the appropriate buttons. @@ -922,17 +929,18 @@ At this point you should be able to configure the Eclipse Yocto Plug-in as described in the - "Configuring the Eclipse Yocto Plug-in" - section. + "Configuring the Neon Eclipse Yocto Plug-in" + section. +
-
- Configuring the Eclipse Yocto Plug-in +
+ Configuring the Neon Eclipse Yocto Plug-in - Configuring the Eclipse Yocto Plug-in involves setting the - Cross Compiler options and the Target options. + Configuring the Neon Eclipse Yocto Plug-in involves + setting the Cross Compiler options and the Target options. The configurations you choose become the default settings for all projects. You do have opportunities to change them later when @@ -946,17 +954,28 @@ Choose "Preferences" from the "Window" menu to display the Preferences Dialog. - Click "Yocto Project ADT" to display + Click "Yocto Project SDK" to display the configuration screen. + The following sub-sections describe how to configure the + the plug-in. + + Throughout the descriptions, a start-to-finish example for + preparing a QEMU image for use with Eclipse is referenced + as the "wiki" and is linked to the example on the + Cookbook guide to Making an Eclipse Debug Capable Image + wiki page. + -
+
Configuring the Cross-Compiler Options - To configure the Cross Compiler Options, you must select + Cross Compiler options enable Eclipse to use your specific + cross compiler toolchain. + To configure these options, you must select the type of toolchain, point to the toolchain, specify the sysroot location, and select the target architecture. @@ -970,7 +989,7 @@ Standalone Pre-built Toolchain: - Select this mode when you are using + Select this type when you are using a stand-alone cross-toolchain. For example, suppose you are an application developer and do not @@ -978,45 +997,66 @@ Instead, you just want to use an architecture-specific toolchain on an existing kernel and target root - filesystem. - + filesystem. + In other words, you have downloaded + and installed a pre-built toolchain + for an existing image. + + Build System Derived Toolchain: - Select this mode if the - cross-toolchain has been installed - and built as part of the + Select this type if you built the + toolchain as part of the Build Directory. When you select Build system derived toolchain, - you are using the toolchain bundled - inside the Build Directory. + you are using the toolchain built and + bundled inside the Build Directory. + For example, suppose you created a + suitable image using the steps in the + wiki. + In this situation, you would select the + Build system derived toolchain. - Point to the Toolchain: + Specify the Toolchain Root Location: If you are using a stand-alone pre-built toolchain, you should be pointing to where it is - installed. + installed (e.g. + /opt/poky/&DISTRO;). See the "Installing the SDK" section for information about how the SDK is installed. - If you are using a system-derived + If you are using a build system derived toolchain, the path you provide for the Toolchain Root Location field is the - Build Directory. - See the + Build Directory + from which you run the + bitbake command (e.g + /home/scottrif/poky/build). + For more information, see the "Building an SDK Installer" - section. - Specify the Sysroot Location: + section. + + Specify Sysroot Location: This location is where the root filesystem for the target hardware resides. - The location of - the sysroot filesystem depends on where you - separately extracted and installed the - filesystem. - For information on how to install the + This location depends on where you + separately extracted and installed the target + filesystem. + As an example, suppose you prepared an image + using the steps in the + wiki. + If so, the MY_QEMU_ROOTFS + directory is found in the + Build Directory + and you would browse to and select that directory + (e.g. /home/scottrif/poky/build/MY_QEMU_ROOTFS). + + For more information on how to install the toolchain and on how to extract and install the sysroot filesystem, see the "Building an SDK Installer" @@ -1035,12 +1075,15 @@ See the "Building Images" section of the Yocto Project Quick Start for - more information. + more information. + You can also see the + wiki. +
-
+
Configuring the Target Options @@ -1054,16 +1097,24 @@ If you are using the emulator, you also need to locate the kernel and specify any custom options. - If you selected + If you selected the Build system derived toolchain, the target kernel you built will be located in - the Build Directory in + the + Build Directory + in tmp/deploy/images/machine directory. - If you selected - Standalone pre-built toolchain, - the pre-built image you downloaded is located - in the directory you specified when you + As an example, suppose you performed the steps in + the + wiki. + In this case, you specify your Build Directory path + followed by the image (e.g. + /home/scottrif/poky/build/tmp/deploy/images/qemux86/bzImage-qemux86.bin). + + If you selected the standalone pre-built + toolchain, the pre-built image you downloaded is + located in the directory you specified when you downloaded the image. Most custom options are for advanced QEMU users to further customize their QEMU instance. @@ -1095,13 +1146,14 @@ - Click the "OK" to save your plug-in configurations. + Click the "Apply" and "OK" to save your plug-in + configurations.
-
+
Creating the Project @@ -1124,52 +1176,50 @@ To create a project based on a Yocto template and then display the source code, follow these steps: - Select "Project" from the "File -> New" menu. - - Double click CC++. + Select "C Project" from the "File -> New" menu. - Double click C Project - to create the project. - Expand Yocto Project ADT Autotools Project. + Expand Yocto Project SDK Autotools Project. - Select Hello World ANSI C Autotools Project. + Select Hello World ANSI C Autotools Projects. This is an Autotools-based project based on a Yocto - template. + template. + Put a name in the Project name: field. - Do not use hyphens as part of the name. + Do not use hyphens as part of the name + (e.g. hello). + + Click "Next". - Click "Next". - Add information in the - Author and - Copyright notice fields. + Add appropriate information in the various + fields. + + Click "Finish". - Be sure the License - field is correct. - 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. + project's source file. +
-
+
Configuring the Cross-Toolchains The earlier section, - "Configuring the Eclipse Yocto Plug-in", + "Configuring the Mars Eclipse Yocto Plug-in", sets up the default project configurations. You can override these settings for a given project by following these steps: - Select "Change Yocto Project Settings" from - the "Project" menu. + Select "Yocto Project Settings" from + the "Project -> Properties" menu. This selection brings up the Yocto Project Settings Dialog and allows you to make changes specific to an individual project. @@ -1177,12 +1227,12 @@ Options for a project are inherited from settings you provided using the Preferences Dialog as described earlier in the - "Configuring the Eclipse Yocto Plug-in" section. + "Configuring the Mars Eclipse Yocto Plug-in" section. The Yocto Project Settings Dialog allows you to override those default settings for a given project. - Make your configurations for the project - and click "OK". + Make or verify your configurations for the + project and click "OK". Right-click in the navigation pane and select "Reconfigure Project" from the pop-up menu. @@ -1202,20 +1252,20 @@
-
+
Building the Project - To build the project select "Build Project" from the + To build the project select "Build All" from the "Project" menu. The console should update and you can note the cross-compiler you are using. - When building "Yocto Project ADT Autotools" projects, the Eclipse - IDE might display error messages for Functions/Symbols/Types - that cannot be "resolved", even when the related include file - is listed at the project navigator and when the project is - able to build. + When building "Yocto Project SDK Autotools" projects, the + Eclipse IDE might display error messages for + Functions/Symbols/Types that cannot be "resolved", even when + the related include file is listed at the project navigator and + when the project is able to build. For these cases only, it is recommended to add a new linked folder to the appropriate sysroot. Use these steps to add the linked folder: @@ -1247,7 +1297,7 @@
-
+
Starting QEMU in User-Space NFS Mode @@ -1259,31 +1309,65 @@ chapter in the Yocto Project Development Manual for more information on using QEMU. - - Expose and select "External Tools" from - the "Run" menu. - Your image should appear as a selectable menu item. + + Expose and select "External Tools + Configurations ..." from the "Run -> External Tools" menu. - Select your image from the menu to launch - the emulator in a new window. + + Locate and select your image in the navigation panel to + the left (e.g. qemu_i586-poky-linux). + + + Click "Run" to launch QEMU. + + The host on which you are running QEMU must have + the rpcbind utility running to be + able to make RPC calls on a server on that machine. + If QEMU does not invoke and you receive error messages + involving rpcbind, follow the + suggestions to get the service running. + As an example, on a new Ubuntu 16.04 LTS installation, + you must do the following in order to get QEMU to + launch: + + $ sudo apt-get install rpcbind + + After installing rpcbind, you + need to edit the + /etc/init.d/rpcbind file to + include the following line: + + OPTIONS="-i -w" + + After modifying the file, you need to start the + service: + + $ sudo service portmap restart + + If needed, enter your host root password in the shell window at the prompt. This sets up a Tap 0 connection needed for running in user-space NFS mode. - Wait for QEMU to launch. + Wait for QEMU to launch. + Once QEMU launches, you can begin operating within that environment. One useful task at this point would be to determine the IP Address for the user-space NFS by using the - ifconfig command. - + ifconfig command. + The IP address of the QEMU machine appears in the + xterm window. + You can use this address to help you see which particular + IP address the instance of QEMU is using. +
-
+
Deploying and Debugging the Application @@ -1299,7 +1383,11 @@ that connection alive during your work. For example, in a new terminal, run the following: - ssh -XY user_name@remote_host_ip + $ ssh -XY user_name@remote_host_ip + + Using the above form, here is an example: + + $ ssh -XY root@192.168.7.2 After running the command, add the command to be executed in Eclipse's run configuration before the application @@ -1307,6 +1395,9 @@ export DISPLAY=:10.0 + Be sure to not destroy the connection during your QEMU + session (i.e. do not + exit out of or close that shell). Select "Debug Configurations..." from the @@ -1317,47 +1408,83 @@ Locate your project and select it to bring up a new tabbed view in the Debug Configurations Dialog. - Enter the absolute path into which you want - to deploy the application. - Use the "Remote Absolute File Path for - C/C++Application:" field. - For example, enter - /usr/bin/programname. - Click on the "Debugger" tab to see the - cross-tool debugger you are using. - Click on the "Main" tab. + cross-tool debugger you are using. + Be sure to change to the debugger perspective in Eclipse. + + Click on the "Main" tab. + Create a new connection to the QEMU instance by clicking on "new". - Select TCF, which means - Target Communication Framework. - Click "Next". - Clear out the "host name" field and enter - the IP Address determined earlier. + Select SSH, which means + Secure Socket Shell and then click "OK". + Optionally, you can select an TCF connection instead. + + Clear out the "Connection name" field and enter + the IP Address determined earlier (e.g. 192.168.7.2). + + Put the IP address for the connection in + "Host" field. + + Provide root for the + "User" field. + Click "Finish" to close the - New Connections Dialog. - Use the drop-down menu now in the + New Connections Dialog. + + If necessary, use the drop-down menu now in the "Connection" field and pick the IP Address you entered. - Click "Debug" to bring up a login screen - and login. + Assuming you are connecting as the root + user, which is the default for QEMU x86-64 SDK images + provided by the Yocto Project, in the "Remote Absolute + File Path for C/C++ Application" field, browse to + /home/root/ProjectName + (e.g. /home/root/hello). + You could also browse to any other path you have write + access to on the target such as + /usr/bin. + This location is where your application will be located + on the QEMU system. + If you fail to browse to and specify an appropriate + location, QEMU will not understand what to remotely + launch. + Eclipse is helpful in that it auto fills your + application name for you assuming you browsed to a + directory. + + If you are prompted to provide a username and to + optionally set a password, be sure you provide + "root" as the username and you leave the password + field blank. + + + + Be sure you change to the "Debug" perspective in + Eclipse. + + Click "Debug" + Accept the debug perspective.
-
- Running Performance Tools +
+ Using Linuxtools + + + As mentioned earlier in the manual, performance tools exist + (Linuxtools) that enhance your development experience. + These tools are aids in developing and debugging applications and + images. + You can run these tools from within the Eclipse IDE through the + "Linuxtools" menu. + - As mentioned earlier in the manual, several tools exist that - enhance your development experience. - These tools are aids in developing and debugging applications - and images. - You can run these tools from within the Eclipse - IDE through the "YoctoProjectTools" menu. - For more information on these tools, see + For information on how to configure and use these tools, see http://www.eclipse.org/linuxtools/.
-- cgit v1.2.3-54-g00ecf