Toradex Verdin iMX8M Mini

The official Mender documentation explains how Mender works. This is simply a board-specific complement to the official documentation.

Board description

The Verdin iMX8M Mini is a System on Module based on the NXP® i.MX 8M Mini family of embedded System on Chips (SoCs). The i.MX 8M Mini family consists of the i.MX 8M Mini Quad, i.MX 8M Mini QuadLite, i.MX 8M Mini Dual, i.MX 8M Mini DualLite, i.MX 8M Mini Solo, and i.MX 8M Mini SoloLite. The top-tier i.MX 8M Mini Quad features four Cortex-A53 cores as the main processor cluster. The cores provide complete 64-bit Armv8-A support while maintaining seamless backwards compatibility with 32-bit Armv7-A software. The main cores run at up to 1.8 GHz for commercial graded products and 1.6 GHz for industrial temperature range products.

URL: NXP i.MX 8M Mini / Nano - Verdin System on Module
Wiki: Verdin iMX8M Mini

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
dunfell (Yocto 3.1 / Toradex BSP 5.3.0) :test_works: :test_works:
dunfell (Yocto 3.1 / Toradex BSP 5.4.0) :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:

Create a directory for your mender-toradex setup to live in and clone the
meta information.

mkdir mender-toradex && cd mender-toradex

Select the appropriate Toradex BSP version:

export TORADEX_BSP_VERSION=5.3.0
export TORADEX_BSP_VERSION=5.4.0

Initialize repo manifest:

repo init -u https://git.toradex.com/toradex-manifest.git \
    -b refs/tags/${TORADEX_BSP_VERSION} \
    -m tdxref/default.xml

Download mender manifest:

wget --directory-prefix .repo/local_manifests \
    https://raw.githubusercontent.com/mendersoftware/meta-mender-community/dunfell/scripts/mender-no-setup-layers.xml

Fetch layers in manifest:

repo sync -j$(nproc)

Setup build environment

Initialize the build environment:

. export

Add Mender layers:

echo "BBLAYERS += \" \${TOPDIR}/../layers/meta-mender/meta-mender-core \"" >> conf/bblayers.conf
echo "BBLAYERS += \" \${TOPDIR}/../layers/meta-mender-community/meta-mender-toradex-nxp \"" >> conf/bblayers.conf
echo "TORADEX_BSP_VERSION = \"toradex-bsp-${TORADEX_BSP_VERSION}\"" >> conf/local.conf

Add optional Mender demo layer:

# Omit this, if you intend to use this build in production
echo "BBLAYERS += \" \${TOPDIR}/../layers/meta-mender/meta-mender-demo \"" >> conf/bblayers.conf

Apply Mender configuration to build environment:

cat ../layers/meta-mender-community/templates/local.conf.append >> conf/local.conf
cat ../layers/meta-mender-community/meta-mender-toradex-nxp/templates/local.conf.append >> conf/local.conf

NOTE! You need to accept the Freescale EULA at ‘…/sources/meta-freescale/EULA’. Please read it and in case you accept it, add:

ACCEPT_FSL_EULA = "1" 

in your local.conf.

Configure Mender server URL (optional)

This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in Standalone deployments, due to lack of server configuration.

You can edit the conf/local.conf file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using. There should already be a commented section in the generated conf/local.conf file and you can simply uncomment the relevant configuration options and assign appropriate values to them.

Build for Hosted Mender:

# To get your tenant token:
#    - log in to https://hosted.mender.io
#    - click your email at the top right and then "My organization"
#    - press the "COPY TO CLIPBOARD"
#    - assign content of clipboard to MENDER_TENANT_TOKEN
#
MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<copy token here>"

Building the image

You can now proceed with building an image:

MACHINE=verdin-imx8mm bitbake tdx-reference-minimal-image

Replace tdx-reference-minimal-image with your desired image target.

Using the build output

