Building TI/Embedian’s Yocto BSP Distribution
Eric Lee
version 1.0a, 2/07/2016
Introduction
This document describes how Embedian builds a customized version of TI's AM3354 official BSP release for Embedian's SMARC-T3354 product platform. The approach is to pull from Embedian's public facing GIT repository and build that using bitbake. The reason why we use this approach is that it allows co-development. The build output is comprised of binary images, feed packages, and an SDK for SMARC-T3354 specific development.
TI makes their Processor-SDK-02.00.01.07 Arago build scripts available via the following GIT repository:
If you’re interested in TI’s overall Processor SDK build and test process you should analyze the following repository:
It is this repository that actually pulls in the oe-layersetup project to perform the Linux Processor-SDK builds for TI’s entire suite of ARM CortextA chips. In this document we are only concerned with the oe-layersetup project.
Generating SSH Keys
We recommend you use SSH keys to establish a secure connection between your computer and Embedian Gitlab server. The steps below will walk you through generating an SSH key and then adding the public key to our Gitlab account.
Step 1. Check for SSH keys
First, we need to check for existing ssh keys on your computer. Open up Git Bash and run:
Check the directory listing to see if you have a file named either id_rsa.pub
or id_dsa.pub
. If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.
Step 2. Generate a new SSH key
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
Now you need to enter a passphrase.
Which should give you something like this:
Step 3. Add your SSH key to Embedian Gitlab Server
Copy the key to your clipboard.
Go to Embedian Git Server. At Profile Setting --> SSH Keys --> Add SSH Key
Paste your public key and press "Add Key" and your are done.
Overview of the meta-smarct335x-sdk-02.00.01.07 Yocto Layer
The supplied meta-embedian-sdk7 Yocto compliant layer has the following organization:
Notes on meta-smarct335x-sdk-02.00.01.07 layer content
conf/machine/*
This folder contains the machine definitions for the smarct335x platform and backup repository in Embedian. These select the associated kernel, kernel config, u-boot, u-boot config, and UBI image settings.
recipes-bsp/u-boot/*
This folder contains recipes used to build DAS U-boot for smarct335x platform.
recipes-connectivity/lftp/*
This folder adds lftp ftp client utility for smarct335x platform.
recipes-core/base-files/*
This recipe is used to amend the device hostname for the platform.
recipes-core/busybox/*
This recipe modifies TI’s BusyBox configuration to remove telnet from the image.
recipes-core/images/*
These recipes are used to create the final target images for the devices. When you run Bitbake one of these recipes would be specified. For example, to build the root file system for the smarct335x platform:
recipes-core/init-ifupdown*
This recipe is used to amend device network interfaces
recipes-devtools/nodejs/*
These recipes build the Node.js Javascript server execution environment.
recipes-kernel/linux/*
Contains the recipes needed to build the smarct335x Linux kernels.
recipes-support/boost/*
Adds Boost to the images. Boost provides various C++ libraries that encourage cross-platform development.
recipes-support/ntp/*
Network time protocol support.
recipes-tisdk/ti-tisdk-makefile/*
Add smarct335x device tree into Makefile.
Setting Up the Tools and Build Environment
To build the latest TI AM335X Processor-SDK-02.00.01.07, you first need an 64-bit Unbuntu Linux 12.04LTS or Ubuntu 14.04LTS installation because of support for 32-bit host is dropped as Linaro toolchain is available only for 64-bit machines. A x86_64 ubuntu 14.04 is highly recommended. Since bitbake does not accept building images using root privileges, please do not login as a root user when performing the instructions in this section.
Once you have Ubuntu 12.04 LTS or Ubuntu 14.04LTS running, install the additional required support packages using the following console command:
If you are using a 64-bit Linux, then you'd also need to install 32-bit support libraries, needed by the pre-built Linaro toolchain and other binary tools.
You’ll also need to change the default shell to bash from Ubuntu’s default dash shell (select the <No> option):
To build TI’s am335x Processor-SDK-02.00.01.07 you will need to install the Linaro arm compiler that TI used for the release:
PATH
definition to the .bashrc
file in your $HOME
directory:
meta-smarct335x-sdk-02.00.01.07
layer to the build process.
Building the target platforms
To build the Embedian SMARC-T335X developer board images, respectively, use the following commands:
Once it done, you can find all required images under ~/smarct3x-processor-sdk-02.00.01.07/build/arago-tmp-external-linaro-toolchain/deploy/images/smarct335x/
You may want to build programs that aren’t installed into a root file system so you can make them available via a feed site (described below.) To do this you can build the package directly and then build the package named package-index to add the new package to the feed site.
The following example builds the minicom program and makes it available on the feed site:
~/smarct3x-processor-sdk-02.00.01.07/build/arago-tmp-external-linaro-toolchain/deploy/
deploy/images/smarct335x/*
This folder contains the binary images for the root file system and the Embedian SMARC-T335X specific version of the am335X SDK. Specifically the images are:
deploy/images/smarct335x/u-boot.img
This u-boot bootloader binary for SMARC T335X
deploy/images/smarct335x/MLO
The "Stage 1 Boot Loader" for SMARC-T335X. Its purpose is load the Stage 2 Boot Loader (u-boot.img).
deploy/images/smarct335x/zImage
The kernel zImage for SMARC-T335X.
deploy/images/smarct335x/zImage-am335x-smarct335x.dtb
The device tree binary file for SMARC-T335X.
deploy/images/smarct335x/smarct335x-rootfs-image-smarct335x*
Embedian root file system images for software development on Embedian’s SMARC-T335X platforms.
deploy/ipk/*
This folder contains all the packages used to construct the root file system images. They are in opkg format (similar format to Debian packages) and can be dynamically installed on the target platform via a properly constructed feed file. Here is an example of the feed file (named base-feeds.conf) that is used internally at Embedian to install upgrades onto a smarct335x platform without reflashing the file system:
deploy/licenses/*
deploy/sdk/arago-2015.12-cortexa9-linux-gnueabi-tisdk.sh
Setup SD Card
For these instruction, we are assuming: DISK=/dev/mmcblk0, "lsblk" is very useful for determining the device id.
Erase SD card:
Create Partition Layout:
Format Partitions:
Mount Partitions:
On some systems, these partitions may be auto-mounted...
Install Bootloader
Copy MLO/u-boot.img to the boot partition
uEnv.txt based bootscript
Create "uEnv.txt" boot script: (vim uEnv.txt)
Install Kernel zImage
Copy zImage to the boot partition:
Install Kernel Device Tree Binary
Install Root File System and Kernel Modules
Remove SD card:
Setup eMMC
-- To be Continued --
version 1.0a, 1/26/2016
Last updated 2016-02-01