diff options
author | Scott Rifenbark <srifenbark@gmail.com> | 2016-03-09 13:30:27 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-23 21:56:08 +0000 |
commit | 4c5157f7dcfecab3b4e4483cd122e0ae74b377ee (patch) | |
tree | 03c0812d79db78ebfd454b540338b66e2dc20521 /documentation/dev-manual/dev-manual-model.xml | |
parent | 4306f7f97a2ea05ebf141947294729584795d832 (diff) | |
download | poky-4c5157f7dcfecab3b4e4483cd122e0ae74b377ee.tar.gz |
ref-manual: Resolving a conflict
(From yocto-docs rev: b364516928d04da38ef3188f07f190ffac64762b)
Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/dev-manual-model.xml')
-rw-r--r-- | documentation/dev-manual/dev-manual-model.xml | 1168 |
1 files changed, 12 insertions, 1156 deletions
diff --git a/documentation/dev-manual/dev-manual-model.xml b/documentation/dev-manual/dev-manual-model.xml index 489547dae6..4fb1e61559 100644 --- a/documentation/dev-manual/dev-manual-model.xml +++ b/documentation/dev-manual/dev-manual-model.xml | |||
@@ -27,11 +27,10 @@ | |||
27 | that you intend to run on target hardware. | 27 | that you intend to run on target hardware. |
28 | For information on how to set up your host development system for | 28 | For information on how to set up your host development system for |
29 | user-space application development, see the | 29 | user-space application development, see the |
30 | <ulink url='&YOCTO_DOCS_ADT_URL;'>Yocto Project Application Developer's Guide</ulink>. | 30 | <ulink url='&YOCTO_DOCS_SDK_URL;'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>. |
31 | For a simple example of user-space application development using | 31 | For a simple example of user-space application development using |
32 | the <trademark class='trade'>Eclipse</trademark> IDE, see the | 32 | the <trademark class='trade'>Eclipse</trademark> IDE, see the |
33 | "<link linkend='application-development-workflow'>Application | 33 | "<ulink url='&YOCTO_DOCS_SDK_URL;#sdk-developing-applications-using-eclipse'>Developing Applications Using <trademark class='trade'>Eclipse</trademark></ulink>" section. |
34 | Development Workflow</link>" section. | ||
35 | </para></listitem> | 34 | </para></listitem> |
36 | <listitem><para><emphasis>Temporary Source Code Modification:</emphasis> | 35 | <listitem><para><emphasis>Temporary Source Code Modification:</emphasis> |
37 | Direct modification of temporary source code is a convenient | 36 | Direct modification of temporary source code is a convenient |
@@ -529,1161 +528,18 @@ | |||
529 | </section> | 528 | </section> |
530 | </section> | 529 | </section> |
531 | 530 | ||
532 | <section id='application-development-workflow'> | 531 | <section id='application-development-workflow-using-an-sdk'> |
533 | <title>Application Development Workflow</title> | 532 | <title>Application Development Workflow Using an SDK</title> |
534 | 533 | ||
535 | <para> | 534 | <para> |
536 | Application development involves creating an application that you want | 535 | Standard and extensible Software Development Kits (SDK) make it easy |
537 | to run on your target hardware, which is running a kernel image created using the | 536 | to develop applications inside or outside of the Yocto Project |
538 | OpenEmbedded build system. | 537 | development environment. |
539 | The Yocto Project provides an | 538 | Tools exist to help the application developer during any phase |
540 | <ulink url='&YOCTO_DOCS_ADT_URL;#adt-intro'>Application Development Toolkit (ADT)</ulink> | 539 | of development. |
541 | and stand-alone | 540 | For information on how to install and use an SDK, see the |
542 | <ulink url='&YOCTO_DOCS_ADT_URL;#the-cross-development-toolchain'>cross-development toolchains</ulink> | 541 | <ulink url='&YOCTO_DOCS_SDK_URL;#sdk-manual'>Yocto Project Software Development Kit (SDK) Developer's Guide</ulink>. |
543 | that facilitate quick development and integration of your application into its runtime environment. | ||
544 | Using the ADT and toolchains, you can compile and link your application. | ||
545 | You can then deploy your application to the actual hardware or to the QEMU emulator for testing. | ||
546 | If you are familiar with the popular <trademark class='trade'>Eclipse</trademark> IDE, | ||
547 | you can use an Eclipse Yocto Plug-in to | ||
548 | allow you to develop, deploy, and test your application all from within Eclipse. | ||
549 | </para> | ||
550 | |||
551 | <para> | ||
552 | While we strongly suggest using the ADT to develop your application, this option might not | ||
553 | be best for you. | ||
554 | If this is the case, you can still use pieces of the Yocto Project for your development process. | ||
555 | However, because the process can vary greatly, this manual does not provide detail on the process. | ||
556 | </para> | 542 | </para> |
557 | |||
558 | <section id='workflow-using-the-adt-and-eclipse'> | ||
559 | <title>Workflow Using the ADT and <trademark class='trade'>Eclipse</trademark></title> | ||
560 | |||
561 | <para> | ||
562 | To help you understand how application development works using the ADT, this section | ||
563 | provides an overview of the general development process and a detailed example of the process | ||
564 | as it is used from within the Eclipse IDE. | ||
565 | </para> | ||
566 | |||
567 | <para> | ||
568 | The following illustration and list summarize the application development general workflow. | ||
569 | </para> | ||
570 | |||
571 | <para> | ||
572 | <imagedata fileref="figures/app-dev-flow.png" | ||
573 | width="7in" depth="8in" align="center" scale="100" /> | ||
574 | </para> | ||
575 | |||
576 | <para> | ||
577 | <orderedlist> | ||
578 | <listitem><para><emphasis>Prepare the host system for the Yocto Project</emphasis>: | ||
579 | See | ||
580 | "<ulink url='&YOCTO_DOCS_REF_URL;#detailed-supported-distros'>Supported Linux Distributions</ulink>" | ||
581 | and | ||
582 | "<ulink url='&YOCTO_DOCS_REF_URL;#required-packages-for-the-host-development-system'>Required Packages for the Host Development System</ulink>" sections both | ||
583 | in the Yocto Project Reference Manual for requirements. | ||
584 | In particular, be sure your host system has the | ||
585 | <filename>xterm</filename> package installed. | ||
586 | </para></listitem> | ||
587 | <listitem><para><emphasis>Secure the Yocto Project kernel target image</emphasis>: | ||
588 | You must have a target kernel image that has been built using the OpenEmbedded | ||
589 | build system.</para> | ||
590 | <para>Depending on whether the Yocto Project has a pre-built image that matches your target | ||
591 | architecture and where you are going to run the image while you develop your application | ||
592 | (QEMU or real hardware), the area from which you get the image differs. | ||
593 | <itemizedlist> | ||
594 | <listitem><para>Download the image from | ||
595 | <ulink url='&YOCTO_MACHINES_DL_URL;'><filename>machines</filename></ulink> | ||
596 | if your target architecture is supported and you are going to develop | ||
597 | and test your application on actual hardware.</para></listitem> | ||
598 | <listitem><para>Download the image from | ||
599 | <ulink url='&YOCTO_QEMU_DL_URL;'> | ||
600 | <filename>machines/qemu</filename></ulink> if your target architecture is supported | ||
601 | and you are going to develop and test your application using the QEMU | ||
602 | emulator.</para></listitem> | ||
603 | <listitem><para>Build your image if you cannot find a pre-built image that matches | ||
604 | your target architecture. | ||
605 | If your target architecture is similar to a supported architecture, you can | ||
606 | modify the kernel image before you build it. | ||
607 | See the | ||
608 | "<link linkend='patching-the-kernel'>Patching the Kernel</link>" | ||
609 | section for an example.</para></listitem> | ||
610 | </itemizedlist></para> | ||
611 | <para>For information on pre-built kernel image naming schemes for images | ||
612 | that can run on the QEMU emulator, see the | ||
613 | "<ulink url='&YOCTO_DOCS_QS_URL;#downloading-the-pre-built-linux-kernel'>Downloading the Pre-Built Linux Kernel</ulink>" | ||
614 | section in the Yocto Project Application Developer's Guide.</para></listitem> | ||
615 | <listitem><para><emphasis>Install the ADT</emphasis>: | ||
616 | The ADT provides a target-specific cross-development toolchain, the root filesystem, | ||
617 | the QEMU emulator, and other tools that can help you develop your application. | ||
618 | While it is possible to get these pieces separately, the ADT Installer provides an | ||
619 | easy, inclusive method. | ||
620 | You can get these pieces by running an ADT installer script, which is configurable. | ||
621 | For information on how to install the ADT, see the | ||
622 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Using the ADT Installer</ulink>" | ||
623 | section | ||
624 | in the Yocto Project Application Developer's Guide.</para></listitem> | ||
625 | <listitem><para><emphasis>If applicable, secure the target root filesystem | ||
626 | and the Cross-development toolchain</emphasis>: | ||
627 | If you choose not to install the ADT using the ADT Installer, | ||
628 | you need to find and download the appropriate root filesystem and | ||
629 | the cross-development toolchain.</para> | ||
630 | <para>You can find the tarballs for the root filesystem in the same area used | ||
631 | for the kernel image. | ||
632 | Depending on the type of image you are running, the root filesystem you need differs. | ||
633 | For example, if you are developing an application that runs on an image that | ||
634 | supports Sato, you need to get a root filesystem that supports Sato.</para> | ||
635 | <para>You can find the cross-development toolchains at | ||
636 | <ulink url='&YOCTO_TOOLCHAIN_DL_URL;'><filename>toolchains</filename></ulink>. | ||
637 | Be sure to get the correct toolchain for your development host and your | ||
638 | target architecture. | ||
639 | See the "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" | ||
640 | section in the Yocto Project Application Developer's Guide for information | ||
641 | and the | ||
642 | "<ulink url='&YOCTO_DOCS_QS_URL;#installing-the-toolchain'>Installing the Toolchain</ulink>" | ||
643 | in the Yocto Project Application Developer's Guide for information on finding and installing | ||
644 | the correct toolchain based on your host development system and your target | ||
645 | architecture. | ||
646 | </para></listitem> | ||
647 | <listitem><para><emphasis>Create and build your application</emphasis>: | ||
648 | At this point, you need to have source files for your application. | ||
649 | Once you have the files, you can use the Eclipse IDE to import them and build the | ||
650 | project. | ||
651 | If you are not using Eclipse, you need to use the cross-development tools you have | ||
652 | installed to create the image.</para></listitem> | ||
653 | <listitem><para><emphasis>Deploy the image with the application</emphasis>: | ||
654 | If you are using the Eclipse IDE, you can deploy your image to the hardware or to | ||
655 | QEMU through the project's preferences. | ||
656 | If you are not using the Eclipse IDE, then you need to deploy the application | ||
657 | to the hardware using other methods. | ||
658 | Or, if you are using QEMU, you need to use that tool and | ||
659 | load your image in for testing. | ||
660 | See the | ||
661 | "<link linkend='dev-manual-qemu'>Using the Quick EMUlator (QEMU)</link>" | ||
662 | chapter for information on using QEMU. | ||
663 | </para></listitem> | ||
664 | <listitem><para><emphasis>Test and debug the application</emphasis>: | ||
665 | Once your application is deployed, you need to test it. | ||
666 | Within the Eclipse IDE, you can use the debugging environment along with the | ||
667 | set of user-space tools installed along with the ADT to debug your application. | ||
668 | Of course, the same user-space tools are available separately if you choose | ||
669 | not to use the Eclipse IDE.</para></listitem> | ||
670 | </orderedlist> | ||
671 | </para> | ||
672 | </section> | ||
673 | |||
674 | <section id='adt-eclipse'> | ||
675 | <title>Working Within Eclipse</title> | ||
676 | |||
677 | <para> | ||
678 | The Eclipse IDE is a popular development environment and it fully | ||
679 | supports development using the Yocto Project. | ||
680 | <note> | ||
681 | This release of the Yocto Project supports both the Luna | ||
682 | and Kepler versions of the Eclipse IDE. | ||
683 | Thus, the following information provides setup information for | ||
684 | both versions. | ||
685 | </note> | ||
686 | </para> | ||
687 | |||
688 | <para> | ||
689 | When you install and configure the Eclipse Yocto Project Plug-in | ||
690 | into the Eclipse IDE, you maximize your Yocto Project experience. | ||
691 | Installing and configuring the Plug-in results in an environment | ||
692 | that has extensions specifically designed to let you more easily | ||
693 | develop software. | ||
694 | These extensions allow for cross-compilation, deployment, and | ||
695 | execution of your output into a QEMU emulation session as well as | ||
696 | actual target hardware. | ||
697 | You can also perform cross-debugging and profiling. | ||
698 | The environment also supports a suite of tools that allows you | ||
699 | to perform remote profiling, tracing, collection of power data, | ||
700 | collection of latency data, and collection of performance data. | ||
701 | </para> | ||
702 | |||
703 | <para> | ||
704 | This section describes how to install and configure the Eclipse IDE | ||
705 | Yocto Plug-in and how to use it to develop your application. | ||
706 | </para> | ||
707 | |||
708 | <section id='setting-up-the-eclipse-ide'> | ||
709 | <title>Setting Up the Eclipse IDE</title> | ||
710 | |||
711 | <para> | ||
712 | To develop within the Eclipse IDE, you need to do the following: | ||
713 | <orderedlist> | ||
714 | <listitem><para>Install the optimal version of the Eclipse | ||
715 | IDE.</para></listitem> | ||
716 | <listitem><para>Configure the Eclipse IDE. | ||
717 | </para></listitem> | ||
718 | <listitem><para>Install the Eclipse Yocto Plug-in. | ||
719 | </para></listitem> | ||
720 | <listitem><para>Configure the Eclipse Yocto Plug-in. | ||
721 | </para></listitem> | ||
722 | </orderedlist> | ||
723 | <note> | ||
724 | Do not install Eclipse from your distribution's package | ||
725 | repository. | ||
726 | Be sure to install Eclipse from the official Eclipse | ||
727 | download site as directed in the next section. | ||
728 | </note> | ||
729 | </para> | ||
730 | |||
731 | <section id='installing-eclipse-ide'> | ||
732 | <title>Installing the Eclipse IDE</title> | ||
733 | |||
734 | <para> | ||
735 | It is recommended that you have the Luna SR2 (4.4.2) | ||
736 | version of the Eclipse IDE installed on your development | ||
737 | system. | ||
738 | However, if you currently have the Kepler 4.3.2 version | ||
739 | installed and you do not want to upgrade the IDE, you can | ||
740 | configure Kepler to work with the Yocto Project. | ||
741 | </para> | ||
742 | |||
743 | <para> | ||
744 | If you do not have the Luna SR2 (4.4.2) Eclipse IDE | ||
745 | installed, you can find the tarball at | ||
746 | <ulink url='&ECLIPSE_MAIN_URL;'></ulink>. | ||
747 | From that site, choose the appropriate download from the | ||
748 | "Eclipse IDE for C/C++ Developers". | ||
749 | This version contains the Eclipse Platform, the Java | ||
750 | Development Tools (JDT), and the Plug-in Development | ||
751 | Environment. | ||
752 | </para> | ||
753 | |||
754 | <para> | ||
755 | Once you have downloaded the tarball, extract it into a | ||
756 | clean directory. | ||
757 | For example, the following commands unpack and install the | ||
758 | downloaded Eclipse IDE tarball into a clean directory | ||
759 | using the default name <filename>eclipse</filename>: | ||
760 | <literallayout class='monospaced'> | ||
761 | $ cd ~ | ||
762 | $ tar -xzvf ~/Downloads/eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz | ||
763 | </literallayout> | ||
764 | </para> | ||
765 | </section> | ||
766 | |||
767 | <section id='configuring-the-eclipse-ide'> | ||
768 | <title>Configuring the Eclipse IDE</title> | ||
769 | |||
770 | <para> | ||
771 | This section presents the steps needed to configure the | ||
772 | Eclipse IDE. | ||
773 | </para> | ||
774 | |||
775 | <para> | ||
776 | Before installing and configuring the Eclipse Yocto Plug-in, | ||
777 | you need to configure the Eclipse IDE. | ||
778 | Follow these general steps: | ||
779 | <orderedlist> | ||
780 | <listitem><para>Start the Eclipse IDE.</para></listitem> | ||
781 | <listitem><para>Make sure you are in your Workbench and | ||
782 | select "Install New Software" from the "Help" | ||
783 | pull-down menu.</para></listitem> | ||
784 | <listitem><para>Select | ||
785 | <filename>Luna - &ECLIPSE_LUNA_URL;</filename> | ||
786 | from the "Work with:" pull-down menu. | ||
787 | <note> | ||
788 | For Kepler, select | ||
789 | <filename>Kepler - &ECLIPSE_KEPLER_URL;</filename> | ||
790 | </note> | ||
791 | </para></listitem> | ||
792 | <listitem><para>Expand the box next to "Linux Tools" | ||
793 | and select the | ||
794 | <filename>Linux Tools LTTng Tracer Control</filename>, | ||
795 | <filename>Linux Tools LTTng Userspace Analysis</filename>, | ||
796 | and | ||
797 | <filename>LTTng Kernel Analysis</filename> boxes. | ||
798 | If these selections do not appear in the list, | ||
799 | that means the items are already installed. | ||
800 | <note> | ||
801 | For Kepler, select | ||
802 | <filename>LTTng - Linux Tracing Toolkit</filename> | ||
803 | box. | ||
804 | </note> | ||
805 | </para></listitem> | ||
806 | <listitem><para>Expand the box next to "Mobile and | ||
807 | Device Development" and select the following boxes. | ||
808 | Again, if any of the following items are not | ||
809 | available for selection, that means the items are | ||
810 | already installed: | ||
811 | <itemizedlist> | ||
812 | <listitem><para><filename>C/C++ Remote Launch (Requires RSE Remote System Explorer)</filename></para></listitem> | ||
813 | <listitem><para><filename>Remote System Explorer End-user Runtime</filename></para></listitem> | ||
814 | <listitem><para><filename>Remote System Explorer User Actions</filename></para></listitem> | ||
815 | <listitem><para><filename>Target Management Terminal (Core SDK)</filename></para></listitem> | ||
816 | <listitem><para><filename>TCF Remote System Explorer add-in</filename></para></listitem> | ||
817 | <listitem><para><filename>TCF Target Explorer</filename></para></listitem> | ||
818 | </itemizedlist></para></listitem> | ||
819 | <listitem><para>Expand the box next to "Programming | ||
820 | Languages" and select the | ||
821 | <filename>C/C++ Autotools Support</filename> | ||
822 | and <filename>C/C++ Development Tools</filename> | ||
823 | boxes. | ||
824 | For Luna, these items do not appear on the list | ||
825 | as they are already installed. | ||
826 | </para></listitem> | ||
827 | <listitem><para>Complete the installation and restart | ||
828 | the Eclipse IDE.</para></listitem> | ||
829 | </orderedlist> | ||
830 | </para> | ||
831 | </section> | ||
832 | |||
833 | <section id='installing-the-eclipse-yocto-plug-in'> | ||
834 | <title>Installing or Accessing the Eclipse Yocto Plug-in</title> | ||
835 | |||
836 | <para> | ||
837 | You can install the Eclipse Yocto Plug-in into the Eclipse | ||
838 | IDE one of two ways: use the Yocto Project's Eclipse | ||
839 | Update site to install the pre-built plug-in or build and | ||
840 | install the plug-in from the latest source code. | ||
841 | </para> | ||
842 | |||
843 | <section id='new-software'> | ||
844 | <title>Installing the Pre-built Plug-in from the Yocto Project Eclipse Update Site</title> | ||
845 | |||
846 | <para> | ||
847 | To install the Eclipse Yocto Plug-in from the update | ||
848 | site, follow these steps: | ||
849 | <orderedlist> | ||
850 | <listitem><para>Start up the Eclipse IDE. | ||
851 | </para></listitem> | ||
852 | <listitem><para>In Eclipse, select "Install New | ||
853 | Software" from the "Help" menu. | ||
854 | </para></listitem> | ||
855 | <listitem><para>Click "Add..." in the "Work with:" | ||
856 | area.</para></listitem> | ||
857 | <listitem><para>Enter | ||
858 | <filename>&ECLIPSE_DL_PLUGIN_URL;/luna</filename> | ||
859 | in the URL field and provide a meaningful name | ||
860 | in the "Name" field. | ||
861 | <note> | ||
862 | If you are using Kepler, use | ||
863 | <filename>&ECLIPSE_DL_PLUGIN_URL;/kepler</filename> | ||
864 | in the URL field. | ||
865 | </note></para></listitem> | ||
866 | <listitem><para>Click "OK" to have the entry added | ||
867 | to the "Work with:" drop-down list. | ||
868 | </para></listitem> | ||
869 | <listitem><para>Select the entry for the plug-in | ||
870 | from the "Work with:" drop-down list. | ||
871 | </para></listitem> | ||
872 | <listitem><para>Check the boxes next to | ||
873 | <filename>Yocto Project ADT Plug-in</filename>, | ||
874 | <filename>Yocto Project Bitbake Commander Plug-in</filename>, | ||
875 | and | ||
876 | <filename>Yocto Project Documentation plug-in</filename>. | ||
877 | </para></listitem> | ||
878 | <listitem><para>Complete the remaining software | ||
879 | installation steps and then restart the Eclipse | ||
880 | IDE to finish the installation of the plug-in. | ||
881 | <note> | ||
882 | You can click "OK" when prompted about | ||
883 | installing software that contains unsigned | ||
884 | content. | ||
885 | </note> | ||
886 | </para></listitem> | ||
887 | </orderedlist> | ||
888 | </para> | ||
889 | </section> | ||
890 | |||
891 | <section id='zip-file-method'> | ||
892 | <title>Installing the Plug-in Using the Latest Source Code</title> | ||
893 | |||
894 | <para> | ||
895 | To install the Eclipse Yocto Plug-in from the latest | ||
896 | source code, follow these steps: | ||
897 | <orderedlist> | ||
898 | <listitem><para>Be sure your development system | ||
899 | is not using OpenJDK to build the plug-in | ||
900 | by doing the following: | ||
901 | <orderedlist> | ||
902 | <listitem><para>Use the Oracle JDK. | ||
903 | If you don't have that, go to | ||
904 | <ulink url='http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html'></ulink> | ||
905 | and download the latest appropriate | ||
906 | Java SE Development Kit tarball for | ||
907 | your development system and | ||
908 | extract it into your home directory. | ||
909 | </para></listitem> | ||
910 | <listitem><para>In the shell you are going | ||
911 | to do your work, export the location of | ||
912 | the Oracle Java. | ||
913 | The previous step creates a new folder | ||
914 | for the extracted software. | ||
915 | You need to use the following | ||
916 | <filename>export</filename> command | ||
917 | and provide the specific location: | ||
918 | <literallayout class='monospaced'> | ||
919 | export PATH=~/<replaceable>extracted_jdk_location</replaceable>/bin:$PATH | ||
920 | </literallayout> | ||
921 | </para></listitem> | ||
922 | </orderedlist> | ||
923 | </para></listitem> | ||
924 | <listitem><para>In the same shell, create a Git | ||
925 | repository with: | ||
926 | <literallayout class='monospaced'> | ||
927 | $ cd ~ | ||
928 | $ git clone git://git.yoctoproject.org/eclipse-poky | ||
929 | </literallayout> | ||
930 | </para></listitem> | ||
931 | <listitem><para>Be sure to checkout the correct | ||
932 | tag. | ||
933 | For example, if you are using Luna, do the | ||
934 | following: | ||
935 | <literallayout class='monospaced'> | ||
936 | $ git checkout luna/yocto-&DISTRO; | ||
937 | </literallayout> | ||
938 | This puts you in a detached HEAD state, which | ||
939 | is fine since you are only going to be building | ||
940 | and not developing. | ||
941 | <note> | ||
942 | If you are building kepler, checkout the | ||
943 | <filename>kepler/yocto-&DISTRO;</filename> | ||
944 | branch. | ||
945 | </note> | ||
946 | </para></listitem> | ||
947 | <listitem><para>Change to the | ||
948 | <filename>scripts</filename> | ||
949 | directory within the Git repository: | ||
950 | <literallayout class='monospaced'> | ||
951 | $ cd scripts | ||
952 | </literallayout> | ||
953 | </para></listitem> | ||
954 | <listitem><para>Set up the local build environment | ||
955 | by running the setup script: | ||
956 | <literallayout class='monospaced'> | ||
957 | $ ./setup.sh | ||
958 | </literallayout> | ||
959 | </para></listitem> | ||
960 | <listitem><para>When the script finishes execution, | ||
961 | it prompts you with instructions on how to run | ||
962 | the <filename>build.sh</filename> script, which | ||
963 | is also in the <filename>scripts</filename> | ||
964 | directory of the Git repository created | ||
965 | earlier. | ||
966 | </para></listitem> | ||
967 | <listitem><para>Run the <filename>build.sh</filename> | ||
968 | script as directed. | ||
969 | Be sure to provide the tag name, documentation | ||
970 | branch, and a release name. | ||
971 | Here is an example that uses the | ||
972 | <filename>luna/yocto-&DISTRO;</filename> tag, the | ||
973 | <filename>master</filename> documentation | ||
974 | branch, and | ||
975 | <filename>&DISTRO_NAME;</filename> for the | ||
976 | release name: | ||
977 | <literallayout class='monospaced'> | ||
978 | $ ECLIPSE_HOME=/home/scottrif/eclipse-poky/scripts/eclipse ./build.sh luna/yocto-&DISTRO; master &DISTRO_NAME; 2>&1 | tee -a build.log | ||
979 | </literallayout> | ||
980 | After running the script, the file | ||
981 | <filename>org.yocto.sdk-</filename><replaceable>release</replaceable><filename>-</filename><replaceable>date</replaceable><filename>-archive.zip</filename> | ||
982 | is in the current directory. | ||
983 | </para></listitem> | ||
984 | <listitem><para>If necessary, start the Eclipse IDE | ||
985 | and be sure you are in the Workbench. | ||
986 | </para></listitem> | ||
987 | <listitem><para>Select "Install New Software" from | ||
988 | the "Help" pull-down menu. | ||
989 | </para></listitem> | ||
990 | <listitem><para>Click "Add".</para></listitem> | ||
991 | <listitem><para>Provide anything you want in the | ||
992 | "Name" field. | ||
993 | </para></listitem> | ||
994 | <listitem><para>Click "Archive" and browse to the | ||
995 | ZIP file you built in step eight. | ||
996 | This ZIP file should not be "unzipped", and must | ||
997 | be the <filename>*archive.zip</filename> file | ||
998 | created by running the | ||
999 | <filename>build.sh</filename> script. | ||
1000 | </para></listitem> | ||
1001 | <listitem><para>Click the "OK" button. | ||
1002 | </para></listitem> | ||
1003 | <listitem><para>Check the boxes that appear in | ||
1004 | the installation window to install the | ||
1005 | <filename>Yocto Project ADT Plug-in</filename>, | ||
1006 | <filename>Yocto Project Bitbake Commander Plug-in</filename>, | ||
1007 | and the | ||
1008 | <filename>Yocto Project Documentation plug-in</filename>. | ||
1009 | </para></listitem> | ||
1010 | <listitem><para>Finish the installation by clicking | ||
1011 | through the appropriate buttons. | ||
1012 | You can click "OK" when prompted about | ||
1013 | installing software that contains unsigned | ||
1014 | content. | ||
1015 | </para></listitem> | ||
1016 | <listitem><para>Restart the Eclipse IDE if | ||
1017 | necessary. | ||
1018 | </para></listitem> | ||
1019 | </orderedlist> | ||
1020 | </para> | ||
1021 | |||
1022 | <para> | ||
1023 | At this point you should be able to configure the | ||
1024 | Eclipse Yocto Plug-in as described in the | ||
1025 | "<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>" | ||
1026 | section.</para> | ||
1027 | </section> | ||
1028 | </section> | ||
1029 | |||
1030 | <section id='configuring-the-eclipse-yocto-plug-in'> | ||
1031 | <title>Configuring the Eclipse Yocto Plug-in</title> | ||
1032 | |||
1033 | <para> | ||
1034 | Configuring the Eclipse Yocto Plug-in involves setting the | ||
1035 | Cross Compiler options and the Target options. | ||
1036 | The configurations you choose become the default settings | ||
1037 | for all projects. | ||
1038 | You do have opportunities to change them later when | ||
1039 | you configure the project (see the following section). | ||
1040 | </para> | ||
1041 | |||
1042 | <para> | ||
1043 | To start, you need to do the following from within the | ||
1044 | Eclipse IDE: | ||
1045 | <itemizedlist> | ||
1046 | <listitem><para>Choose "Preferences" from the | ||
1047 | "Window" menu to display the Preferences Dialog. | ||
1048 | </para></listitem> | ||
1049 | <listitem><para>Click "Yocto Project ADT" to display | ||
1050 | the configuration screen. | ||
1051 | </para></listitem> | ||
1052 | </itemizedlist> | ||
1053 | </para> | ||
1054 | |||
1055 | <section id='configuring-the-cross-compiler-options'> | ||
1056 | <title>Configuring the Cross-Compiler Options</title> | ||
1057 | |||
1058 | <para> | ||
1059 | To configure the Cross Compiler Options, you must select | ||
1060 | the type of toolchain, point to the toolchain, specify | ||
1061 | the sysroot location, and select the target | ||
1062 | architecture. | ||
1063 | <itemizedlist> | ||
1064 | <listitem><para><emphasis>Selecting the Toolchain Type:</emphasis> | ||
1065 | Choose between | ||
1066 | <filename>Standalone pre-built toolchain</filename> | ||
1067 | and | ||
1068 | <filename>Build system derived toolchain</filename> | ||
1069 | for Cross Compiler Options. | ||
1070 | <itemizedlist> | ||
1071 | <listitem><para><emphasis> | ||
1072 | <filename>Standalone Pre-built Toolchain:</filename></emphasis> | ||
1073 | Select this mode when you are using | ||
1074 | a stand-alone cross-toolchain. | ||
1075 | For example, suppose you are an | ||
1076 | application developer and do not | ||
1077 | need to build a target image. | ||
1078 | Instead, you just want to use an | ||
1079 | architecture-specific toolchain on | ||
1080 | an existing kernel and target root | ||
1081 | filesystem.</para></listitem> | ||
1082 | <listitem><para><emphasis> | ||
1083 | <filename>Build System Derived Toolchain:</filename></emphasis> | ||
1084 | Select this mode if the | ||
1085 | cross-toolchain has been installed | ||
1086 | and built as part of the | ||
1087 | <link linkend='build-directory'>Build Directory</link>. | ||
1088 | When you select | ||
1089 | <filename>Build system derived toolchain</filename>, | ||
1090 | you are using the toolchain bundled | ||
1091 | inside the Build Directory. | ||
1092 | </para></listitem> | ||
1093 | </itemizedlist> | ||
1094 | </para></listitem> | ||
1095 | <listitem><para><emphasis>Point to the Toolchain:</emphasis> | ||
1096 | If you are using a stand-alone pre-built | ||
1097 | toolchain, you should be pointing to where it is | ||
1098 | installed. | ||
1099 | If you used the ADT Installer script and | ||
1100 | accepted the default installation directory, the | ||
1101 | toolchain will be installed in the | ||
1102 | <filename>&YOCTO_ADTPATH_DIR;</filename> | ||
1103 | directory. | ||
1104 | Sections "<ulink url='&YOCTO_DOCS_ADT_URL;#configuring-and-running-the-adt-installer-script'>Configuring and Running the ADT Installer Script</ulink>" | ||
1105 | and | ||
1106 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" | ||
1107 | in the Yocto Project Application Developer's | ||
1108 | Guide describe how to install a stand-alone | ||
1109 | cross-toolchain.</para> | ||
1110 | <para>If you are using a system-derived | ||
1111 | toolchain, the path you provide for the | ||
1112 | <filename>Toolchain Root Location</filename> | ||
1113 | field is the | ||
1114 | <link linkend='build-directory'>Build Directory</link>. | ||
1115 | See the | ||
1116 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-toolchain-from-within-the-build-tree'>Using BitBake and the Build Directory</ulink>" | ||
1117 | section in the Yocto Project Application | ||
1118 | Developer's Guide for information on how to | ||
1119 | install the toolchain into the Build | ||
1120 | Directory.</para></listitem> | ||
1121 | <listitem><para><emphasis>Specify the Sysroot Location:</emphasis> | ||
1122 | This location is where the root filesystem for | ||
1123 | the target hardware resides. | ||
1124 | If you used the ADT Installer script and | ||
1125 | accepted the default installation directory, | ||
1126 | then the location in your home directory | ||
1127 | in a folder named | ||
1128 | <filename>test-yocto/</filename><replaceable>target_arch</replaceable>. | ||
1129 | Additionally, when you use the ADT Installer | ||
1130 | script, the | ||
1131 | <filename>/opt/poky/&DISTRO;/sysroots</filename> | ||
1132 | location is used for the QEMU | ||
1133 | user-space tools and the NFS boot process. | ||
1134 | </para> | ||
1135 | <para>If you used either of the other two | ||
1136 | methods to install the toolchain or did not | ||
1137 | accept the ADT Installer script's default | ||
1138 | installation directory, then the location of | ||
1139 | the sysroot filesystem depends on where you | ||
1140 | separately extracted and installed the | ||
1141 | filesystem.</para> | ||
1142 | <para>For information on how to install the | ||
1143 | toolchain and on how to extract and install the | ||
1144 | sysroot filesystem, see the | ||
1145 | "<ulink url='&YOCTO_DOCS_ADT_URL;#installing-the-adt'>Installing the ADT and Toolchains</ulink>" | ||
1146 | section in the Yocto Project Application | ||
1147 | Developer's Guide. | ||
1148 | </para></listitem> | ||
1149 | <listitem><para><emphasis>Select the Target Architecture:</emphasis> | ||
1150 | The target architecture is the type of hardware | ||
1151 | you are going to use or emulate. | ||
1152 | Use the pull-down | ||
1153 | <filename>Target Architecture</filename> menu | ||
1154 | to make your selection. | ||
1155 | The pull-down menu should have the supported | ||
1156 | architectures. | ||
1157 | If the architecture you need is not listed in | ||
1158 | the menu, you will need to build the image. | ||
1159 | See the | ||
1160 | "<ulink url='&YOCTO_DOCS_QS_URL;#qs-building-images'>Building Images</ulink>" | ||
1161 | section of the Yocto Project Quick Start for | ||
1162 | more information.</para></listitem> | ||
1163 | </itemizedlist> | ||
1164 | </para> | ||
1165 | </section> | ||
1166 | |||
1167 | <section id='configuring-the-target-options'> | ||
1168 | <title>Configuring the Target Options</title> | ||
1169 | |||
1170 | <para> | ||
1171 | You can choose to emulate hardware using the QEMU | ||
1172 | emulator, or you can choose to run your image on actual | ||
1173 | hardware. | ||
1174 | <itemizedlist> | ||
1175 | <listitem><para><emphasis>QEMU:</emphasis> | ||
1176 | Select this option if you will be using the | ||
1177 | QEMU emulator. | ||
1178 | If you are using the emulator, you also need to | ||
1179 | locate the kernel and specify any custom | ||
1180 | options.</para> | ||
1181 | <para>If you selected | ||
1182 | <filename>Build system derived toolchain</filename>, | ||
1183 | the target kernel you built will be located in | ||
1184 | the Build Directory in | ||
1185 | <filename>tmp/deploy/images/<replaceable>machine</replaceable></filename> | ||
1186 | directory. | ||
1187 | If you selected | ||
1188 | <filename>Standalone pre-built toolchain</filename>, | ||
1189 | the pre-built image you downloaded is located | ||
1190 | in the directory you specified when you | ||
1191 | downloaded the image.</para> | ||
1192 | <para>Most custom options are for advanced QEMU | ||
1193 | users to further customize their QEMU instance. | ||
1194 | These options are specified between paired | ||
1195 | angled brackets. | ||
1196 | Some options must be specified outside the | ||
1197 | brackets. | ||
1198 | In particular, the options | ||
1199 | <filename>serial</filename>, | ||
1200 | <filename>nographic</filename>, and | ||
1201 | <filename>kvm</filename> must all be outside the | ||
1202 | brackets. | ||
1203 | Use the <filename>man qemu</filename> command | ||
1204 | to get help on all the options and their use. | ||
1205 | The following is an example: | ||
1206 | <literallayout class='monospaced'> | ||
1207 | serial ‘<-m 256 -full-screen>’ | ||
1208 | </literallayout></para> | ||
1209 | <para> | ||
1210 | Regardless of the mode, Sysroot is already | ||
1211 | defined as part of the Cross-Compiler Options | ||
1212 | configuration in the | ||
1213 | <filename>Sysroot Location:</filename> field. | ||
1214 | </para></listitem> | ||
1215 | <listitem><para><emphasis>External HW:</emphasis> | ||
1216 | Select this option if you will be using actual | ||
1217 | hardware.</para></listitem> | ||
1218 | </itemizedlist> | ||
1219 | </para> | ||
1220 | |||
1221 | <para> | ||
1222 | Click the "OK" to save your plug-in configurations. | ||
1223 | </para> | ||
1224 | </section> | ||
1225 | </section> | ||
1226 | </section> | ||
1227 | |||
1228 | <section id='creating-the-project'> | ||
1229 | <title>Creating the Project</title> | ||
1230 | |||
1231 | <para> | ||
1232 | You can create two types of projects: Autotools-based, or | ||
1233 | Makefile-based. | ||
1234 | This section describes how to create Autotools-based projects | ||
1235 | from within the Eclipse IDE. | ||
1236 | For information on creating Makefile-based projects in a | ||
1237 | terminal window, see the section | ||
1238 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-command-line'>Using the Command Line</ulink>" | ||
1239 | in the Yocto Project Application Developer's Guide. | ||
1240 | <note> | ||
1241 | Do not use special characters in project names | ||
1242 | (e.g. spaces, underscores, etc.). Doing so can | ||
1243 | cause configuration to fail. | ||
1244 | </note> | ||
1245 | </para> | ||
1246 | |||
1247 | <para> | ||
1248 | To create a project based on a Yocto template and then display | ||
1249 | the source code, follow these steps: | ||
1250 | <orderedlist> | ||
1251 | <listitem><para>Select "Project" from the "File -> New" menu. | ||
1252 | </para></listitem> | ||
1253 | <listitem><para>Double click <filename>CC++</filename>. | ||
1254 | </para></listitem> | ||
1255 | <listitem><para>Double click <filename>C Project</filename> | ||
1256 | to create the project.</para></listitem> | ||
1257 | <listitem><para>Expand <filename>Yocto Project ADT Autotools Project</filename>. | ||
1258 | </para></listitem> | ||
1259 | <listitem><para>Select <filename>Hello World ANSI C Autotools Project</filename>. | ||
1260 | This is an Autotools-based project based on a Yocto | ||
1261 | template.</para></listitem> | ||
1262 | <listitem><para>Put a name in the <filename>Project name:</filename> | ||
1263 | field. | ||
1264 | Do not use hyphens as part of the name. | ||
1265 | </para></listitem> | ||
1266 | <listitem><para>Click "Next".</para></listitem> | ||
1267 | <listitem><para>Add information in the | ||
1268 | <filename>Author</filename> and | ||
1269 | <filename>Copyright notice</filename> fields. | ||
1270 | </para></listitem> | ||
1271 | <listitem><para>Be sure the <filename>License</filename> | ||
1272 | field is correct.</para></listitem> | ||
1273 | <listitem><para>Click "Finish".</para></listitem> | ||
1274 | <listitem><para>If the "open perspective" prompt appears, | ||
1275 | click "Yes" so that you in the C/C++ perspective. | ||
1276 | </para></listitem> | ||
1277 | <listitem><para>The left-hand navigation pane shows your | ||
1278 | project. | ||
1279 | You can display your source by double clicking the | ||
1280 | project's source file.</para></listitem> | ||
1281 | </orderedlist> | ||
1282 | </para> | ||
1283 | </section> | ||
1284 | |||
1285 | <section id='configuring-the-cross-toolchains'> | ||
1286 | <title>Configuring the Cross-Toolchains</title> | ||
1287 | |||
1288 | <para> | ||
1289 | The earlier section, | ||
1290 | "<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>", | ||
1291 | sets up the default project configurations. | ||
1292 | You can override these settings for a given project by following | ||
1293 | these steps: | ||
1294 | <orderedlist> | ||
1295 | <listitem><para>Select "Change Yocto Project Settings" from | ||
1296 | the "Project" menu. | ||
1297 | This selection brings up the Yocto Project Settings | ||
1298 | Dialog and allows you to make changes specific to an | ||
1299 | individual project.</para> | ||
1300 | <para>By default, the Cross Compiler Options and Target | ||
1301 | Options for a project are inherited from settings you | ||
1302 | provided using the Preferences Dialog as described | ||
1303 | earlier in the | ||
1304 | "<link linkend='configuring-the-eclipse-yocto-plug-in'>Configuring the Eclipse Yocto Plug-in</link>" section. | ||
1305 | The Yocto Project Settings Dialog allows you to override | ||
1306 | those default settings for a given project. | ||
1307 | </para></listitem> | ||
1308 | <listitem><para>Make your configurations for the project | ||
1309 | and click "OK". | ||
1310 | </para></listitem> | ||
1311 | <listitem><para>Right-click in the navigation pane and | ||
1312 | select "Reconfigure Project" from the pop-up menu. | ||
1313 | This selection reconfigures the project by running | ||
1314 | <filename>autogen.sh</filename> in the workspace for | ||
1315 | your project. | ||
1316 | The script also runs <filename>libtoolize</filename>, | ||
1317 | <filename>aclocal</filename>, | ||
1318 | <filename>autoconf</filename>, | ||
1319 | <filename>autoheader</filename>, | ||
1320 | <filename>automake --a</filename>, and | ||
1321 | <filename>./configure</filename>. | ||
1322 | Click on the "Console" tab beneath your source code to | ||
1323 | see the results of reconfiguring your project. | ||
1324 | </para></listitem> | ||
1325 | </orderedlist> | ||
1326 | </para> | ||
1327 | </section> | ||
1328 | |||
1329 | <section id='building-the-project'> | ||
1330 | <title>Building the Project</title> | ||
1331 | |||
1332 | <para> | ||
1333 | To build the project select "Build Project" from the | ||
1334 | "Project" menu. | ||
1335 | The console should update and you can note the cross-compiler | ||
1336 | you are using. | ||
1337 | <note> | ||
1338 | When building "Yocto Project ADT Autotools" projects, the Eclipse | ||
1339 | IDE might display error messages for Functions/Symbols/Types | ||
1340 | that cannot be "resolved", even when the related include file | ||
1341 | is listed at the project navigator and when the project is | ||
1342 | able to build. | ||
1343 | For these cases only, it is recommended to add a new linked | ||
1344 | folder to the appropriate sysroot. | ||
1345 | Use these steps to add the linked folder: | ||
1346 | <orderedlist> | ||
1347 | <listitem><para> | ||
1348 | Select the project. | ||
1349 | </para></listitem> | ||
1350 | <listitem><para> | ||
1351 | Select "Folder" from the | ||
1352 | <filename>File > New</filename> menu. | ||
1353 | </para></listitem> | ||
1354 | <listitem><para> | ||
1355 | In the "New Folder" Dialog, select "Link to alternate | ||
1356 | location (linked folder)". | ||
1357 | </para></listitem> | ||
1358 | <listitem><para> | ||
1359 | Click "Browse" to navigate to the include folder inside | ||
1360 | the same sysroot location selected in the Yocto Project | ||
1361 | configuration preferences. | ||
1362 | </para></listitem> | ||
1363 | <listitem><para> | ||
1364 | Click "OK". | ||
1365 | </para></listitem> | ||
1366 | <listitem><para> | ||
1367 | Click "Finish" to save the linked folder. | ||
1368 | </para></listitem> | ||
1369 | </orderedlist> | ||
1370 | </note> | ||
1371 | </para> | ||
1372 | </section> | ||
1373 | |||
1374 | <section id='starting-qemu-in-user-space-nfs-mode'> | ||
1375 | <title>Starting QEMU in User-Space NFS Mode</title> | ||
1376 | |||
1377 | <para> | ||
1378 | To start the QEMU emulator from within Eclipse, follow these | ||
1379 | steps: | ||
1380 | <note> | ||
1381 | See the | ||
1382 | "<link linkend='dev-manual-qemu'>Using the Quick EMUlator (QEMU)</link>" | ||
1383 | chapter for more information on using QEMU. | ||
1384 | </note> | ||
1385 | <orderedlist> | ||
1386 | <listitem><para>Expose and select "External Tools" from | ||
1387 | the "Run" menu. | ||
1388 | Your image should appear as a selectable menu item. | ||
1389 | </para></listitem> | ||
1390 | <listitem><para>Select your image from the menu to launch | ||
1391 | the emulator in a new window. | ||
1392 | </para></listitem> | ||
1393 | <listitem><para>If needed, enter your host root password in | ||
1394 | the shell window at the prompt. | ||
1395 | This sets up a <filename>Tap 0</filename> connection | ||
1396 | needed for running in user-space NFS mode. | ||
1397 | </para></listitem> | ||
1398 | <listitem><para>Wait for QEMU to launch.</para></listitem> | ||
1399 | <listitem><para>Once QEMU launches, you can begin operating | ||
1400 | within that environment. | ||
1401 | One useful task at this point would be to determine the | ||
1402 | IP Address for the user-space NFS by using the | ||
1403 | <filename>ifconfig</filename> command. | ||
1404 | </para></listitem> | ||
1405 | </orderedlist> | ||
1406 | </para> | ||
1407 | </section> | ||
1408 | |||
1409 | <section id='deploying-and-debugging-the-application'> | ||
1410 | <title>Deploying and Debugging the Application</title> | ||
1411 | |||
1412 | <para> | ||
1413 | Once the QEMU emulator is running the image, you can deploy | ||
1414 | your application using the Eclipse IDE and then use | ||
1415 | the emulator to perform debugging. | ||
1416 | Follow these steps to deploy the application. | ||
1417 | <orderedlist> | ||
1418 | <listitem><para>Select "Debug Configurations..." from the | ||
1419 | "Run" menu.</para></listitem> | ||
1420 | <listitem><para>In the left area, expand | ||
1421 | <filename>C/C++Remote Application</filename>. | ||
1422 | </para></listitem> | ||
1423 | <listitem><para>Locate your project and select it to bring | ||
1424 | up a new tabbed view in the Debug Configurations Dialog. | ||
1425 | </para></listitem> | ||
1426 | <listitem><para>Enter the absolute path into which you want | ||
1427 | to deploy the application. | ||
1428 | Use the "Remote Absolute File Path for | ||
1429 | C/C++Application:" field. | ||
1430 | For example, enter | ||
1431 | <filename>/usr/bin/<replaceable>programname</replaceable></filename>. | ||
1432 | </para></listitem> | ||
1433 | <listitem><para>Click on the "Debugger" tab to see the | ||
1434 | cross-tool debugger you are using.</para></listitem> | ||
1435 | <listitem><para>Click on the "Main" tab.</para></listitem> | ||
1436 | <listitem><para>Create a new connection to the QEMU instance | ||
1437 | by clicking on "new".</para></listitem> | ||
1438 | <listitem><para>Select <filename>TCF</filename>, which means | ||
1439 | Target Communication Framework.</para></listitem> | ||
1440 | <listitem><para>Click "Next".</para></listitem> | ||
1441 | <listitem><para>Clear out the "host name" field and enter | ||
1442 | the IP Address determined earlier.</para></listitem> | ||
1443 | <listitem><para>Click "Finish" to close the | ||
1444 | New Connections Dialog.</para></listitem> | ||
1445 | <listitem><para>Use the drop-down menu now in the | ||
1446 | "Connection" field and pick the IP Address you entered. | ||
1447 | </para></listitem> | ||
1448 | <listitem><para>Click "Debug" to bring up a login screen | ||
1449 | and login.</para></listitem> | ||
1450 | <listitem><para>Accept the debug perspective. | ||
1451 | </para></listitem> | ||
1452 | </orderedlist> | ||
1453 | </para> | ||
1454 | </section> | ||
1455 | |||
1456 | <section id='running-user-space-tools'> | ||
1457 | <title>Running User-Space Tools</title> | ||
1458 | |||
1459 | <para> | ||
1460 | As mentioned earlier in the manual, several tools exist that | ||
1461 | enhance your development experience. | ||
1462 | These tools are aids in developing and debugging applications | ||
1463 | and images. | ||
1464 | You can run these user-space tools from within the Eclipse | ||
1465 | IDE through the "YoctoProjectTools" menu. | ||
1466 | </para> | ||
1467 | |||
1468 | <para> | ||
1469 | Once you pick a tool, you need to configure it for the remote | ||
1470 | target. | ||
1471 | Every tool needs to have the connection configured. | ||
1472 | You must select an existing TCF-based RSE connection to the | ||
1473 | remote target. | ||
1474 | If one does not exist, click "New" to create one. | ||
1475 | </para> | ||
1476 | |||
1477 | <para> | ||
1478 | Here are some specifics about the remote tools: | ||
1479 | <itemizedlist> | ||
1480 | <listitem><para><emphasis><filename>OProfile</filename>:</emphasis> | ||
1481 | Selecting this tool causes the | ||
1482 | <filename>oprofile-server</filename> on the remote | ||
1483 | target to launch on the local host machine. | ||
1484 | The <filename>oprofile-viewer</filename> must be | ||
1485 | installed on the local host machine and the | ||
1486 | <filename>oprofile-server</filename> must be installed | ||
1487 | on the remote target, respectively, in order to use. | ||
1488 | You must compile and install the | ||
1489 | <filename>oprofile-viewer</filename> from the source | ||
1490 | code on your local host machine. | ||
1491 | Furthermore, in order to convert the target's sample | ||
1492 | format data into a form that the host can use, you must | ||
1493 | have OProfile version 0.9.4 or greater installed on the | ||
1494 | host.</para> | ||
1495 | <para>You can locate both the viewer and server from | ||
1496 | <ulink url='&YOCTO_GIT_URL;/cgit/cgit.cgi/oprofileui/'></ulink>. | ||
1497 | You can also find more information on setting up and | ||
1498 | using this tool in the | ||
1499 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-oprofile'>oprofile</ulink>" | ||
1500 | section of the Yocto Project Profiling and Tracing | ||
1501 | Manual. | ||
1502 | <note>The <filename>oprofile-server</filename> is | ||
1503 | installed by default on the | ||
1504 | <filename>core-image-sato-sdk</filename> image.</note> | ||
1505 | </para></listitem> | ||
1506 | <listitem><para><emphasis><filename>Lttng2.0 trace import</filename>:</emphasis> | ||
1507 | Selecting this tool transfers the remote target's | ||
1508 | <filename>Lttng</filename> tracing data back to the | ||
1509 | local host machine and uses the Lttng Eclipse plug-in | ||
1510 | to graphically display the output. | ||
1511 | For information on how to use Lttng to trace an | ||
1512 | application, | ||
1513 | see <ulink url='http://lttng.org/documentation'></ulink> | ||
1514 | and the | ||
1515 | "<ulink url='&YOCTO_DOCS_PROF_URL;#lttng-linux-trace-toolkit-next-generation'>LTTng (Linux Trace Toolkit, next generation)</ulink>" | ||
1516 | section, which is in the Yocto Project Profiling and | ||
1517 | Tracing Manual. | ||
1518 | <note>Do not use | ||
1519 | <filename>Lttng-user space (legacy)</filename> tool. | ||
1520 | This tool no longer has any upstream support.</note> | ||
1521 | </para> | ||
1522 | <para>Before you use the | ||
1523 | <filename>Lttng2.0 trace import</filename> tool, | ||
1524 | you need to setup the Lttng Eclipse plug-in and create a | ||
1525 | Tracing project. | ||
1526 | Do the following: | ||
1527 | <orderedlist> | ||
1528 | <listitem><para>Select "Open Perspective" from the | ||
1529 | "Window" menu and then select "Other..." to | ||
1530 | bring up a menu of other perspectives. | ||
1531 | Choose "Tracing". | ||
1532 | </para></listitem> | ||
1533 | <listitem><para>Click "OK" to change the Eclipse | ||
1534 | perspective into the Tracing perspective. | ||
1535 | </para></listitem> | ||
1536 | <listitem><para>Create a new Tracing project by | ||
1537 | selecting "Project" from the "File -> New" menu. | ||
1538 | </para></listitem> | ||
1539 | <listitem><para>Choose "Tracing Project" from the | ||
1540 | "Tracing" menu and click "Next". | ||
1541 | </para></listitem> | ||
1542 | <listitem><para>Provide a name for your tracing | ||
1543 | project and click "Finish". | ||
1544 | </para></listitem> | ||
1545 | <listitem><para>Generate your tracing data on the | ||
1546 | remote target.</para></listitem> | ||
1547 | <listitem><para>Select "Lttng2.0 trace import" | ||
1548 | from the "Yocto Project Tools" menu to | ||
1549 | start the data import process.</para></listitem> | ||
1550 | <listitem><para>Specify your remote connection name. | ||
1551 | </para></listitem> | ||
1552 | <listitem><para>For the Ust directory path, specify | ||
1553 | the location of your remote tracing data. | ||
1554 | Make sure the location ends with | ||
1555 | <filename>ust</filename> (e.g. | ||
1556 | <filename>/usr/mysession/ust</filename>). | ||
1557 | </para></listitem> | ||
1558 | <listitem><para>Click "OK" to complete the import | ||
1559 | process. | ||
1560 | The data is now in the local tracing project | ||
1561 | you created.</para></listitem> | ||
1562 | <listitem><para>Right click on the data and then use | ||
1563 | the menu to Select "Generic CTF Trace" from the | ||
1564 | "Trace Type... -> Common Trace Format" menu to | ||
1565 | map the tracing type.</para></listitem> | ||
1566 | <listitem><para>Right click the mouse and select | ||
1567 | "Open" to bring up the Eclipse Lttng Trace | ||
1568 | Viewer so you view the tracing data. | ||
1569 | </para></listitem> | ||
1570 | </orderedlist></para></listitem> | ||
1571 | <listitem><para><emphasis><filename>PowerTOP</filename>:</emphasis> | ||
1572 | Selecting this tool runs PowerTOP on the remote target | ||
1573 | machine and displays the results in a new view called | ||
1574 | PowerTOP.</para> | ||
1575 | <para>The "Time to gather data(sec):" field is the time | ||
1576 | passed in seconds before data is gathered from the | ||
1577 | remote target for analysis.</para> | ||
1578 | <para>The "show pids in wakeups list:" field corresponds | ||
1579 | to the <filename>-p</filename> argument passed to | ||
1580 | <filename>PowerTOP</filename>.</para></listitem> | ||
1581 | <listitem><para><emphasis><filename>LatencyTOP and Perf</filename>:</emphasis> | ||
1582 | LatencyTOP identifies system latency, while | ||
1583 | Perf monitors the system's performance counter | ||
1584 | registers. | ||
1585 | Selecting either of these tools causes an RSE terminal | ||
1586 | view to appear from which you can run the tools. | ||
1587 | Both tools refresh the entire screen to display results | ||
1588 | while they run. | ||
1589 | For more information on setting up and using | ||
1590 | <filename>perf</filename>, see the | ||
1591 | "<ulink url='&YOCTO_DOCS_PROF_URL;#profile-manual-perf'>perf</ulink>" | ||
1592 | section in the Yocto Project Profiling and Tracing | ||
1593 | Manual. | ||
1594 | </para></listitem> | ||
1595 | <listitem><para><emphasis><filename>SystemTap</filename>:</emphasis> | ||
1596 | Systemtap is a tool that lets you create and reuse | ||
1597 | scripts to examine the activities of a live Linux | ||
1598 | system. | ||
1599 | You can easily extract, filter, and summarize data | ||
1600 | that helps you diagnose complex performance or | ||
1601 | functional problems. | ||
1602 | For more information on setting up and using | ||
1603 | <filename>SystemTap</filename>, see the | ||
1604 | <ulink url='https://sourceware.org/systemtap/documentation.html'>SystemTap Documentation</ulink>. | ||
1605 | </para></listitem> | ||
1606 | <listitem><para><emphasis><filename>yocto-bsp</filename>:</emphasis> | ||
1607 | The <filename>yocto-bsp</filename> tool lets you | ||
1608 | quickly set up a Board Support Package (BSP) layer. | ||
1609 | The tool requires a Metadata location, build location, | ||
1610 | BSP name, BSP output location, and a kernel | ||
1611 | architecture. | ||
1612 | For more information on the | ||
1613 | <filename>yocto-bsp</filename> tool outside of Eclipse, | ||
1614 | see the | ||
1615 | "<ulink url='&YOCTO_DOCS_BSP_URL;#creating-a-new-bsp-layer-using-the-yocto-bsp-script'>Creating a new BSP Layer Using the yocto-bsp Script</ulink>" | ||
1616 | section in the Yocto Project Board Support Package | ||
1617 | (BSP) Developer's Guide. | ||
1618 | </para></listitem> | ||
1619 | </itemizedlist> | ||
1620 | </para> | ||
1621 | </section> | ||
1622 | </section> | ||
1623 | |||
1624 | <section id='workflow-using-stand-alone-cross-development-toolchains'> | ||
1625 | <title>Workflow Using Stand-Alone Cross-Development Toolchains</title> | ||
1626 | |||
1627 | <para> | ||
1628 | If you want to develop an application without prior installation | ||
1629 | of the ADT, you still can employ the | ||
1630 | <link linkend='cross-development-toolchain'>Cross Development Toolchain</link>, | ||
1631 | the QEMU emulator, and a number of supported target image files. | ||
1632 | You just need to follow these general steps: | ||
1633 | <orderedlist> | ||
1634 | <listitem><para><emphasis>Install the cross-development | ||
1635 | toolchain for your target hardware:</emphasis> | ||
1636 | For information on how to install the toolchain, see the | ||
1637 | "<ulink url='&YOCTO_DOCS_ADT_URL;#using-an-existing-toolchain-tarball'>Using a Cross-Toolchain Tarball</ulink>" | ||
1638 | section in the Yocto Project Application Developer's | ||
1639 | Guide.</para></listitem> | ||
1640 | <listitem><para><emphasis>Download the Target Image:</emphasis> | ||
1641 | The Yocto Project supports several target architectures | ||
1642 | and has many pre-built kernel images and root filesystem | ||
1643 | images.</para> | ||
1644 | <para>If you are going to develop your application on | ||
1645 | hardware, go to the | ||
1646 | <ulink url='&YOCTO_MACHINES_DL_URL;'><filename>machines</filename></ulink> | ||
1647 | download area and choose a target machine area | ||
1648 | from which to download the kernel image and root filesystem. | ||
1649 | This download area could have several files in it that | ||
1650 | support development using actual hardware. | ||
1651 | For example, the area might contain | ||
1652 | <filename>.hddimg</filename> files that combine the | ||
1653 | kernel image with the filesystem, boot loaders, and | ||
1654 | so forth. | ||
1655 | Be sure to get the files you need for your particular | ||
1656 | development process.</para> | ||
1657 | <para>If you are going to develop your application and | ||
1658 | then run and test it using the QEMU emulator, go to the | ||
1659 | <ulink url='&YOCTO_QEMU_DL_URL;'><filename>machines/qemu</filename></ulink> | ||
1660 | download area. | ||
1661 | From this area, go down into the directory for your | ||
1662 | target architecture (e.g. <filename>qemux86_64</filename> | ||
1663 | for an <trademark class='registered'>Intel</trademark>-based | ||
1664 | 64-bit architecture). | ||
1665 | Download kernel, root filesystem, and any other files you | ||
1666 | need for your process. | ||
1667 | <note>In order to use the root filesystem in QEMU, you | ||
1668 | need to extract it. | ||
1669 | See the | ||
1670 | "<ulink url='&YOCTO_DOCS_ADT_URL;#extracting-the-root-filesystem'>Extracting the Root Filesystem</ulink>" | ||
1671 | section for information on how to extract the root | ||
1672 | filesystem.</note></para></listitem> | ||
1673 | <listitem><para><emphasis>Develop and Test your | ||
1674 | Application:</emphasis> At this point, you have the tools | ||
1675 | to develop your application. | ||
1676 | If you need to separately install and use the QEMU | ||
1677 | emulator, you can go to | ||
1678 | <ulink url='http://wiki.qemu.org/Main_Page'>QEMU Home Page</ulink> | ||
1679 | to download and learn about the emulator. | ||
1680 | You can see the | ||
1681 | "<link linkend='dev-manual-qemu'>Using the Quick EMUlator (QEMU)</link>" | ||
1682 | chapter for information on using QEMU within the Yocto | ||
1683 | Project.</para></listitem> | ||
1684 | </orderedlist> | ||
1685 | </para> | ||
1686 | </section> | ||
1687 | </section> | 543 | </section> |
1688 | 544 | ||
1689 | <section id="dev-modifying-source-code"> | 545 | <section id="dev-modifying-source-code"> |
@@ -1713,7 +569,7 @@ | |||
1713 | describes this workflow. | 569 | describes this workflow. |
1714 | If you want more information that showcases the workflow, click | 570 | If you want more information that showcases the workflow, click |
1715 | <ulink url='https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view'>here</ulink> | 571 | <ulink url='https://drive.google.com/a/linaro.org/file/d/0B3KGzY5fW7laTDVxUXo3UDRvd2s/view'>here</ulink> |
1716 | for an excellent presentation by Trevor Woerner that | 572 | for a presentation by Trevor Woerner that, while somewhat dated, |
1717 | provides detailed background information and a complete | 573 | provides detailed background information and a complete |
1718 | working tutorial. | 574 | working tutorial. |
1719 | </para></listitem> | 575 | </para></listitem> |