After a successful build, the images and build artifacts are:

  • deploy/images/verdin-imx8mm/Verdin-iMX8MM_Reference-Minimal-Image.mender
  • deploy/images/verdin-imx8mm/Verdin-iMX8MM_Reference-Minimal-Image.mender_tezi.tar

The .mender_tezi.tar is used to provision the device storage for devices without Mender running already, and is compatible with the Toradex Easy Installer.

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.

Flash instructions

Refer to the Toradex Easy Installer instructions for more details.

References


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!

3 Likes

Hi,

Great article!
What would one have to do, to integrate Mender into the TorizonCore image? As I understand, you described integration with the tdx-reference-minimal-image.

I intend to do a board integration with the Toradex Apalis imx8x and would love to learn how to do this.

I tried this without the optional step and get build errors applying the u-boot patch.

$ bitbake tdx-reference-minimal-image
Parsing recipes: 100% |#######################################################################################################################################| Time: 0:01:31
Parsing of 2734 .bb files complete (0 cached, 2734 parsed). 3901 targets, 228 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "ubuntu-20.04"
TARGET_SYS           = "aarch64-tdx-linux"
MACHINE              = "verdin-imx8mm"
DISTRO               = "tdx-xwayland"
DISTRO_VERSION       = "5.0.0-devel-20210611060634+build.0"
TUNE_FEATURES        = "aarch64"
TARGET_FPU           = ""
meta-toradex-nxp     = "HEAD:fddb6cc10a1df717cc77b6958ce5e233cef9a80a"
meta-freescale       = "HEAD:bb582837c8c1ee08255b721f0bf946d6074c4773"
meta-freescale-3rdparty = "HEAD:83644f2ea000c1ab92fc0da1c45e2d7fb7a6060c"
meta-toradex-tegra   = "HEAD:962b01390fdc261b5f86921231792daa8f6af043"
meta-toradex-bsp-common = "HEAD:51927b354280c398b11b7b6bd64c1617825f17d1"
meta-oe              
meta-filesystems     
meta-gnome           
meta-xfce            
meta-initramfs       
meta-networking      
meta-multimedia      
meta-python          = "HEAD:654ad8bea49f142d20b2b96c0dd44810a6be233a"
meta-freescale-distro = "HEAD:a1821b36af7bba4f6628e4244df7fc9a038d0f34"
meta-toradex-demos   = "HEAD:93c179932a1a282bb56823ee202e387ced41f388"
meta-qt5             = "HEAD:0e7015f7a86dda995a39662edbb5c26da647c496"
meta-toradex-distro  = "HEAD:1e0d10b2851ac455618ab7e4c7db86c9ad1227a0"
meta-poky            = "HEAD:432b365f48f58ec0d9692a93607b65edd098ca1a"
meta                 = "HEAD:0d4d0df6084cce3c3d9051db88f3199a030d3352"
meta-mender-core     = "HEAD:bd87ddf4b97ccca21044645094b407a5d7beeae5"
meta-mender-toradex-nxp = "HEAD:390c061f4d56a6628135c0911d1164ce14327405"

