Yocto Compilation For Rugged Board i.MX6UL

Objective:

This guide describes a method of compiling the yocto for the Rugged Board i.MX6UL.

Materials:

Hardware:

Software:

  • Ubuntu 20.04 64Bit

Procedure:

The following list shows what you need in order to use a Linux-based build host to use the Yocto Project to build images:

  • Build Host A build host with a minimum of 50 Gbytes of free disk space that is running a supported Linux distribution (i.e. recent releases of Fedora, openSUSE, CentOS, Debian, or Ubuntu).

  • Build Host Packages Appropriate packages installed on the build host.

HOST Machine setup:

UBUNTU 20.04 is preferred. Install the below per-requisite packages

Ubuntu and Debian:

$ sudo apt-get update 
$ sudo apt-get -y install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat
$ sudo apt-get -y install cpio python3 python3-pip python3-pexpect xz-utils debianutils
$ sudo apt-get -y install iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev
$ sudo apt-get -y install pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool

Source Downloading:

Step-1: Create a directory to download the all layers.

$ mkdir ~/yocto
$ cd ~/yocto

Step-2: Download the PHYTEC BSP Management tool to setup the PHYTEC Yocto.

$ wget ftp://ftp.phytec.de/pub/Software/Linux/Yocto/Tools/phyLinux

Step-3: Provide the execution permission for the above tool and run to initialize the Yocto setup

$ chmod +x phyLinux
$ ./phyLinux init

Step-4: While initializing the repo for Yocto source, we need to select the following option

# Select the SOC platform as" imx6ul"

# Choose "BSP-Yocto-Ampliphy-i.MX6UL-PD21.2.1" from the available releases  

# Select the below one from the available builds : 

    phyboard-segin-imx6ul-2: PHYTEC phyBOARD-Segin i.MX6 UltraLite 
                             512MB RAM, NAND
                             PB-02013-001.A2, PB-02013-110I.A2, PCL-063-23300CI.A2
                             distro: ampliphy
                             target: phytec-headless-image 
                             target: phytec-qt5demo-image
  • Now the YOCTO SOURCE CODE is downloaded.

Note:

  • If not possible to select above version please follow the bellow commands :

yocto$ git config --global user.email"subhransu.s@phytecembedded.in"
yocto$ git config --global user.name "Subhransu-Swain"
yocto$ python3 /usr/local/bin/repo init--repo-url=https://git.phytec.de/git/git-repo --repo-branch=repo-1 -u git://git.phytec.de/phy2octo
yocto$ chmod +x /usr/local/bin/repo
yocto$ python3 /usr/local/bin/repo init
yocto$ sudo ln -sf /usr/bin/python3.8 /usr/bin/python
yocto$ ./phyLinux init

If you are not greeted by the option phyboard-segin-imx6ul-2 at the last stage. use the below command

yocto$ sudo ln -sf /usr/bin/python2 /usr/bin/python

Now you can select the available build

yocto$ ./phyLinux init

Configuring the Bitbake layers:

Step-1: Download the meta layer for RB-i.MX6UL

$ cd sources
$ git clone https://github.com/kishorephytec/meta-rbimx6ul.git

Step-2: Checkout the respective branch as per the downloaded release of the yocto source setup. In the above case, we have downloaded "BSP-Yocto-Ampliphy-i.MX6UL-PD21.2.1" release and hence "RB-PD21.2.1" branch has to be checked-out.

$ cd meta-rbimx6ul/
$ git checkout RB-PD21.2.1

Step-3: Configure the meta-rbimx6ul in the bblayers configuration

$ cd ../../
$ source sources/poky/oe-init-build-env
$ bitbake-layers add-layer ../sources/meta-rbimx6ul/
$ bitbake-layers add-layer ../sources/meta-rbimx6ul/meta-bsp/
$ bitbake-layers add-layer ../sources/meta-rbimx6ul/meta-core/
$ bitbake-layers add-layer ../sources/meta-rbimx6ul/meta-libraries/
$ bitbake-layers add-layer ../sources/meta-rbimx6ul/meta-services/
$ bitbake-layers add-layer ../sources/meta-rbimx6ul/meta-utils/

Step-4: Change the machine name in the conf/local.conf. Modify MACHINE ?= "phyboard- segin-imx6ul-2"to MACHINE ?= "ruggedboard-imx6ul"

$ vi conf/local.conf

With this, meta-rbimx6ul layer is configured.

Building and generating the Images :

After you downloaded all the metadata with phyLinux init, you have to set up the shell environment variables.

This needs to be done every time you open a new shell for starting builds. We use the shell script provided by Poky in its default configuration.

Step-1: Come back to root of your project, in our case "yocto".

$ cd ~/yocto

Step-2: Set-up the shell environment variables.

$ source sources/poky/oe-init-build-env

Step-3: Now you are ready to build your first image.

$ bitbake rb-qt5demo-image

Here, rb-qt5demo-image - Graphical images consisting Qt and Gstremer plugins and other graphic related Stacks and packages rb-headless-image - smaller non-graphical image.

More info and Documents can be found at https://www.phytec.in/software/board-support- packages/yocto-buildsystem/bsp-seite/?bsp=BSP-Yocto-Ampliphy-i.MX6UL-PD21.2.1

Last updated