Difference between revisions of "IoTGateway/BSP/Linux/AM57xx/AM57xx User Guide"

From ESS-WIKI
Jump to: navigation, search
Line 33: Line 33:
 
 
 
 
  
== <span style="color:#0070c0">Build Steps</span> ==
+
== <span style="color: rgb(0, 112, 192);">Build Steps</span> ==
  
 
The following example shows how to download the Advantech Yocto BSP from GitHub.
 
The following example shows how to download the Advantech Yocto BSP from GitHub.
Line 40: Line 40:
  
 
Please download a script from the SDK download page and then execute it on your host to fetch all the packages from TI servers. For example, see am57xx-evm-linux-sdk-arago-src-03.03.00.04.tar.xz file in AM57xx-Linux-SDK-Download-page. Once this package is downloaded, there are just a few extra steps in the build process to fetch all the corresponding packages.
 
Please download a script from the SDK download page and then execute it on your host to fetch all the packages from TI servers. For example, see am57xx-evm-linux-sdk-arago-src-03.03.00.04.tar.xz file in AM57xx-Linux-SDK-Download-page. Once this package is downloaded, there are just a few extra steps in the build process to fetch all the corresponding packages.
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ sudo chown adv:adv -R yocto_bsp</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ cd yocto_bsp/</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ mkdir tisdk</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ cd tisdk/</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ repo init -u [git://github.com/ADVANTECH-Corp/adv-ti-yocto-bsp.git git://github.com/ADVANTECH-Corp/adv-ti-yocto-bsp.git]&nbsp;-b processor-sdk-03.01.00.06</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ repo sync</div>
+
<div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ sudo chown adv:adv -R yocto_bsp</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ cd yocto_bsp/</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ mkdir tisdk</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ cd tisdk/</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ repo init -u [git://github.com/ADVANTECH-Corp/adv-ti-yocto-bsp.git git://github.com/ADVANTECH-Corp/adv-ti-yocto-bsp.git]&nbsp;-b processor-sdk-03.01.00.06</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ repo sync</div>
 
Due to lots of company firewalls/proxies only permitting HTTP traffic this is what our default repo manifest is using. At times the loading of repository server might be too heavy or for other reasons. You may be experience the following issues:
 
Due to lots of company firewalls/proxies only permitting HTTP traffic this is what our default repo manifest is using. At times the loading of repository server might be too heavy or for other reasons. You may be experience the following issues:
  
Line 50: Line 50:
  
 
cd .repo/projects/sources/meta-arago.git
 
cd .repo/projects/sources/meta-arago.git
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px">git gc</div>
+
<div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">git gc</div>
 
If the error(s) persist try removing your local git/repo cache before attempting to sync again, e.g. if the error indicates an issue in the meta-openembedded repository:
 
If the error(s) persist try removing your local git/repo cache before attempting to sync again, e.g. if the error indicates an issue in the meta-openembedded repository:
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px">rm -rf .repo/projects/sources/meta-arago.git</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">rm -rf .repo/project-objects/meta-arago.git.git</div>
+
<div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">rm -rf .repo/projects/sources/meta-arago.git</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">rm -rf .repo/project-objects/meta-arago.git.git</div>
 
Additionally you can limit the number of git repositories which are downloaded in parallel by using the additional parameter "-jX". e.g. to download one repository at a time:
 
Additionally you can limit the number of git repositories which are downloaded in parallel by using the additional parameter "-jX". e.g. to download one repository at a time:
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px">repo sync -j1</div>
+
<div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">repo sync -j1</div>
 
Additionally the following tweak to your IP settings maybe helpful:
 
Additionally the following tweak to your IP settings maybe helpful:
  
Line 62: Line 62:
  
 
<remote fetch="[git://git.arago-project.org git://git.arago-project.org]" name="meta-arago"/>
 
<remote fetch="[git://git.arago-project.org git://git.arago-project.org]" name="meta-arago"/>
<div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ ./oe-layertool-setup.sh</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ mkdir downloads</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ # You should already have downloaded CCS via web browser.&nbsp; Assuming location at ~/Downloads.</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ cp $HOME/Downloads/CCS6.1.3.00034_linux.tar.gz downloads/</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ touch downloads/CCS6.1.3.00034_linux.tar.gz.done</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ cd build</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ . conf/setenv</div><div style="background:#eee; border:1px solid #ccc; padding:5px 10px">$ MACHINE=MACHINE-NAME bitbake arago-core-tisdk-image</div>
+
<div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ ./oe-layertool-setup.sh</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ mkdir downloads</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ # You should already have downloaded CCS via web browser.&nbsp; Assuming location at ~/Downloads.</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ cp $HOME/Downloads/CCS6.1.3.00034_linux.tar.gz downloads/</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ touch downloads/CCS6.1.3.00034_linux.tar.gz.done</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ cd build</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ . conf/setenv</div><div style="background: rgb(238, 238, 238); padding: 5px 10px; border: 1px solid rgb(204, 204, 204);">$ MACHINE==&lt;machine&gt; bitbake arago-core-tisdk-image</div>
 
&nbsp;
 
&nbsp;
  

Revision as of 14:36, 21 December 2017

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 require 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.

 

Getting Start

Prerequisites

Host Setup

Generally,to do Linux development, you’ll need a host PC running Linux. In the development with the advantech SDK, it would be strongly recommend to use Ubuntu 12.04 LTS 64 bit/ Ubuntu 14.04 LTS 64 bit as developing environment. Because we have successfully tested our BSP on these OS version. Please install the Ubuntu 12.04 LTS 64 bit / Ubuntu 14.04 LTS 64 bit at your PC/NB in advance.

Code Composer Studio

Code Composer Studio 6.1.3.00034 must be downloaded manually since you need to fill out a form related to export control. Please download the Linux off-line installation tarball, e.g., CCS6.1.3.00034_linux.tar.gz, from CCS v6 Downloads. For starters, just use your web browser to download the file to $HOME/Downloads.

Docker install and setting

If you don't have docker in your system, then you can follow the below  steps to install docker and run it first.

To install Docker Engine on your platform

Please refer to Docker Installation Guide for details

To pull ubuntu 14.04 image from Docker Hub

$ docker pull advrisc/u14.04-am57lbv1

To create container

$ docker run -it --name ${CONTAINER_NAME} -v ${WORKSPACE}:yocto_bsp:rw advrisc/u14.04-am57lbv1 /bin/bash

 

Build Steps

The following example shows how to download the Advantech Yocto BSP from GitHub.

For this example, a directory called yocto_bsp is created for the project.

Please download a script from the SDK download page and then execute it on your host to fetch all the packages from TI servers. For example, see am57xx-evm-linux-sdk-arago-src-03.03.00.04.tar.xz file in AM57xx-Linux-SDK-Download-page. Once this package is downloaded, there are just a few extra steps in the build process to fetch all the corresponding packages.

$ sudo chown adv:adv -R yocto_bsp
$ cd yocto_bsp/
$ mkdir tisdk
$ cd tisdk/
$ repo init -u git://github.com/ADVANTECH-Corp/adv-ti-yocto-bsp.git -b processor-sdk-03.01.00.06
$ repo sync

Due to lots of company firewalls/proxies only permitting HTTP traffic this is what our default repo manifest is using. At times the loading of repository server might be too heavy or for other reasons. You may be experience the following issues:

 23456789.png

First just try repo syncing again it might just have been a connection glitch.

Then, if the error(s) persist try using git's garbage collection on the failing repository before attempting to sync again, e.g. if the error indicates an issue in the meta-openembedded repository:

cd .repo/projects/sources/meta-arago.git

git gc

If the error(s) persist try removing your local git/repo cache before attempting to sync again, e.g. if the error indicates an issue in the meta-openembedded repository:

rm -rf .repo/projects/sources/meta-arago.git
rm -rf .repo/project-objects/meta-arago.git.git

Additionally you can limit the number of git repositories which are downloaded in parallel by using the additional parameter "-jX". e.g. to download one repository at a time:

repo sync -j1

Additionally the following tweak to your IP settings maybe helpful:

sudo sysctl -w net.ipv4.tcp_window_scaling=0

If your Internet connection permits you might also try switching those failing repositories to using the git protocol instead by modifying your .repo/manifest.xml as follows:

<remote fetch="git://git.arago-project.org" name="meta-arago"/>

$ ./oe-layertool-setup.sh
$ mkdir downloads
$ # You should already have downloaded CCS via web browser.  Assuming location at ~/Downloads.
$ cp $HOME/Downloads/CCS6.1.3.00034_linux.tar.gz downloads/
$ touch downloads/CCS6.1.3.00034_linux.tar.gz.done
$ cd build
$ . conf/setenv
$ MACHINE==<machine> bitbake arago-core-tisdk-image

 

Processor SDK Build Reference

The following sections provide information for configuration, build options, and supported platforms of the Processor SDK.

Layer Configuration

Processor SDK uses the following oe-layersetup configs to configure the meta layers.

$ ./oe-layersetup.sh

 

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-tisdk-image

images/<machine>/processor-sdk-linux-image-<machine>.tar.xz

Full SDK

tisdk-rootfs-image

images/<machine>/tisdk-rootfs-image-<machine>.tar.xz

Target Filesystem

u-boot-ti-staging

images/<machine>/u-boot-<machine>.img

images/<machine>/MLO-<machine>

u-boot

linux-processor-sdk

images/<machine>/zImage-<machine>.bin

images/<machine>/zImage-<machine>.dtb

kernel

 

Platforms

The following platforms are supported in Processor SDK. These are the <machine> in the command:

MACHINE==<machine> bitbake <target>


MACHINE

Supported Product

am57xxrom7510a1

ROM-7510A1

am57xxrom7510a2

ROM-7510A2

 

Command

Build command

MACHINE=<machine> bitbake <target>

Take uboot as an example:

MACHINE=am57xxrom7510a2 bitbake u-boot-ti-staging

The MLO and u-boot.img will be located in the directory, ./arago-tmp-external-linaro-toolchain/deploy/images/am57xxrom7510a2.

When the target is arago-core-tisdk-image, MLO,u-boot.img,zImage, devicetree file, filesystem and full SDK will compiled.

 

To modify source code and rebuild u-boot

When needed, source code under the work directory (e.g.,arago-tmp-external-linaro-toolchain/work/am57xxrom7510a2-linux-gnueabi/u-boot-ti-staging/2016.05+gitAUTOINC+87ffcd71d0-r14/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 <target> --force -c compile

MACHINE=<machine> bitbake <target>

Take uboot as an example:

MACHINE=am57xxrom7510a2 bitbake u-boot-ti-staging --force -c compile

MACHINE=am57xxrom7510a2 bitbake u-boot-ti-staging

 


Cleaning Built Recipe

A built recipe can be cleaned using:

MACHINE=<machine> bitbake <target> -c cleansstate

Take uboot as an example:

MACHINE=am57xxrom7510a2 bitbake u-boot-ti-staging -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.

==  

 

==

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 opencl recipe and all the dependencies it defines.

MACHINE=am57xxrom7510a1 bitbake opencl

After the bitbake command above is successfully done, arago-tmp-[toolchain]/work/am57xx_evm-linux-gnueabi/opencl 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/am57xx_evm-linux-gnueabi/opencl/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=am57xxrom7510a1 bitbake opencl --force -c compile
MACHINE=am57xxrom7510a1 bitbake opencl

Installing Package

To install a modified and rebuilt package, copy the new IPKs from the deploy-ipks folder (e.g., arago-tmp-[toolchain]/work/am57xx_evm-linux-gnueabi/opencl/[version]/deploy-ipks) to the target system and then run the following command to install the IPKs:

opkg install [package_ipk].ipk

Common Variations

Rebuilding without SGX

In Processor SDK delivered today the graphics hardware acceleration is enabled by default for device families with SGX (e.g. AM335x, AM437x, AM57xx). As a result, some of the applications with graphics dependencies will not run properly on device variants in those families that do not contain the SGX accelerator (e.g. AM3352, AM4372, etc.). The Processor SDK has been enhanced to provide the same OOB experience with software rendering provided by QT5/Weston. The non-SGX software rendering build will be enabled by adding the following to the bottom of conf/local.conf immediately before invoking bitbake.

MACHINE_FEATURES_remove=”sgx”

Rebuilding without Wayland

If a full Window system is not needed, i.e. if you simply want apps to run full screen using EGLFS then you can remove Wayland by adding the following to the bottom of conf/local.conf immediately before invoking bitbake:

DISTRO_FEATURES_remove = "wayland"