NOTE: Fetching uninative binary shim http://downloads.yoctoproject.org/releases/uninative/2.8/x86_64-nativesdk-libc.tar.xz;sha256sum=a09922172c3a439105e0ae6b943daad2d83505b17da0aba97961ff433b8c21ab (will check PREMIRRORS first)
Initialising tasks: 100% |####################################################################################################################################| Time: 0:00:08
Sstate summary: Wanted 2497 Found 0 Missed 2497 Current 0 (0% match, 0% complete)
NOTE: Executing Tasks
WARNING: expat-native-2.2.9-r0 do_fetch: Failed to fetch URL https://downloads.sourceforge.net/expat/expat-2.2.9.tar.bz2, attempting MIRRORS if available
WARNING: libusb1-1.0.22-r0 do_fetch: Failed to fetch URL https://downloads.sourceforge.net/libusb/libusb-1.0.22.tar.bz2, attempting MIRRORS if available
WARNING: libpng-1.6.37-r0 do_fetch: Failed to fetch URL https://downloads.sourceforge.net/libpng/libpng16/libpng-1.6.37.tar.xz, attempting MIRRORS if available
ERROR: u-boot-toradex-2020.04-r0 do_patch: Command Error: 'quilt --quiltrc /home/pagi/mender-toradex/build/tmp/work/verdin_imx8mm-tdx-linux/u-boot-toradex/2020.04-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch 0001-Integration-of-Mender-boot-code-into-toradex-U-Boot.patch
patching file include/env_default.h
Hunk #1 FAILED at 8.
Hunk #2 succeeded at 21 (offset -1 lines).
1 out of 2 hunks FAILED -- rejects in file include/env_default.h
patching file scripts/Makefile.autoconf
Patch 0001-Integration-of-Mender-boot-code-into-toradex-U-Boot.patch does not apply (enforce with -f)
ERROR: Logfile of failure stored in: /home/pagi/mender-toradex/build/tmp/work/verdin_imx8mm-tdx-linux/u-boot-toradex/2020.04-r0/temp/log.do_patch.4176058
ERROR: Task (/home/pagi/mender-toradex/build/../layers/meta-toradex-nxp/recipes-bsp/u-boot/u-boot-toradex_2020.04.bb:do_patch) failed with exit code '1'
type or paste code here

It looks like 0001-Integration-of-Mender-boot-code-into-toradex-U-Boot.patch needs to be updated for the current sources. Not sure if it is specific to the Verdin board or not.

Drew

Thanks for the reply! I should also mention that I am interested in making this work for the Apalis IMX8, where I see the same error.

I raised this issue on the Toradex community pages (Mender support for Apalis IMX8 (yocto build) - Toradex Community).

They say that I should post the problem here on the mender community. Is this something that can be fixed here?

Hi @pgiangrossi it looks like the two issues are not the same failure.

For this one, the 0001-Integration-of-Mender-boot-code-into-toradex-U-Boot.patch file will need to be modified. It looks like the upstream sources have change such that the patch utility is unable to cleanly apply. You’ll need to try to figure out how the patch needs to be modified against the current sources. You can comment out the patches in the bbappend files starting with 0001-Integration-of-Mender-boot-code-into-toradex-U-Boot.patch and then run bitbake -c patch virtual/bootloader. You will then have a source code directory in the build/tmp/work directory tree that contains the mostly patched sources. A combination of git am and patch followed by manual inspection of the rejected patch hunks should show you what changes are needed.

As for the issue you reported to Toradex:

ERROR: /home/pagi/mender-toradex/build/…/layers/meta-toradex-demos/recipes-images/images/tdx-reference-multimedia-image.bb: Error. MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET (2) != OFFSET_BOOTROM_PAYLOAD (0)

I’m honestly not sure. You’ll need to dig through the Toradex u-boot sources to understand how OFFSET_BOOTROM_PAYLOAD is defined and then figure out what needs to change. I’m not sure what that variable represents so it’s hard to say for sure.

Drew

Hi Drew,

Thanks for the detailed suggestions. I will try to get this working.

Isn’t this something that should be fixed upstream so that other users of the Apalis IMX8 don’t have to write their own patches?

Paul

Sure. If you figure it out please submit a PR.
Drew

OK, will do. I created a new topic for this, since it does not apply to the Verdin.

/Paul

Hello,

thank you for the article.

I have a Verdin iMX8MMM Q 2GB WB IT V1.1B and a Verdin Development Board V1.1C. So I used TORADEX_BSP_VERSION=5.4.0 and set the variable KERNEL_DEVICETREE_verdin-imx8mm to "freescale/imx8mm-verdin-wifi-dev.dtb" in my conf/local.conf. The build works without a problem.

I tried it several times with a clean build setup but during the first boot I always get a bad CRC when loading the environment:

