Building a Custom Linux BSP for SoC FPGA Systems Using the Yocto Project - ArrowElectronics/arrow-soc-workshops GitHub Wiki

Overview

The following pages are dedicated to instructing the reader on how to publish a Linux build system for their custom Intel® SoC FPGA based design using the Yocto Project. The Yocto Project is well suited to providing a deterministic, repeatable build system.

Table of Contents

  1. Introduction to Yocto
    1. Workshop goals
    2. Recommended References and Reading
  2. Getting started
    1. Clone Poky
    2. Initialize the Build Environment
    3. Build the Image
    4. Simulate Your Image Using QEMU
  3. Customizing your Build for Specific Hardware
    1. Clone the Layer
    2. Change the Configuration to Build for a Specific Machine
    3. Change the Configuration to Build for a Specific Linux Kernel
    4. Change the Configuration to set the number of Processor Threads
    5. Add Your Layer to the Layer Configuration File
    6. Modify the configuration to target a Development kit.
    7. Rebuild
    8. Copy the Linux image to a micro SD card.
    9. Connect to the target terminal
    10. Boot the Linux image on either board
  4. Create a Custom Board Layer
    1. Requirements for Booting a custom SoC FPGA board
    2. Examine the custom layer directory structure
    3. Review custom MACHINE configuration
    4. Review FPGA configuration recipe
    5. Create u-boot for the custom board
      1. Typical HPS Boot Flow
      2. HPS customization and u-boot
      3. Source code file structure for u-boot
      4. Review custom u-boot recipe
      5. Generate u-boot Custom Board source code based on the Quartus Handoff folder
    6. Review the Linux Kernel recipe
    7. Create Linux Root File System image configuration
  5. Build the Custom Image
    1. Change the Configuration to Build for the my-custom-soc-board MACHINE
    2. Add the meta-my-custom-soc-board Layer to the Layer Configuration File
    3. Build the custom console-image-minimal
    4. Copy the Linux image to a micro SD card
    5. Boot the Linux image
    6. Review the boot log
  6. Examine the live system
    1. The Platform Designer memory map
    2. Review the devicetree
    3. Examine the devicetree
    4. Modify the fpga_leds state
  7. Navigating the Build
  8. Debugging the Build
  9. Useful Commands
  10. Additional Learning

Introduction to Yocto

The Yocto Project is an open source collaboration project that helps developers create custom Linux-based systems for embedded products, regardless of the hardware architecture. The project provides a flexible set of tools and a space where embedded developers worldwide can share technologies, software stacks, configurations and best practices which can be used to create tailored Linux images for embedded devices.

The project provides a standard to delivering hardware support and software stacks, allowing the interchange of software configurations and builds. The tools allow users to build and support customizations for multiple hardware platforms and software stacks in a maintainable and scalable way.

Historically the project grew from, and works with the OpenEmbedded Project which is where the build system and some of the meta-data are derived.

Workshop goals

Yocto is a broad subject that requires extensive knowledge. This workshop aims to introduce the reader to this build system and the tools that are available from the Yocto Foundation that will assist in self-learning and developing expertise. This workshop will incrementally walk the reader through increasingly complex build systems. While Yocto by definition supports multiple processor architectures, this workshop will focus on SoC FPGAs from Intel.

The workshop will target a number of different SoC Development kits for convenience. These are readily available at arrow.com. The reader will initially build an x86 based Yocto distribution that can be emulated on an x86 host. A custom Intel (formerly Altera) layer will be added to support Intel and third party (Including Arrow) SoC FPGA custom hardware development kits. A simple Linux system will be built that boots on the Arrow SoCKit Development kit or the Terasic De10-nano development kit. This will be implemented by adding the Altera BSP layer to the Yocto build system.

Finally, the reader will learn how to create a custom layer to support booting Linux on their own custom Intel SoC FPGA hardware platforms. One of the following three kits will be used as a target for this purpose.

The Arrow SoCKit is no longer in production. Loaners are available from Arrow. Please contact your Arrow FAE to request a loaner.

Recommended References and Reading

Yocto is complex and requires a good understanding of its concepts and tools. This workshop does not attempt to fill that void. It is expected that the reader will self educate regarding the details of the Yocto Project. The yocto Project organization provides a rich set of resources for developers. Areas that we recommend include

Hyper-links of key words have been provided in the pages that follow and provide a deeper explanation of their function based on the reference material listed above.


Next- Getting Started
Return to - Arrow SoC FPGA Workshops