Skip to content

Yocto setup from scratch Example project ARM Azure Cloud Storage Gateway

sujoyray-ucolorado edited this page May 3, 2023 · 6 revisions

Introduction

The ARM-Azure Cloud Storage Gateway project aims to develop an embedded storage controller that will store user data into a SATA drive and interface with Microsoft Azure to enable cloud connectivity. The core of the storage controller will be the TI AM1808 chip, which has a high-performance ARM926EJ-S core with a built-in SATA controller.

To program the TI AM1808, a Yocto-based build system has been, allowing developers to create custom Linux distributions tailored to specific needs. The Linux kernel will be configured to enable the SATA and Ethernet interfaces to connect with Azure Blob Storage via the REST interface.

The project will require enabling support for the Embest SBC8018 board in both Linux Kernel and U-Boot. After porting the changes to the latest kernel and U-Boot, support for the platform needs to be added to the Yocto environment.

In this article I am going to describe the steps of creating a full project.

Various layers needed to create custom distribution

Below are the layers needed for creating custom distribution.

  1. poky
  2. meta-arm
  3. meta-openembedded
  4. meta-ti

Please refer to the implementation of ARM-Azure Cloud Storage Gateway https://github.com/sujoyray-ucolorado/final_project_AM1808_yocto to get an example of the project setup.

In addition of above layers, meta-aesd-proj layer was also created so that various project specific tools / implementations could be hosted using it.

Below are the steps one can follow:

  1. Create an empty git repository.
  2. For poky: git submodule add https://git.yoctoproject.org/git/poky
  3. For meta-arm: git submodule add https://git.yoctoproject.org/git/meta-arm
  4. For meta-openembedded : git submodule add https://github.com/openembedded/meta-openembedded.git
  5. For meta-ti: It was forked from https://github.com/YoeDistro/meta-ti because actual TI repository is available under Gitlab. The command is git submodule add git@github.com:sujoyray-ucolorado/meta-ti-aesd-project.git

Modifications made to meta-ti layer

Below are the modifications made into meta-ti layer to add a custom platform

  1. Under the conf/machine folder, following file was added /meta-ti-bsp/conf/machine/include/omapl138_aesd_proj.inc This file has been referred by various conf files.

  2. The actual configuration file has been added under conf/machine /meta-ti-bsp/conf/machine/omapl138-aesd_proj.conf

  3. In order to build U-BOOT following .bb file was added /meta-ti-bsp/recipes-bsp/u-boot/uboot-aesd-proj_git.bb

  4. To build Linux kernel, following .bb file was added /meta-ti-bsp/recipes-bsp/u-boot/uboot-aesd-proj_git.bb

Why it has been done this way?

  1. meta-ti layer was designed for TI EVM board.
  2. It has various other components, such as LCD etc. which are not relevant for the project.

Couple of important changes

  1. The yocto build system is not appending device tree at the end of uIMage. Below were the changes need in in linux recipe to add devicetree along with uImage

uboot_prep_kimage:append () {
    # This function is defined in kernel-devicetree.class
    dtb_file=`get_real_dtb_path_in_kernel "${KERNEL_DEVICETREE}"`

    mv linux.bin linux-orig.bin
    cat linux-orig.bin "${dtb_file}" > linux+dtb.bin
    ln -s linux+dtb.bin linux.bin
}

2. If uImage is the desired output, please customize below variables to match your board
UBOOT_ENTRYPOINT = "0xc0008000"
UBOOT_LOADADDRESS = "0xc0008000"
UIMAGE_LOADADDR = "0xc0008000"
KERNEL_IMAGE_COMPRESSION = ""
KERNEL_COMPRESSION_LEVEL = "0"

KERNEL_IMAGETYPES = "zImage uImage"
KERNEL_CLASSES += "kernel-uimage"

Relevant pages

  1. Detailed video: Please refer: https://user-images.githubusercontent.com/111943882/235355265-93f321fa-97fc-4f9b-8c9d-72c79401cb62.mp4
  2. The project overview: Please refer: https://github.com/cu-ecen-aeld/final-project-sujoyray-ucolorado/wiki/ARM-Azure-Cloud-Storage-Gateway
  3. Full implementation: https://github.com/sujoyray-ucolorado/final_project_AM1808_yocto