1.2. Building the SDK with Yocto¶
1.2.1. Introduction¶
This page provides the steps to build the Processor SDK and individual components from source. The Processor SDK build is based on the Arago Project which provides a set of layers for OpenEmbedded and the Yocto Project targeting TI platforms.
This page will provide the basic steps required to recreate the Processor SDK along with a reference of Processor SDK specific configurations, build targets, and target devices. Also, tips and suggestions are provided along with links for more in-depth information.
1.2.2. Quick Start¶
1.2.2.1. Prerequisites (One-time setup)¶
Host Setup - Ubuntu (Recommended)
The recommended Linux distribution is Ubuntu 18.04.
The following build host packages are required for Ubuntu. The following command will install the required tools on the Ubuntu Linux distribution.
For Ubuntu 18.04, please run the following:
$ sudo apt-get install build-essential autoconf \
automake bison \
flex libssl-dev bc u-boot-tools \
python diffstat \
texinfo gawk chrpath dos2unix \
wget unzip socat doxygen libc6:i386 \
libncurses5:i386 libstdc++6:i386 \
libz1:i386 g++-multilib \
git python3-distutils python3-apt
By default Ubuntu uses “dash” as the default shell for /bin/sh. You must reconfigure to use bash by running the following command:
sudo dpkg-reconfigure dash
Be sure to select “No” when you are asked to use dash as the default system shell.
Large Swap File
Building large packages, especially several at a time, requires a lot of working memory for a computer. For computers with 32 GB or RAM or more, this should not be a problem. For computers with less RAM, a swap file of ~16GB may be needed to build large packages. Creating a large swap file, or resizing a small swap file to be larger will help avoid build errors for large packages.
Proxy Setup
If working behind a proxy, please see Working Behind a Network Proxy.
Cross-Compile Toolchain
Run the following commands to install the ARM Toolchains. Note that the <PATH_TO_TOOLCHAIN> used here needs to be provided to the TOOLCHAIN_BASE variable when running the bitbake command, as shown in the ‘Build Steps’ section below.
cd <PATH_TO_TOOLCHAIN>
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz
tar -Jxvf gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
tar -Jxvf gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
Note
For building all SDK components, you need two compilers. ARMv8 for software running on A72 ARMv7 for software running on R5F Make sure to download both of these toolchains before starting yocto build.
1.2.2.2. Build Steps¶
Please refer to here for the layer configuration for a particular release of Processor SDK Linux. The MACHINE can be set to j7-evm, for example.
Processor SDK Linux J721e uses the ‘oe-layersetup’ tool to configure the meta layers. If you do not have the Linux SDK package installed:
git clone https://git.ti.com/git/arago-project/oe-layersetup.git yocto-build
cd yocto-build
The Linux SDK package also has the above tool cloned at the top level. If you have it installed:
cd <SDK INSTALL DIR>/yocto-build
Then run following commands to setup a yocto build for a specific release version and build the ‘tisdk-default-image’ target.
./oe-layertool-setup.sh -f configs/processor-sdk-linux/processor-sdk-linux-<version>.txt
cd build
echo "ARAGO_BRAND = \"psdkla\"" >> conf/local.conf
echo "DISTRO_FEATURES_append = \" virtualization\"" >> conf/local.conf
. conf/setenv
TOOLCHAIN_BASE=<PATH_TO_TOOLCHAIN> MACHINE=<machine> bitbake -k tisdk-default-image
Note
The build will ~250GB of hard disk space for building the tisdk-default-image.
Building for a HS platform
To build for an HS platform, bitbake needs to know the location of the secdev utilities. Obtain it with the following:
$ git clone https://git.ti.com/git/security-development-tools/core-secdev-k3.git -b master $ export TI_SECURE_DEV_PKG=`pwd`/core-secdev-k3
Then let bitbake know the location by adding TI_SECURE_DEV_PKG_K3=$TI_SECURE_DEV_PKG to the list of environment variables before the bitbake command.
1.2.3. Processor SDK Build Reference¶
The following sections provide information for configuration, build options, and supported platforms of the Processor SDK.
1.2.3.1. Layer Configuration¶
Please refer to here for the layer configuration for a particular release of Processor SDK Linux.
1.2.3.2. Build Options¶
Images
In addition to individual components packages, the following table provides a list of build targets supported. These are the <target> used in the command:
MACHINE=<machine> bitbake <target>
The “Build Output” is given relative to the arago-tmp-[toolchain]/deploy directory.
Target | Build Output | Description |
---|---|---|
arago-core-psdkla-bundle | images/<machine>/arago-core-psdkla-bundle-<machine>.tar.xz | Full SDK |
tisdk-edgeai-image | images/<machine>/tisdk-edgeai-image-<machine>.tar.xz | Target Edge AI Filesystem |
tisdk-default-image | images/<machine>/tisdk-default-image-<machine>.tar.xz | Target Filesystem |
tisdk-base-image | images/<machine>/tisdk-base-image-<machine>.tar.xz | Minimal Target Filesystem |
Platforms
Please refer to here for the yocto build platforms supported in Processor SDK Linux J721e. These are the <machine> used in the command:
MACHINE=<machine> bitbake <target>
RT Support
Run the commands below, before the bitbake build command, to setup a yocto build with RT Linux Kernel:
echo "ARAGO_RT_ENABLE = \"1\"" >> conf/local.conf
echo "ARAGO_RT_ENABLE_linux-rt = \"1\"" >> conf/local.conf
1.2.3.3. Recipes¶
Recipe Basics
One or more recipes can be specified for the <target> for greater granularity of recipe development and debug. Specifying a recipe name, minus the version (if the version is appended to the name), will build the recipe and all its dependencies.
For example, the command below builds only the jailhouse recipe and all the dependencies it defines.
MACHINE=<machine> bitbake jailhouse
After the bitbake command above is successfully done, arago-tmp-[toolchain]/work/<machine>-linux/jailhouse directory will be available including the original source code under the git folder, independent shared objects (.so files) under packages-split folder, and IPKs under deploy-ipks folder.
Note
Please note that the output of a recipe can be in another folder under “arago-tmp-[toolchain]/work” directory, depending on the defines of the recipe.
Forced Re-compilation
When needed, source code under the work directory (e.g., arago-tmp-[toolchain]/work/<machine>-linux/jailhouse/git) can be modified. After the modification is done, run the following commands to force recompilation with the new code and rebuilding of the recipe, e.g.,
MACHINE=<machine> bitbake jailhouse --force -c compile
MACHINE=<machine> bitbake jailhouse
Installing Package
To install a modified and rebuilt package, copy the new IPKs from the deploy-ipks folder (e.g., arago-tmp-[toolchain]/work/<machine>-linux/jailhouse/[version]/deploy-ipks) to the target system and then run the following command to install the IPKs:
opkg install [package_ipk].ipk
Cleaning a Built Recipe
A built recipe can be cleaned using:
MACHINE=<machine> bitbake <target> -c cleansstate
The cleansstate task will clean recipe’s work directory and remove the recipe’s output from the dependency tree used by other recipe’s during compilation.
1.2.4. Common Variations¶
N/A
1.2.5. See also¶
General information on Yocto, OpenEmbedded and Arago projects can be found at: