Building Torizon OS for i.MX 8M Plus NAVQ+
1. Overview
This page describes how to build the Torizon OS for the i.MX 8M PLus NAVQ+ board
2. Understanding Build Structure
The base principles for building Torizon OS for the NAVQ+ architecture are the same as for the other targets described in the official Torizon OS documentation: Build Torizon OS from Source With Yocto Project/OpenEmbedded | Toradex Developer Center.
The main difference is that the NAVQ+ build requires additional meta-layer:
meta-emcraft-torizon-nxp
- the NAVQ+ BSP layer for Torizon OS developed by Emcraft.
What follows is the instructions on how to integrate this layer in to the general Torizon OS Yocto project and then build Torizon OS for the NAVQP target.
3. Preparing BSP for Build
Perform the following steps:
Set up the default
git
user and e-mail:$ git config --global user.email "you@example.com" $ git config --global user.name "Your Name"
Install the
repo
utility to the development host:$ mkdir ~/bin $ PATH=~/bin:$PATH $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo
Create a working directory for the Yocto build, go into that directory:
$ cd ~ $ mkdir ~/yocto-workdir $ cd ~/yocto-workdir
Initialize the Torizon OS reposiotiy:
$ repo init -u git://git.toradex.com/toradex-manifest.git -b refs/tags/7.0.0 -m torizon/default.xml
Sync the repositories:
$ repo sync
Download the NAVQ+ BSP layer:
$ git -C layers clone -b scarthgap git@github.com:EmcraftSystems/meta-emcraft-torizon-nxp.git
Replace the setup environment link:
$ ln -sf layers/meta-emcraft-torizon-st/scripts/setup-environment setup-environment
4. Building BSP Images
Perform the following steps:
Use the Docker container provided by Toradex to setup the build environment in the work directory
~/yocto-workdir
prepared in previous steps:$ docker run --rm -it --name=crops -v ~/yocto-workdir:/workdir --workdir=/workdir torizon/crops:scarthgap-7.x.y /bin/bash
In the Docker console set up the environment for a specific board:
MACHINE=<MACHINE> source setup-environment [BUILDDIR]
, whereMACHINE
is one of the supported targets:imx8mp-navqp
for the i.MX 8M Plus NAVQ+ boardBUILDDIR
is the directory where you would like to to store the build files. For example:$$ MACHINE=imx8mp-navqp DISTRO=torizon source setup-environment build-imx8mp-navqp
Repeat the step of configuring the Git user name and email (this is only needed on the first build from scratch):
$$ git config --global user.email "you@example.com" $$ git config --global user.name "Your Name"
Build the Torizon OS images:
$$ bitbake torizon-docker
Build the wic image for EMMC:
$$ wic create imx8mp-navqp-sota -e torizon-docker
5. Understanding Build Outcome
When the build has successfully completed, the following build artifacts located in the $BUILDDIR/deploy/images/$MACHINE
can be used to install Torizon OS to the target board:
imx-boot
- the bootloader image:torizon-docker-<MACHINE>.ota-ext4
- main Torizon OS OSTree based image, including the Linux kernel images and the root file system.
The result of the wic create
command will be the image imx8mp-navqp-sota.wks-<timestamp>-mmcblk.direct
ready to be installed to the target board using uuu
(refer to https://voxelbotics.atlassian.net/wiki/spaces/DOC/pages/807436293/Installing+Torizon+OS+to+i.MX+8MPlus+NAVQ+Target)