Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Yocto for Raspberry Pi

You're reading from  Yocto for Raspberry Pi

Product type Book
Published in Jun 2016
Publisher Packt
ISBN-13 9781785281952
Pages 214 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
TEXIER Pierre-Jean TEXIER Pierre-Jean
Profile icon TEXIER Pierre-Jean
Petter Mabäcker Petter Mabäcker
Profile icon Petter Mabäcker
View More author details

Table of Contents (18) Chapters

Yocto for Raspberry Pi
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Meeting the Yocto Project Building our First Poky Image for the Raspberry Pi Mastering Baking with Hob and Toaster Understanding BitBake Creating, Developing, and Deploying on the Raspberry Pi Working with External Layers Deploying a Custom Layer on the Raspberry Pi Diving into the Raspberry Pi's Peripherals and Yocto Recipes Making a Media Hub on the Raspberry Pi Playing with an LCD Touchscreen and the Linux Kernel Contributing to the Raspberry Pi BSP Layer Home Automation Project - Booting a Custom Image

Chapter 10.  Playing with an LCD Touchscreen and the Linux Kernel

When setting up an LCD touchscreen using an embedded Linux system, it's recommended to have basic knowledge of the Linux kernel and how to configure it. In this chapter, we will learn some basics about the Linux kernel and how to download, configure, and compile it using a cross compiler. The current recommendation when running a Linux-based system on the Raspberry Pi is to use the Raspberry Pi Linux kernel instead of the the mainline Linux kernel; we will learn why in this chapter.

Later in the chapter, we will go through how to boot an image based on the Yocto Project with a windowing system using a Raspberry Pi 7 touchscreen and a PiTFT 2.8 touchscreen. The chapter will end with a walkthrough of how to use the Qt application framework to develop graphical applications for the Raspberry Pi that are possible to play using a touchscreen.

The Linux kernel


The Linux kernel is a Unix-like operating system kernel created by Linus Torvalds 1991. It was originally developed for 32-bit x86-based PCs, but today, Linux also supports a large set of architectures such as ARM, PowerPC, MIPS, and SPARC. The Linux kernel is a fundamental part of a Linux distribution (such as Ubuntu, Debian, and Fedora).

When deciding which kernel is most suited to your project, it's good to have in mind how kernel releases work. Depending on your needs, you can choose between mainline, developing, or stable kernels. If you don't work with kernel development, it's recommended to avoid using the mainline kernel since it's still under development and is considered unstable. A kernel is always considered stable directly after it has been released from the mainline tree. After that, the kernel will be maintained until the next mainline kernel becomes available (usually in 2-3 months). However, a kernel can be picked as a longterm kernel, which means that it...

Setting up an LCD display for the Raspberry Pi using the Yocto Project


There exist a number of different LCD displays for the Raspberry Pi. Among the most popular are the official Raspberry Pi 7 touchscreen and the PiTFT displays (often called PiTFT Hats, since they are suitable to mount on top of the Raspberry Pi). For now, we will focus on the Raspberry Pi 7 touchscreen and the PiTFT models.

In this section, we will go through how to boot a standard Yocto Project image, containing a window system and a working touchscreen.

The Raspberry Pi 7 touchscreen

Getting started with the Raspberry Pi 7 touchscreen using an image based on the Yocto Project requires quite a few configurations. First, we need to ensure we are using a 4.1+ kernel. Starting from the jethro release of meta-raspberrypi, 4.1 is the default version. Currently, meta-raspberrypi lacks full support for the Raspberry Pi 7 touchscreen, so we need to perform some small modifications before booting our image.

Note

Build instructions...

Developing applications and using them on an LCD display


At this point, we have an image based on the Yocto Project with PiTFT display support up and running on our Raspberry Pi. In this section, we will develop a graphical application that we can use with our fancy touchscreen. When developing graphical applications, a couple of different frameworks exist. Qt is one of the most famous graphical frameworks for embedded devices and exists in a free software version. In this section, we will go through how to set up and develop a graphical application for embedded Linux environments using Qt and EGLFS. Qt is a cross-platform application framework, so besides being able to run on various types of hardware, it can also be used in many different software platforms (such as X11, OS X, Windows, and EGLFS). EGLFS, which we will be using in our example, is basically a platform plugin used for running Qt applications on top of EGL and OpenGL ES. In fact, it will not even require a window system (such...

Summary


In this chapter we gained some basic knowledge about the Linux kernel and its release strategy and the differences between the mainline kernel and the official Raspberry Pi Linux kernel. We also learned how to configure and compile the Linux kernel using a cross compiler. When changing the defconfig file within meta-raspberrypi, the kernel recipe requires some special treatment as compared to the normal Yocto Project procedure. This chapter demonstrated two examples of how this can be done. Later, we also went through some basic kernel configuration required for setting up two different touchscreens; this also included some basic understanding about device trees and how to configure the Raspberry Pi using 'them.

The chapter also covered some examples of how to run a Yocto-based image with a windowing system on the Raspberry Pi, using two different touchscreens: the Raspberry Pi 7 touchscreen and PiTFT 2.8 resistive touchscreen. In the last section of the chapter, we learned about...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Yocto for Raspberry Pi
Published in: Jun 2016 Publisher: Packt ISBN-13: 9781785281952
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}