Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[Webinar] An Introduction to the Yocto Embedded Framework

1,108 views

Published on

Slides from January 19, 2017 webinar, An Introduction to the Yocto Embedded Framework.

Published in: Software
  • Be the first to comment

  • Be the first to like this

[Webinar] An Introduction to the Yocto Embedded Framework

  1. 1. © Integrated Computer Solutions, Inc. All Rights Reserved An Introduction to the Yocto Embedded Framework Jeff Tranter <jtranter@ics.com> Integrated Computer Solutions, Inc.
  2. 2. © Integrated Computer Solutions, Inc. All Rights Reserved Agenda • What is Yocto? • Why is it Needed? • What Yocto Provides • Benefits/Advantages • Limitations/Disadvantages • Yocto Versions • Other Framework Options • Yocto Architecture • Major Components • Using Yocto - Basic Steps • OpenEmbeddedBuild System • Bitbake Metadata • Example - Emulator • Example - Beaglebone Black • Building an SDK • Packaging • Toaster GUI • Qt Yocto Support • Doing More • Tips For Getting Started • References • Summary • Q&A
  3. 3. © Integrated Computer Solutions, Inc. All Rights Reserved What is Yocto? • Project to provide templates, tools and methods to create custom Linux-based embedded systems • Founded in 2010 • Open Source, managed by The Linux Foundation • Vendor and platform neutral • Collaborative effort among participants • Members/participants/sponsors include Intel, AMD, Broadcom, TI, Freescale, LG Electronics, Huawei, Mentor Graphics, Dell, The Qt Company
  4. 4. © Integrated Computer Solutions, Inc. All Rights Reserved Why Is It Needed? • Embedded development is significantly harder than native/desktop development • Cross-compilation • Wide scope: boot loader, kernel, BSP/device drivers, packaging format, utilities, applications, SDK • Large, time consuming to build • Desire for repeatability, automation • Licensing issues • Regular need for security and other updates
  5. 5. © Integrated Computer Solutions, Inc. All Rights Reserved What Yocto Provides • Framework for creating embedded Linux systems • Targets supported: ARM, PPC, MIPS, x86, x86-64 • Hosted on common Linux x86 desktop platforms (CentOS, Fedora, openSUSE, Ubuntu) • OpenEmbedded build system with bitbake build engine • IDE • Graphical interface to build system
  6. 6. © Integrated Computer Solutions, Inc. All Rights Reserved Benefits/Advantages • Reduced development effort/time • Improved quality • Automation • Stability • Repeatability
  7. 7. © Integrated Computer Solutions, Inc. All Rights Reserved Limitations/Disadvantages • Embedded Linux targets only • Development tools run on desktop Linux only (or in a Linux vm hosted on e.g. Windows or MacOS) • Doesn't dictate a specific Linux distribution (but offers Poky as a reference distribution) • Large, complex, can have steep learning curve
  8. 8. © Integrated Computer Solutions, Inc. All Rights Reserved Yocto Versions/Code Names
  9. 9. © Integrated Computer Solutions, Inc. All Rights Reserved Other Embedded Frameworks • Baserock • Buildroot • Crosstool/CrosstoolNG • Embedded Debian/Fedora/Gentoo/SUSE/Ubuntu
  10. 10. © Integrated Computer Solutions, Inc. All Rights Reserved Yocto Architecture
  11. 11. © Integrated Computer Solutions, Inc. All Rights Reserved Major Components • bitbake • Poky Linux distribution • Emulator • Toaster GUI • SDK • Eclipse IDE plugin • Build Appliance
  12. 12. © Integrated Computer Solutions, Inc. All Rights Reserved Using Yocto - Basic Steps 1. Set up tools on a Linux host machine. 2. Configure bitbake for embedded hardware. 3. Build software components, bootloader, root fs, image. 4. Write boot image and file system. 5. Set up SDK. 6. Develop and iterate.
  13. 13. © Integrated Computer Solutions, Inc. All Rights Reserved bitbake Build System Steps: • fetch • extract • patch • configure • build • install • package
  14. 14. © Integrated Computer Solutions, Inc. All Rights Reserved Bitbake Metadata
  15. 15. © Integrated Computer Solutions, Inc. All Rights Reserved Example - Building For Emulator $ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2- dev xterm
  16. 16. © Integrated Computer Solutions, Inc. All Rights Reserved Example - Building For Emulator $ mkdir yocto $ cd yocto $ wget http://downloads.yoctoproject.org/releases/yocto/yocto- 2.2/poky-morty-16.0.0.tar.bz2 $ tar xjvf poky-morty-16.0.0.tar.bz2 $ cd poky-morty-16.0.0 $ source oe-init-build-env $ edit conf/local.conf $ bitbake core-image-sato $ runqemu qemuarm
  17. 17. © Integrated Computer Solutions, Inc. All Rights Reserved Example - Building for Beaglebone Black
  18. 18. © Integrated Computer Solutions, Inc. All Rights Reserved Example - Building for Beaglebone Black Device Boot Start End Blocks Id System /dev/mmcblk0p1 * 2048 146570 72261+ c W95 FAT32(LBA) /dev/mmcblk0p2 146571 8535178 4194304 83 Linux $ sudo mkfs.vfat -F 16 -n "boot" /dev/mmcblk0p1 $ sudo mke2fs -j -L "root" /dev/mmcblk0p2
  19. 19. © Integrated Computer Solutions, Inc. All Rights Reserved Example - Building for Beaglebone Black $ cp tmp/deploy/images/beaglebone/MLO-beaglebone /media/ $LOGNAME/boot/MLO $ cp tmp/deploy/images/beaglebone/u-boot-beaglebone.img /media/ $LOGNAME/boot/u-boot.img $ sudo tar x -C /media/$LOGNAME/root -f tmp/deploy/images/beaglebone/core-image-sato-beaglebone.tar.bz2
  20. 20. © Integrated Computer Solutions, Inc. All Rights Reserved Building an SDK $ bitbake core-image-sato -c populate_sdk Output is: tmp/deploy/sdk/poky-glibc-x86_64-core-image-sato-armv5e- toolchain-2.2.sh
  21. 21. © Integrated Computer Solutions, Inc. All Rights Reserved Building an SDK $ ~/yocto/poky-morty-16.0.0/build/tmp/deploy/sdk/poky-glibc-x86_64- core-image-sato-armv5e-toolchain-2.2.sh Poky (Yocto Project Reference Distro) SDK installer version 2.2 =============================================================== Enter target directory for SDK (default: /opt/poky/2.2): ~/sdk You are about to install the SDK to "/home/tranter/sdk". Proceed[Y/n]? Y Extracting SDK......................................................................do ne Setting it up...done SDK has been successfully set up and is ready to be used. Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. $ . /home/tranter/sdk/environment-setup-armv5e-poky-linux-gnueabi
  22. 22. © Integrated Computer Solutions, Inc. All Rights Reserved Building an SDK $ . /home/tranter/sdk/environment-setup-armv5e-poky-linux-gnueabi $ echo $CXX arm-poky-linux-gnueabi-g++ -march=armv5e -marm --sysroot=/home/tranter/sdk/sysroots/armv5e-poky-linux-gnueabi $ $CXX helloworld.cpp $ file a.out a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0
  23. 23. © Integrated Computer Solutions, Inc. All Rights Reserved Packaging • Not required, but often useful even for embedded systems. • Yocto doesn't impose a packaging format. • Common package formats include: • rpm • deb/dpkg • ipkg • opkg
  24. 24. © Integrated Computer Solutions, Inc. All Rights Reserved Toaster GUI
  25. 25. © Integrated Computer Solutions, Inc. All Rights Reserved Yocto Qt Support Yocto Qt 5 recipes: • https://github.com/meta-qt5/meta-qt5 Qt for Device Creation (boot2qt): • http://code.qt.io/cgit/yocto/meta-boot2qt.git/ • http://code.qt.io/cgit/yocto/meta-qt5.git/
  26. 26. © Integrated Computer Solutions, Inc. All Rights Reserved More About Bitbake • Python based language for configuration files. • Supports variables, include files, functions, inheritance. • Uses scripts called "recipes". • Many command line options. • Configuration files in build/conf • Understands dependencies. • Multithreaded, runs a server process in the background.
  27. 27. © Integrated Computer Solutions, Inc. All Rights Reserved Doing More - Writing Recipes • Needed to build your own components with bitbake • Shell or Python scripts (.bb files) • Standardized format
  28. 28. © Integrated Computer Solutions, Inc. All Rights Reserved Doing More - Kernel Recipes • Recipes to configure, patch, and build the Linux kernel • More complex
  29. 29. © Integrated Computer Solutions, Inc. All Rights Reserved Doing More - BSPs • BSP = Board Support Package. • Adaptations for specific hardware. • Hardware vendor, OS vendor, or third party may provide this.
  30. 30. © Integrated Computer Solutions, Inc. All Rights Reserved Doing More - Eclipse Integration
  31. 31. © Integrated Computer Solutions, Inc. All Rights Reserved Doing More - Licensing and Compliance
  32. 32. © Integrated Computer Solutions, Inc. All Rights Reserved Tips For Getting Started
  33. 33. © Integrated Computer Solutions, Inc. All Rights Reserved References 1. Embedded Linux Systems with the Yocto Project, Rudolf Streif 2. https://www.yoctoproject.org/ 3. https://github.com/meta-qt5/meta-qt5 4. http://code.qt.io/cgit/yocto/meta-boot2qt.git/ 5. http://code.qt.io/cgit/yocto/meta-qt5.git/ 6. http://www.ics.com/blog/yocto-quick-start
  34. 34. © Integrated Computer Solutions, Inc. All Rights Reserved Summary
  35. 35. © Integrated Computer Solutions, Inc. All Rights Reserved Questions?
  36. 36. © Integrated Computer Solutions, Inc. All Rights Reserved An Introduction to the Yocto Embedded Framework Jeff Tranter <jtranter@ics.com> Integrated Computer Solutions, Inc.

×