Compulab CL-SOM-iMX8

Board description

The Compulab CL-SOM-iMX8 platform is a System on Modules (SoM) based on the NXP i.MX8 chip. The evaluation kit comes with a SB-iMX8 carrier board.


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) :test_works: :test_works:

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-imx8
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
sed -i 's@^\(PREFERRED_RPROVIDER_u-boot-fw-utils.*$\)@# commented by Mender # \1@' conf/local.conf
sed -i 's@^\(CORE_IMAGE_EXTRA_INSTALL.*$\)@# commented by Mender # \1@' conf/local.conf
sed -i 's@^\(IMAGE_FEATURES.*package-management.*$\)@# commented by Mender # \1@' conf/local.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-imx8 bitbake core-image-base

Replace core-image-base with your desired image target.

Using the build output

Provision an SD Card with the built above. WARNING, make sure you use the correct device node as the of= parameter to avoid overwriting the wrong device:

sudo dd if=tmp/deploy/images/cl-som-imx8/core-image-full-cmdline-cl-som-imx8.sdimg of=<SDCARD-DEVICE-NODE>

The image generated above assumes it is running from the eMMC (enumerated as /dev/mmcblk0 on the target). We will manually modify this to boot from the SD Card, and from that environment, we will provision the onboard eMMC with the unmodified image:

sudo mount /dev/mmcblk0p1 /mnt
sudo cat /mnt/etc/fstab | grep -v /data > fstab.new
sudo mv fstab.new /mnt/etc/fstab
sudo umount /mnt

Also, copy the images created above to a USB key. This will be used when booted from the SD Card to populate the eMMC on the target.

Remove the SD Card and USB key from your build host and insert them into the target. Configure your board to boot from SD Card by pressing the ALT BOOT switch, or SW5 as you power it on. As the board boots to U-Boot, press a key to stop the autoboot process. Manually boot Linux from the SD Card, bypassing the default bootcmd:

setenv bootargs root=/dev/mmcblk1p1 console=ttymxc2,115200
mmc dev 1
load mmc 1:1 0x43000000 /boot/sbc-imx8-lvds-lcdif.dtb
load mmc 1:1 0x40480000 /boot/Image
booti 0x40480000 - 0x43000000

Once Linux has booted, log in as root with no password. Then verify that the root filesystem is /dev/mmcblk1p1 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/mmcblk1p1 on / type ext4 (rw,relatime,data=ordered)

Provision the eMMC device with the original sdimg file:

mount /dev/sda1 /mnt
dd if=/mnt/core-image-base-cl-som-imx8.sdimg of=/dev/mmcblk0 conv=notrunc status=progress
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 as described in Deploy to physical devices or by using the Mender client only in Standalone deployments.

References

  • The Compulab CL-SOM-iMX8 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!

2 Likes