U-Boot SPL 2020.04-5.4.0-devel+git.81d4185cf830 (Sep 21 2021 - 10:05:05 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
Normal Boot
Trying to boot from MMC1
NOTICE:  BL31: v2.2(release):toradex_imx_5.4.70_2.3.0-g835a8f67b2
NOTICE:  BL31: Built : 19:30:40, May  3 2021


U-Boot 2020.04-5.4.0-devel+git.81d4185cf830 (Sep 21 2021 - 10:05:05 +0000)

CPU:   i.MX8MMQ rev1.0 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 40C
Reset cause: POR
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Fail to setup video link
In:    serial
Out:   serial
Err:   serial
Model: Toradex Verdin iMX8M Mini Quad 2GB Wi-Fi / BT IT V1.1B, Serial# 06898559
Carrier: Toradex Verdin Development Board V1.1C, Serial# 10952592

 BuildInfo:
  - ATF 835a8f6
  - U-Boot 2020.04-5.4.0-devel+git.81d4185cf830

Setting variant to wifi
Saving Environment to MMC... Writing to redundant MMC(0)... OK
flash target is MMC:0
Net:   eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found U-Boot script /boot.scr
2692 bytes read in 18 ms (145.5 KiB/s)
## Executing script at 46000000
Saving Environment to MMC... Writing to MMC(0)... OK
Loading DeviceTree: imx8mm-verdin-wifi-dev.dtb
64675 bytes read in 19 ms (3.2 MiB/s)
10243008 bytes read in 240 ms (40.7 MiB/s)
Uncompressed size: 24199680 = 0x1714200
Bootargs: root=/dev/mmcblk0p2 ro rootwait console=ttymxc0,115200 console=tty1 consoleblank=0 earlycon
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
   Loading Device Tree to 00000000bced8000, end 00000000bcf0afff ... OK

Starting kernel ...
[...]

The system boots successfully, but I don’t think the uboot error can be ignored. What can I do about this?

Best regards,
Markus

I am getting the following warnings when trying to build for kirkstone

❯ MACHINE=verdin-imx8mm bitbake tdx-reference-minimal-image
Loading cache: 100% |                                                              | ETA:  --:--:--
Loaded 0 entries from dependency cache.
WARNING: /home/nsssayom/oe-core/build/../layers/meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-distro-boot.bb: Unable to get checksum for u-boot-distro-boot SRC_URI entry 0001-Adapt-boot.cmd.in-to-Mender.patch: file could not be found
WARNING: /home/nsssayom/oe-core/build/../layers/meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb: Unable to get checksum for u-boot-toradex SRC_URI entry 0001-configs-toradex-board-specific-mender-integration.patch: file could not be found
WARNING: /home/nsssayom/oe-core/build/../layers/meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-toradex_2022.07.bb: Unable to get checksum for u-boot-toradex SRC_URI entry 0001-Use-mender_dtb_name-for-fdtfile.patch: file could not be found
WARNING: /home/nsssayom/oe-core/build/../layers/meta-toradex-nxp/recipes-bsp/u-boot/u-boot-toradex_2022.04.bb: Unable to get checksum for u-boot-toradex SRC_URI entry 0001-configs-toradex-board-specific-mender-integration.patch: file could not be found
WARNING: /home/nsssayom/oe-core/build/../layers/meta-toradex-nxp/recipes-bsp/u-boot/u-boot-toradex_2022.04.bb: Unable to get checksum for u-boot-toradex SRC_URI entry 0001-Use-mender_dtb_name-for-fdtfile.patch: file could not be found
Parsing recipes: 100% |#############################################################| Time: 0:01:33
Parsing of 3253 .bb files complete (0 cached, 3253 parsed). 4804 targets, 372 skipped, 0 masked, 0 errors.
WARNING: No recipes in default available for:
  /home/nsssayom/oe-core/build/../layers/meta-toradex-nxp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bbappend
NOTE: Resolving any missing task queue dependencies

Does anyone know how to solve this?