Board description
The Compulab CL-SOM-iMX7 platform is a System on Modules (SoM) based on the NXP i.MX7 chip. The kit validated here is the IOT gateway device.
URL:
Test results
The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other Yocto Project releases:
Yocto Project | Build | Runtime |
---|---|---|
rocko (2.4) |
Build Means that the Yocto Project build using this Mender integration completes without errors and outputs images.
Runtime Means that Mender has been verified to work on the board. For U-Boot-based boards, the integration checklist has been verified.
Getting started
Prerequisites
- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Mega Manual
- NOTE. Instructions depend on which Yocto version you intend to use.
- Google repo tool installed and in your
PATH
.
Configuring the build
Setup Yocto environment
Set the Yocto Project branch you are building for:
# set to your branch, make sure it is supported (see table above)
export BRANCH="rocko"
Create a directory for your mender-compulab
setup to live in and clone the
meta information.
mkdir mender-compulab && cd mender-compulab
Initialize repo manifest:
repo init \
-u git://source.codeaurora.org/external/imx/imx-manifest.git \
-m imx-4.9.88-2.0.0_ga.xml \
-b imx-linux-rocko
mkdir .repo/local_manifests
cd .repo/local_manifests/
wget https://raw.githubusercontent.com/mendersoftware/meta-mender-community/rocko/meta-mender-compulab/scripts/manifest-compulab-local-manifest.xml
wget https://raw.githubusercontent.com/mendersoftware/meta-mender-community/rocko/scripts/mender-no-setup.xml
cd -
Fetch layers in manifest:
repo sync
cd .repo/local_manifests/
ln -sf ../../sources/meta-mender-community/meta-mender-compulab/scripts/manifest-compulab-local-manifest.xml .
ln -sf ../../sources/meta-mender-community/scripts/mender-no-setup.xml .
cd -
Setup build environment
Initialize the build environment:
MACHINE=cl-som-imx7
source fsl-setup-release.sh -b build
source ../sources/meta-compulab-bsp/tools/setup-compulab-env
cat ../sources/meta-mender-community/meta-mender-compulab/templates/bblayers.conf.append >> conf/bblayers.conf
cat ../sources/meta-mender-community/templates/local.conf.append >> conf/local.conf
cat ../sources/meta-mender-community/meta-mender-compulab/templates/local.conf.append >> conf/local.conf
Building the image
You can now proceed with building an image:
MACHINE=cl-som-imx7 bitbake core-image-base
Replace core-image-base
with your desired image target.
Using the build output
The first step is to build an SD Card with the stock image provided by Compulab. Download the archive and extract the file cl-som-imx7-yocto-linux/images/cl-som-imx7-image-qt5.sdcard.bz2. Write this file to an SD Card on your build host. WARNING, make sure you use the correct device node as the of= parameter to avoid overwriting the wrong device:
bzcat cl-som-imx7-image-qt5.sdcard.bz2 | sudo dd of=<SDCARD-DEVICE-NODE> bs=8M
Now, insert this SD Card into the target. Configure the target to boot from SD Card by adding a jumper to E2 on the system board. Power cycle your board and verify that it boots from SD Card:
U-Boot SPL 2017.07-cl-som-imx7-1.5 (Jan 10 2019 - 10:08:35)
Booting from SD card
Trying to boot from **MMC1**
U-Boot 2017.07-cl-som-imx7-1.5 (Jan 10 2019 - 10:08:35 +0200)
Once Linux has booted, log in as root with no password. Then verify that the root filesystem is /dev/mmcblk0p2 which is on the SD Card:
NXP i.MX Release Distro 4.9.88-2.0.0 cl-som-imx8 ttymxc2
cl-som-imx8 login: root
Last login: Tue Mar 5 23:27:32 UTC 2019 on ttymxc2
root@cl-som-imx8:~# mount | head -1
/dev/mmcblk0p2 on / type ext4 (rw,relatime,data=ordered)
Now copy the new U-Boot image and Mender SDIMG file to a USB drive and connect that to your target.
On your build host:
cp tmp/deploy/images/cl-som-imx7/core-image-base-cl-som-imx7.sdimg tmp/deploy/images/cl-som-imx7/cl-som-imx7-firmware /mnt
On the target:
mount /dev/sda1 /mnt
dd if=/mnt/core-image-base-cl-som-imx7.sdimg of=/dev/mmcblk2 conv=notrunc status=progress bs=8M
flash_erase /dev/mtd0 0 0
dd if=/mnt/cl-som-imx7-firmware of=/dev/mtd0
shutdown -h now
Now remove the SD Card and power cycle the board. It will boot from eMMC and Mender will connect to the server configured in your local.conf file.
On the other hand, if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the Mender Artifact files, which have .mender
suffix. You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in Standalone deployments.
References
- The Compulab CL-SOM-iMX7 template files can be found in meta-mender-community .
- The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.
Known issues
If this post was useful to you, please press like, or leave a thank you note to the contributor who put valuable time into this and made it available to you. It will be much appreciated!