Book Image

Yocto for Raspberry Pi

By : TEXIER Pierre-Jean, Petter Mabäcker
Book Image

Yocto for Raspberry Pi

By: TEXIER Pierre-Jean, Petter Mabäcker

Overview of this book

The Yocto Project is a Linux Foundation workgroup, which produces tools (SDK) and processes (configuration, compilation, installation) that will enable the creation of Linux distributions for embedded software, independent of the architecture of embedded software (Raspberry Pi, i.MX6, and so on). It is a powerful build system that allows you to master your personal or professional development. This book presents you with the configuration of the Yocto Framework for the Raspberry Pi, allowing you to create amazing and innovative projects using the Yocto/ OpenEmbedded eco-system. It starts with the basic introduction of Yocto's build system, and takes you through the setup and deployment steps for Yocto. It then helps you to develop an understanding of Bitbake (the task scheduler), and learn how to create a basic recipe through a GPIO application example. You can then explore the different types of Yocto recipe elements (LICENSE, FILES, SRC_URI, and so on). Next, you will learn how to customize existing recipes in Yocto/OE layers and add layers to your custom environment (qt5 for example).
Table of Contents (18 chapters)
Yocto for Raspberry Pi
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
3
Mastering Baking with Hob and Toaster

Our application - an introduction


Now that we've covered how to generate the SDK for our platform and how to integrate package in our Yocto image, we will, through an example, develop an application with the general purpose input output (GPIO) pins of the Raspberry Pi and then create a recipe to integrate our application with the final image.

The idea is to develop an application that, through the GPIO pins, lights an LED and monitors a push button.

Here is the schematic diagram, realized with Fritzing (http://fritzing.org/home/):

Thus, we can, from the Linux user space, light the LED or monitor the push button through GPIO 4 of the Raspberry Pi (pin 7 of the main connector).

We can test the following C application:

static int parse_opts(int argc, char *argv[])
int long_index = 0;
int opt;
static struct option option[]
{"Ied", required_argument, NULL, '1'
{"help", no_argument, NULL, 'h'
{"button", no_argument, NULL, 'b'
{"version", no_argument, NULL, 'v'&...