The NXP NavQPlus Mobile Robotics companion computer is typically used alongside a flight or vehicle controller. The NavQPlus features a powerful MPU, enabling it to run sophisticated vision and AI/ML applications.
The computer includes the main interfaces commonly used in mobile robotics applications. The NavQPlus Computer ships with an Ubuntu image that doesn’t include the latest drivers and software packages available for NXP’s i.MX8M Plus SoCs.
Yocto is the most widely used embedded Linux build environment and is vendor-independent. All software packages for an embedded Linux system are built from source.
Personally, I prefer a Yocto build for embedded systems. I will demonstrate how to develop your own custom Yocto build based on NXP’s GitHub repository.
To maintain a unified build system, we will use Docker to build a toolbox containing all the tools necessary for building an NXP Yocto image. This approach ensures that our build environment has the tested and recommended versions of GCC, Python, CMake, etc.
Requirements
- The NavQPlus companion computer
- A Linux machine with a working docker installation
Initial
Download the attached project / source code files. Set the TRD_HOME pointing to the project root:
export TRD_HOME=$PWD
Building the Toolbox with Docker
First we create the Docker Image with the provided Dockerfile. This image contains all the necessary software packages for building NXP yocto images.
cd $TRD_HOME/docker
docker build -t avs-nxp-toolbox --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f ./Dockerfile .
We start the container with the freshly built image and mount our project root folder into the container.
docker run -it --rm --hostname avs-nxp-toolbox -v $TRD_HOME:/mnt/ avs-nxp-toolbox bash
Building the Yocto Images in the container environment
In the container bash we will pull the official NXP yocto repo:
cd /mnt/
export TRD_HOME=$PWD
mkdir $TRD_HOME/work && cd $TRD_HOME/work
git config --global user.email "you@example.com"
git config --global user.name "I am a customer of Silica and I love to be one"
repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-scarthgap -m imx-6.6.23-2.0.0.xml
repo sync
The repo command pulls all the necessary layers for building a yocto based linux image for the official NXP eval kits. The NavQPlus board is not yet part of the nxp repos. Thus we add our custom meta-layer, which adds the necessary changes, to our yocto build and start the minimal target:
EULA=1 MACHINE=imx8mpevk DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b bld-xwayland
echo BBLAYERS += \"$TRD_HOME/meta-avs/\" >> conf/bblayers.conf
sed -i -e 's|imx8mpevk|imx8mp-navq|g' conf/local.conf
sed -i -e 's|??||g' conf/local.conf
bitbake core-image-minimal
Before the built we enable the Avnet-Silica layer were modify the basis NXP BSP. After the built process you will find all images in
/mnt/work/bld-xwayland/tmp/deploy/images/
or on the host file-system in
$TRD_HOME/work/bld-xwayland/tmp/deploy/images
Preparing the SD Card and running the system
The easiest way it to use the wic image as it already contains a valid partition layout and u-boot is already part of the image.
sudo dd if=$TRD_HOME/work/bld-xwayland/tmp/deploy/images/core-image-minimal-imx8mpevk.rootfs-20240821152350.wic of=/dev/sda bs=4M status=progress
Attention: check the of=/ parameter otherwise you can kill your host system.
Insert the SD Card Image to the NavQPlus and power it. You should see your freshly built Linux system in action.
Comments
Please log in or sign up to comment.