It’s not an embedded Linux distribution – It creates a custom one for you. The Yocto Project and its Application Development Toolkit (ADT) - “The Answer to Effective Embedded Application Development” David Stewart Intel Corporation April 11, 2011 Agenda Challenges Developing Today’s Embedded Software ● The Yocto Project Build System ● The Yocto Project Application Development Toolkit (ADT) ● The ADT Usage Model ● Example App Development using ADT ● Benefits of Using the Yocto Project and its ADT ● Q&A ● 2/ Challenges Developing Today's Embedded Software – The Context SoCs have brought fantastic capabilities to embedded products ● But... it means that rapidly developed application software is a key part of the solution ● Application developer is quite often a different role/skillset than the system developer ● Embedded products typically require a targeted application development effort - focused on rapid development for embedded devices ● Customized toolchain and development platform are essential for embedded software development 3/ Challenges Developing Today's Embedded Software Challenges: Support the app developer role with their own environment ● Quickly roll out new applications that utilize features in the silicon and meet time to market (TTM) demands is paramount ● Time and complexity to build up such a TTM accelerator ● 4/ The Yocto Project Build System Yocto Workflow 5/ Setting up the App Developer Environment System dev App dev Sysroot: (Bootable Linux filesystem with dev headers) Package Repository (networked or local) Cross-toolchain Installation (eg: /opt/poky) 6/ Sys Dev builds what the App Dev needs 1.Build the cross toolchain for a specific host system (e.g. x86_64) and target architecture (e.g arm): 1.Set SDKMACHINE=x86_64 in conf/local.conf 2.Run “MACHINE=qemuarm bitbake meta-toolchain package-index” 2.Build the matching target rootfs (e.g. poky-image-sato-sdk) that sysroot is based on: Run “MACHINE=qemuarm bitbake poky-image-sato-sdk packageindex” (Sato is a gnome mobile environment and visual style that is designed specifically to work well with small high resolution screens and stylus input) ● For more simplicity, build them in a single step: Run “MACHINE=qemuarm bitbake poky-image-sato-sdk metatoolchain package-index” ● With Yocto, one configuration, one command can generate both a toolchain and matching rootfs image 7/ ADT Notes Cross toolchain and image files generated by the Yocto build system based on the target device metadata configuration ● Setup target system development environment on the App Dev machine based on sysroot concept ● GNU cross-development toolchain of build, packaging, and debug ●Development headers and libraries ●Sysroot represents target device root filesystem ● Optimized for autotools-type projects ● For autotool enabled packages just pass host options to configure, e.g. ● configure --host=arm-poky-linux-gnueabi --with-libtoolsysroot=/home/davest/arm ● For other projects, ensure that the cross tools are used, e.g. ● CC=arm-poky-linux-gnueabi-gcc and LD=arm-poky-linux-gnueabi-ld in makefile 8/ ADT Notes (cont.) Either Qemu with GL pass-through or real hardware as development targets ● User mode NFS support ● Allow emulator and host access the file system at same time ● Use package management infrastructure to update packages on running systems and sysroot: RPM, Deb, OPKG ● ADT installer script provides customization to set up cross development environment ● 9/ IDE Support: Eclipse Eclipse plug-in and user space tool suite offerings further improve developer productivity ● 10/ The Yocto Project and ADT Usage Model 11/ Example Application Development Using ADT A case study to show how to customize a cross development environment via the Yocto ADT ● Original cross development setup ● A x86_64-arm cross toolchain installed under /opt/poky/1.0 ●Sysroot extracted from poky-image-sato-sdk rootfs under /home/davest/arm ● Add support for clutter-based applications on the new device: ● Step 1. target metadata needs to be extended to add clutter library support, e.g. clutter-1.4_1.4.2.bb and clutter.inc ●Step 2. Run “bitbake clutter-1.4” to build clutter library packages, using opkg ● 12/ Example Application Development Using ADT (cont.) Step 3. Use a package manager (e.g. opkg) to add clutter packages to sysroot: ● –opkg-cl f ~davest/opkg/opkg.conf –opkg-cl f ~davest/opkg/opkg.conf install libclutter-glx-1.4-0 –opkg-cl f ~davest/opkg/opkg.conf install libclutter-glx-1.4-dbg –opkg-cl f ~davest/opkg/opkg.conf install libclutter-glx-1.4-dev -o ~davest/arm update -o ~davest/arm --force-overwrite -o ~davest/arm --force-overwrite -o ~davest/arm --force-overwrite Step 4. Build clutter autotool based application with ● –configure –with-libtool-sysroot=/home/davest/arm --host=arm-pokylinux-gnueabi –make will use cross tools e.g. arm-poky-linux-gnueabi-gcc --sysroot=/home/davest/arm Step 5. Boot up qemu in the unfs mode to test, debug new clutter app on target emulator ● –poky-qemu /home/davest/qemu-kernel/zImage-qemuarm.bin /home/davest/arm –The shared and updated sysroot as rootfs allows immediate cross debug and run in the target emulator with no need to recreate a target image 13/ Example Application Development Using ADT (cont.) To finish up the device project: ●Create a recipe for your app and include it in the system build ● User specified sysroot supports multiple build profiles cross development environment setup for same target architecture ●e.g. Yocto provides, –minimal, minimal-dev, –lsb, lsb-dev, lsb-sdk, –sato, sato-dev, sato-sdk ● Application development can progress in parallel with system development ● 14/ Benefits of Using the Yocto Project and its ADT Easily build an embedded product focused cross-toolchain ● Using sysroot, quickly setup a customized cross-development environment ● Same build configuration to build the target-specific distribution image and the cross-toolchain ● Enhanced developer productivity through ADT Eclipse plug-in, Qemu emulator and user-space tool suite offerings ● 15/ Benefits of Using the Yocto Project and its ADT (cont.) An embedded board vendor can provide a product-focused toolchain, tools and development platform in the bundle with Board Support Package (BSP)s. ● Enable immediate software development against the new product that best showcases its unique features ● Do software and hardware development in parallel, which leads to great TTM for both software and hardware readiness at product launch ● 16/ Questions? 17/ Backup 18/ The Yocto Project Tools The ADT Application user space tools suite contains the following essential tools that provide target analytical capabilities: ● PowerTop ●LatencyTop ●Oprofile ●Perf ●Lttng-ust ●SystemTap ● Yocto 1.0 will also provide the following tools: ● SystemProf ●Trace-cmd/kernelshark ●blktrace ● 19/ The Yocto Project ADT Standalone No IDE required - command line arguments ● Script files provided: ● Environment setup script for cross development environment ●Running Poky Qemu images ● Use package tools, user mode NFS to provision applications to target devices ● 20/ The Yocto Project ADT Eclipse Plug-in Built on top via extensions of the available feature rich Eclipse plug-ins ● CDT, Linux Tools Project, TCF/RSE ● Integrates Yocto ADT cross toolchain into CDT ● Via CDT to interact with tools to achieve cross platform “build, deploy, test, debug” ● Intended to be used for GNU autotools projects ● Leverage TCF and its remote agent mechanism to achieve remote tools interaction without leaving IDE ● 21/ Code extract of clutter-1.4_1.4.2.bb and clutter.inc Clutter-1.4_1.4.2.bb ● ● require clutter.inc ● PR = "r0" ● PACKAGES =+ "${PN}-examples" ● FILES_${PN}-examples = "${bindir}/test-* ${pkgdatadir}/redhand.png" ● SRC_URI = "http://source.clutter-project.org/sources/clutter/1.4/clutter-${PV}.tar.bz2 \ ● ... Clutter.inc ● ● DESCRIPTION = "Clutter graphics library" ● HOMEPAGE = "http://www.clutter-project.org/" ● LICENSE = "LGPL" ● COMPATIBLE_MACHINE = "(zylonite|mx31litekit|omap-3430ldp|omap-3430sdp|mx31ads|qemuarm|qemux86|ipodtouch|atom-pc|menlow)" ● STDDEPENDS = "virtual/libx11 gtk-doc-native pango glib-2.0 libxfixes gtk+ libxi" ● BASE_CONF = "--disable-gtk-doc ${@get_clutter_fpu_setting(bb, d)}" ● DEPENDS = "${STDDEPENDS} virtual/libgl gettext" ● EXTRA_OECONF = "${BASE_CONF} --with-flavour=glx" ● DEPENDS_zylonite = "${STDDEPENDS} libgles-zylonite tslib" ● EXTRA_OECONF_zylonite = "${BASE_CONF} --with-flavour=eglnative" ● PACKAGE_ARCH_zylonite = "${MACHINE_ARCH}" ● LDFLAGS_append_zylonite = " -lnws -lstdc++ " 22/ Resources ● http://www.yoctoproject.org 23/ Legal Information INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER INTELLECTUAL PROPERTY RIGHT. Intel may make changes to specifications, product descriptions, and plans at any time, without notice. All dates provided are subject to change without notice. Intel is a trademark of Intel Corporation in the U.S. and other countries. *Other names and brands may be claimed as the property of others. Copyright © 2009, Intel Corporation. All rights are protected. 24/ 25/