/
Building Torizon OS for i.MX 8M Plus NAVQ+

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:

  1. 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:

  1. Set up the default git user and e-mail:

    $ git config --global user.email "you@example.com" $ git config --global user.name "Your Name"
  2. 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
  3. Create a working directory for the Yocto build, go into that directory:

    $ cd ~ $ mkdir ~/yocto-workdir $ cd ~/yocto-workdir
  4. 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
  5. Sync the repositories:

    $ repo sync
  6. Download the NAVQ+ BSP layer:

    $ git -C layers clone -b scarthgap git@github.com:EmcraftSystems/meta-emcraft-torizon-nxp.git
  7. 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:

  1. 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
  2. In the Docker console set up the environment for a specific board: MACHINE=<MACHINE> source setup-environment [BUILDDIR], where MACHINE is one of the supported targets:
    imx8mp-navqp for the i.MX 8M Plus NAVQ+ board
    BUILDDIR 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
  3. 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"
  4. Build the Torizon OS images:

    $$ bitbake torizon-docker
  5. 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:

  1. imx-boot - the bootloader image:

  2. 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)