# Variscite VAR-SOM-MX8M-MINI : NXP i.MX 8M Mini

**URL:** <https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918>\
**Category:** Yocto Project\
**Created:** [May 14, 2020, 1:51pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918 "2020-05-14T13:51:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [May 14, 2020, 1:51pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/1 "2020-05-14T13:51:16Z")

</div>

# Board description

The VAR-SOM-MX8M-MINI is a highly scalable, low power System on Module (SoM), offering a mainstream solution to fit a wide range of applications and cost requirements.

Based on NXP’s i.MX 8M Mini with up to 1.8GHz Quad-core ARM Cortex-A53™ plus 400MHz Cortex-M4™ real-time processor and up to 4 GB DDR4, the VAR-SOM-MX8M-MINI supports advanced features and a variety of connectivity options, including integrated HW engines supporting 1080p video encoding and decoding, 2D and 3D graphics, HQ audio, integrated certified single band 802.11 b/g/n or dual-band 802.11 ac/a/b/g/n, integrated CAN bus, LVDS, and a variety of additional interfaces.

The VAR-SOM-MX8M-MINI is a pin2pin platform compatible with the ‘VAR-SOM Pin2Pin’ products family, providing a maximum scalability range; from the entry-level i.MX6UL/6ULL platform, through the i.MX 6 platforms, i.MX 8X, and up to the i.MX 8QuadMax.

The [VAR-SOM-MX8M-MINI Development Kit and Starter Kit](https://www.variscite.com/product/evaluation-kits/var-som-mx8m-mini-evaluation-kits/) can serve as a complete development platform for both evaluation and application development purposes. The kits provide a great showcase of the [VAR-SOM-MX8M-MINI](https://www.variscite.com/product/system-on-module-som/cortex-a53-krait/var-som-mx8m-mini-nxp-i-mx8m-mini/) connectivity features and performance.

![VAR-SOM-MXM-MINI](https://www.variscite.com/wp-content/uploads/2019/12/VAR-SOM-MX8M-MINI-starter-kit.webp)

- [Product Overview](https://www.variscite.com/product/system-on-module-som/cortex-a53-krait/var-som-mx8m-mini-nxp-i-mx8m-mini/?target=_blank)
- [Support Wiki](http://variwiki.com/index.php?title=VAR-SOM-MX8M-MINI&target=_blank)

# 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](https://wiki.yoctoproject.org/wiki/Releases?target=_blank):

## SD Card Root Filesystem

| Yocto Project | Build | Runtime |
| --- | --- | --- |
| warrior (2.7) | :test_works: | :test_works: |
| zeus (3.0) | :test_works: | :test_works: |

## eMMC Root Filesystem

| Yocto Project | Build | Runtime |
| --- | --- | --- |
| warrior (2.7) | :test_works: | :test_works: |
| zeus (3.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](https://docs.mender.io/devices/integrating-with-u-boot/integration-checklist?target=_blank) has been verified.

# Getting started

## Prerequisites

- A supported Linux distribution and dependencies installed on your workstation/laptop as described in the [Yocto Mega Manual](https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#detailed-supported-distros)
  - NOTE. Instructions depend on which Yocto version you intend to use.

- Google repo tool [installed](https://hub.mender.io/t/google-repo/58/2) and in your `PATH`.

## Configuring the build

### Setup Yocto environment

Set the Yocto Project branch you are building for:

```auto
# set to your branch, make sure it is supported (see table above)
export BRANCH="warrior"

```

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

```auto
mkdir mender-variscite && cd mender-variscite

```

Initialize repo manifest:

```auto
if [${BRANCH} == "zeus"]; then
  REPO_BRANCH="fsl-${BRANCH}"
else
  REPO_BRANCH="${BRANCH}"
fi
repo init -u https://github.com/varigit/variscite-bsp-platform.git -b ${REPO_BRANCH}                                                                                       
mkdir .repo/local_manifests
cd .repo/local_manifests/
wget https://raw.githubusercontent.com/mendersoftware/meta-mender-community/$BRANCH/scripts/mender-no-setup.xml
cd -

```

Fetch layers in manifest:

```auto
repo sync
cd .repo/local_manifests/
ln -sf ../../sources/meta-mender-community/scripts/mender-no-setup.xml .
cd -

```

## Determine root filesystem media

The Variscite VAR-SOM-MX8M-MINI platform supports running U-Boot directly from the following media:

- SD-Card
- eMMC

The root filesystem can be stored on any of the following media:

- SD-Card
- eMMC

Set the shell variable for your desired root filesystem media:

```auto
export MEDIA="sdcard"

```

```auto
export MEDIA="emmc"

```

## Setup build environment

Initialize the build environment:

```auto
MACHINE=imx8mm-var-dart DISTRO=fsl-imx-xwayland . var-setup-release.sh -b build
cat ../sources/meta-mender-community/meta-mender-variscite/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-variscite/templates/local.conf.append >> conf/local.conf
cat ../sources/meta-mender-community/meta-mender-variscite/templates/local-${MEDIA}.conf.append >> conf/local.conf

```

### Building the image

You can now proceed with building an image:

```bash
bitbake core-image-base

```

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

### Using the build output

#### SD Card

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:

```shell
sudo dd if=tmp/deploy/images/imx8mm-var-dart/core-image-base-imx8mm-var-dart.sdimg of=<SDCARD-DEVICE-NODE> conv=fdatasync bs=8M

```

Remove the SD Card from your build host and insert it into the target. Configure your board to boot from SD Card by moving the _Boot Select_ switch (also labeled as _SW3_ ) to the _SD_ position. Now turn on power to the board and it will boot from the SDCard and Mender will connect to the server configured in your local.conf file.

#### eMMC

Using either the above built SDCard Yocto image or the [Variscite Yocto Recovery SD card](http://variwiki.com/index.php?title=Yocto_Recovery_SD_card&release=RELEASE_WARRIOR_V1.0_DART-MX8M-MINI), boot your system off of SD. Transfer the following file from your build PC to the target board with a USB drive:

- tmp/deploy/images/imx8mm-var-dart/core-image-base-imx8mm-var-dart.sdimg

Assuming the USB drive is mounted on the target at _/mnt_, run the following commands:

```shell
sudo dd if=/mnt/core-image-base-imx8mm-var-dart.sdimg of=/dev/mmcblk0 conv=fdatasync bs=8M
halt

```

Then change the _Boot Select_ switch (also labeled as _SW3_ ) to the _Internal_ position and power cycle your board.

#### eMMC - USB Mass Storage Installation

An alternative mechanism exists if you already have a working UBoot running from either SD-Card or eMMC running on the target board. This mechanism will present the eMMC device to your development PC as a mass storage device and you can flash the image directly from there.

1. Boot the system and press any key to interrupt the boot process, leaving you at the _U-Boot\>_ prompt.
2. Connect a USB cable from USB3/J26 port on the target board to your PC.
3. Enable USB mass storage mode from the _U-Boot\>_ prompt:

```shell
U-Boot> ums 0 mmc 1

```

1. Determine what device node was added on your PC. This can be done using the Disk Utility or viewing system logs. Consult your PC OS documentation for more details
2. Write the flash directly to the eMMC. This assumes the new device was enumerated as _/dev/sdd_. **WARNING:** this will destroy any contents on the device listed under the _of=_ parameter below.

```shell
sudo dd if=tmp/deploy/images/imx8mm-var-dart/core-image-base-imx8mm-var-dart.sdimg of=<EMMC-DEVICE-NODE> conv=fdatasync bs=8M

```

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](https://docs.mender.io/architecture/mender-artifacts?target=_blank) 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](https://docs.mender.io/architecture/standalone-deployments?target=_blank).

# References

- The Variscite imx8m-var-dart template files can be found in [meta-mender-community](https://github.com/mendersoftware/meta-mender-community/tree/sumo/meta-mender-variscite).
- The official [Mender documentation](https://docs.mender.io/) explains how Mender works. This is simply a board-specific complement to the official documentation.

* * *

_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!_

---

<div class="post-metadata">

**Author:** ![KTCdjoh](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ktcdjoh/32/1658_2.png) [@KTCdjoh](https://hub.mender.io/u/KTCdjoh)\
**Post date:** [August 5, 2020, 6:12am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/2 "2020-08-05T06:12:16Z")

</div>

Dear drewmoseley,  
thank you very much for this guide. I’m using this module in a project and the mender integration went very well so far, thanks to your effort.  
(Just on thing to add maybe: I needed to ‘bitbake -c populate\_sdk …’ before building the image itself. Without this step there was some mender compilation error regarding ‘pseudo-native’, which could not be found.)

Now I would like to use OP-TEE for some security features. There are examples by NXP for their EVKs, but none really for the Variscite modules (see the NXP community board). I tried a few approaches and the best one resulted in appending ‘optee’ to the MACHINE\_FEATURES and inserting a node into the devicetree - so far, so good.

Then there’s the problem: OP-TEE needs to add a file called ‘tee.bin’ to u-boot, i. e. to the boot partition via IMAGE\_BOOT\_FILES variable, but following your guide it is manually set to empty by the ‘meta-mender-variscite/templates/local.conf.append’ and the boot partition size is set to ‘0’.

Do you have an idea how to solve this? I tried commenting the overrides in ‘local.conf’, but the board won’t boot then, since it seems to be unable to find the bootloader.  
Would it be possible to add the file to ‘/boot’, where kernel and devicetrees are located?

/edit:  
I just looked at the u-boot env and there seems to be a new bootcmd with optee content:  
`bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else booti ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;`

> **u-boot=\> printenv**
>
> altbootcmd=run mender\_altbootcmd; run bootcmd  
> baudrate=115200  
> board\_name=VAR-SOM-MX8M-MINI  
> boot\_fdt=try  
> bootcmd=run mender\_setup; setenv bootargs root={mender\_kernel\_root} {bootargs}; if test “{fdt\_addr\_r}" != ""; then load {mender\_uboot\_root} {fdt\_addr\_r} /boot/{mender\_dtb\_name}; fi; load {mender\_uboot\_root} {img\_addr} /boot/{mender\_kernel\_name};unzip {img\_addr} {loadaddr}; {mender\_boot\_kernel\_type} {kernel\_addr\_r} - {fdt\_addr\_r}; run mender\_try\_to\_recover  
> bootcmd\_mfg=run mfgtool\_args;if iminfo {initrd\_addr}; then if test {tee} = yes; then bootm {tee\_addr} {initrd\_addr} {fdt\_addr}; else booti {loadaddr} {initrd\_addr} {fdt\_addr}; fi; else echo “Run fastboot …”; fastboot 0; fi;  
> bootcount=1  
> bootdelay=1  
> bootdir=/boot  
> bootlimit=1  
> bootscript=echo Running bootscript from mmc …; source  
> console=ttymxc3,115200 earlycon=ec\_imx6q,0x30a60000,115200  
> emmc\_dev=1  
> ethaddr=xx:xx:xx:xx:xx:xx  
> ethprime=FEC  
> fastboot\_dev=mmc0  
> fdt\_addr\_r=0x43000000  
> fdt\_file=undefined  
> fdt\_high=0xffffffffffffffff  
> fdtcontroladdr=b6d43ad8  
> findfdt=if test $fdt\_file = undefined; then if test $board\_name = VAR-SOM-MX8M-MINI; then if test som\_rev = som\_rev10; then setenv fdt\_file fsl-imx8mm-var-som-rev10.dtb; else setenv fdt\_file fsl-imx8mm-var-som.dtb; fi;else setenv fdt\_file fsl-imx8mm-var-dart.dtb;fi; fi; image=Image.gz img\_addr=0x42000000 initrd\_addr=0x43800000 initrd\_high=0xffffffffffffffff ip\_dyn=yes kboot=booti loadaddr=0x40480000 loadbootscript=load mmc {mmcdev}:{mmcpart} {loadaddr} {bootdir}/{script};  
> loadfdt=run findfdt; echo fdt\_file={fdt\_file}; load mmc {mmcdev}:{mmcpart} {fdt\_addr} {bootdir}/{fdt\_file}  
> loadimage=load mmc {mmcdev}:{mmcpart} {img\_addr} {bootdir}/{image};unzip {img\_addr} {loadaddr} loadm4bin=load mmc {mmcdev}:{mmcpart} {m4\_addr} {bootdir}/{m4\_bin}  
> m4\_addr=0x7e0000  
> m4\_bin=hello\_world.bin  
> mender\_altbootcmd=if test {mender\_boot\_part} = 1; then setenv mender\_boot\_part 2; setenv mender\_boot\_part\_hex 2; else setenv mender\_boot\_part 1; setenv mender\_boot\_part\_hex 1; fi; setenv upgrade\_available 0; saveenv; run mender\_setup mender\_boot\_kernel\_type=booti mender\_boot\_part=1 mender\_boot\_part\_hex=1 mender\_check\_saveenv\_canary=1 mender\_dtb\_name=fsl-imx8mm-var-som-rev10-m4.dtb mender\_kernel\_name=Image.gz mender\_pre\_setup\_commands= setenv bootargs console={console},{baudrate}; if test "{mmcargs}” != “”; then run mmcargs; fi; if test “{videoargs}" != ""; then run videoargs; fi; if test "{optargs}” != “”; then run optargs; fi; if test “{ramsize\_check}" != ""; then run ramsize\_check; fi; run findfdt; setenv mender\_dtb\_name {fdt\_file}; setenv kernel\_addr\_r {loadaddr}; mender\_saveenv\_canary=1 mender\_setup=if test "{mender\_saveenv\_canary}” != “1”; then setenv mender\_saveenv\_canary 1; saveenv; fi; if test “{mender\_pre\_setup\_commands}" != ""; then run mender\_pre\_setup\_commands; fi; if test "{mender\_systemd\_machine\_id}” != “”; then setenv bootargs systemd.machine\_id={mender\_systemd\_machine\_id} {bootargs}; fi; setenv mender\_kernel\_root /dev/mmcblk1p${mender\_boot\_part}; if test {mender\_boot\_part} = 1; then setenv mender\_boot\_part\_name /dev/mmcblk1p1; else setenv mender\_boot\_part\_name /dev/mmcblk1p2; fi; setenv mender\_kernel\_root\_name {mender\_boot\_part\_name}; setenv mender\_uboot\_root mmc 0:{mender\_boot\_part\_hex}; setenv mender\_uboot\_root\_name {mender\_boot\_part\_name}; setenv expand\_bootargs “setenv bootargs \”{bootargs}\\""; run expand\_bootargs; setenv expand\_bootargs; if test "{mender\_post\_setup\_commands}" != “”; then run mender\_post\_setup\_commands; fi  
> mender\_try\_to\_recover=if test {upgrade\_available} = 1; then reset; fi mender\_uboot\_boot=mmc 0:1 mender\_uboot\_dev=0 mender\_uboot\_if=mmc mfgtool\_args=setenv bootargs console={console},{baudrate} rdinit=/linuxrc clk\_ignore\_unused mmcargs=setenv bootargs console={console} rootwait rw {cma\_size} mmcautodetect=yes mmcblk=1 mmcboot=echo Booting from mmc ...; run mmcargs; run optargs; if test {boot\_fdt} = yes || test {boot\_fdt} = try; then if run loadfdt; then booti {loadaddr} - {fdt\_addr}; else echo WARN: Cannot load the DT; fi; else echo wait for boot; fi; mmcdev=0 mmcpart=1 netargs=setenv bootargs console={console} {cma\_size} ip=dhcp nfsroot={serverip}:{nfsroot},v3,tcp netboot=echo Booting from net ...; if test {ip\_dyn} = yes; then setenv get\_cmd dhcp; else setenv get\_cmd tftp; fi; {get\_cmd} {img\_addr} {image}; unzip {img\_addr} {loadaddr};run ramsize\_check; run netargs; run optargs; if test {boot\_fdt} = yes || test {boot\_fdt} = try; then run findfdt; echo fdt\_file={fdt\_file}; if {get\_cmd} {fdt\_addr} {fdt\_file}; then booti {loadaddr} - {fdt\_addr}; else echo WARN: Cannot load the DT; fi; else booti; fi; optargs=setenv bootargs {bootargs} ${kernelargs};  
> ramsize\_check=if test sdram\_size -le 512; then setenv cma\_size cma=320M; else setenv cma\_size cma=640M@1376M; fi; runm4bin=if test {m4\_addr} = 0x7e0000; then echo Booting M4 from TCM; else echo Booting M4 from DRAM; dcache flush; fi; bootaux ${m4\_addr};  
> script=boot.scr  
> sd\_dev=0  
> sdram\_size=2048  
> serial#=0d111209dab4b749  
> soc\_type=imx8mm  
> som\_rev=som\_rev11  
> splashdisable=setenv splashfile; setenv splashimage  
> splashenable=setenv splashfile /boot/splash.bmp; setenv splashimage 0x43100000  
> splashfile=/boot/splash.bmp  
> splashimage=0x43100000  
> splashsourceauto=yes  
> stderr=serial  
> stdin=serial  
> stdout=serial  
> upgrade\_available=0  
> use\_m4=no

However, it is not called by the default bootcmd and if I try ‘run bootcmd\_mfg’ it says `## Checking Image at 43800000 ... Unknown image format!` because the ‘iminfo’ command cannot find a valid image at ‘initrd\_addr’.

I would appreciate your help very much.  
djoh

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [August 5, 2020, 1:33pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/3 "2020-08-05T13:33:41Z")

</div>

Hello @KTCdjoh welcome to Mender Hub. I’m glad that you are finding it useful.

As for the OP-TEE integration we have not investigated that. As you noticed with Mender, there is no need for a separate boot partition. U-Boot and it’s environment are stored in inter-partition space and no other files are needed. The kernel and DTB are instead loaded from the root filesystem partition making it easy to upgrade them with an OTA deployment.

My guess is the simplest solution would be to simply set MENDER\_BOOT\_PARTITION\_SIZE\_MB to something non-zero and then ensure tee.bin is in IMAGE\_BOOT\_FILES. I don’t know exactly how that file is loaded and processed so you may need to modify the bootcmd some as well.

The downside of that approach is that there is no way to upgrade tee.bin should it be needed.

The proper approach would be to ensure that tee.bin is in the root filesystem somewhere and that the logic in the U-Boot environment that processes it is updated to find the file there.

Drew

---

<div class="post-metadata">

**Author:** ![KTCdjoh](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ktcdjoh/32/1658_2.png) [@KTCdjoh](https://hub.mender.io/u/KTCdjoh)\
**Post date:** [August 5, 2020, 2:20pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/4 "2020-08-05T14:20:04Z")

</div>

Hello @drewmoseley, thanks for your reply.

Just in case you’re interested, here’s the guide by NXP I followed:  
[https://source.codeaurora.org/external/imx/imx-optee-os/tree/README.md](https://source.codeaurora.org/external/imx/imx-optee-os/tree/README.md) (chapter ‘4.6 Freescale MX6UL EVK’, especially the part ‘Run using U-Boot’ - imx6, I know, just for guidance) and also the link specified therein [http://mrvan.github.io/optee-imx6ul](http://mrvan.github.io/optee-imx6ul)

In my understanding, tee.bin is simply loaded and executed before the kernel. It initializes its separate secure environment and then continues to start the kernel in the non-secure world.

I guess I’ll try both approaches and report status, when I’m back from holiday 😉  
But you’re right, the rootfs approach would be better for maintainability.  
So far, I completely switched to the boot partition layout without u-boot in the bootsector, which logically didn’t work.

Best regards  
djoh

---

<div class="post-metadata">

**Author:** ![KTCdjoh](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ktcdjoh/32/1658_2.png) [@KTCdjoh](https://hub.mender.io/u/KTCdjoh)\
**Post date:** [September 1, 2020, 11:08am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/5 "2020-09-01T11:08:28Z")

</div>

Hello,

I was able to identify and solve the problem:  
As I stated above, I added " optee" by a MACHINE\_FEATURES\_append statement.  
I inserted this into my custom image recipe, which seems to be evaluated too late during the build process.  
As a result, “imx-atf” and “imx-boot” are built without “optee support”, because it is not part of COMBINED\_FEATURES at this point.  
Later, COMBINED\_FEATURES contains “optee” and so the “packagegroup-optee-imx” is built.

By moving the MACHINE\_FEATURES\_append statement to “local.conf” everything works fine.  
So it was not related to the “tee.bin” file or the mender settings for the boot partition, which I suspected before.

Thanks again and best regards  
djoh

---

<div class="post-metadata">

**Author:** ![ABTP](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ABTP](https://hub.mender.io/u/ABTP)\
**Post date:** [April 23, 2021, 1:25pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/6 "2021-04-23T13:25:26Z")

</div>

Hi Drew,

Thank you for this guide. I have been trying to integrate Mender with a Variscite VAR-SOM-MX8M-MINI running B2Qt-Zeus based on :  
Yocto: Poky 3.0, BSP: NXP L5.4.3-1.0.0, Linux: lf-5.4.y

Before trying to integrate Mender, I was able to produce a bootable B2Qt image. Then, I added meta-mender-community and meta-mender layers both from the Zeus branches and followed the regular integration approach (updating local.conf and bblayers.conf for sdcard image). However, when i try to compile the image i get this error:

ERROR: Task do\_patch in /media/tracoven/Storage/VAR-SOM-MX8-MINI-ZEUS-VAR01/sources/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-fw-utils-mender-auto-provided\_1.0.bb depends upon non-existent task do\_mender\_tar\_src in /media/tracoven/Storage/VAR-SOM-MX8-MINI-ZEUS-VAR01/sources/meta-variscite-imx/recipes-bsp/u-boot/u-boot-variscite.bb

ERROR: Command execution failed: 1

Any idea why I get this message and how to fix it?

local.conf: (mender section only)

INHERIT += “rm\_work”

MENDER\_ARTIFACT\_NAME = “release-2”  
INHERIT += “mender-full”  
DISTRO\_FEATURES\_append = " systemd"  
VIRTUAL-RUNTIME\_init\_manager = “systemd”  
DISTRO\_FEATURES\_BACKFILL\_CONSIDERED = “sysvinit”  
VIRTUAL-RUNTIME\_initscripts = “”

MENDER\_STORAGE\_TOTAL\_SIZE\_MB\_imx8mm-var-dart = “13312”  
MENDER\_IMAGE\_BOOTLOADER\_FILE\_imx8mm-var-dart = “imx-boot-imx8mm-var-dart-sd.bin”  
MENDER\_IMAGE\_BOOTLOADER\_BOOTSECTOR\_OFFSET\_imx8mm-var-dart = “66”

IMAGE\_BOOT\_FILES\_imx8mm-var-dart = “”  
MENDER\_BOOT\_PART\_SIZE\_MB\_imx8mm-var-dart = “0”

IMAGE\_FSTYPES\_remove = “tar.gz wic.gz wic.bmap mender.bmap sdimg.bmap sdcard.gz wic ext4”

MENDER\_FEATURES\_ENABLE\_append = " mender-image-sd"  
MENDER\_FEATURES\_DISABLE\_append = " mender-grub mender-image-uefi"

MENDER\_STORAGE\_DEVICE\_imx8mm-var-dart = “/dev/mmcblk1”  
MENDER\_UBOOT\_STORAGE\_DEVICE\_imx8mm-var-dart= “0”  
UBOOT\_CONFIG\_imx8mm-var-dart = “sd”

MACHINE\_ESSENTIAL\_EXTRA\_RDEPENDS = “kernel-image kernel-devicetree”  
KERNEL\_IMAGETYPE\_mender-uboot = “Image”  
IMAGE\_POSTPROCESS\_COMMAND\_remove = “do\_qbsp\_image;”

#MACHINE\_EXTRA\_RDEPENDS = “u-boot-fw-utils”  
#MENDER\_BOOT\_PART\_SIZE\_MB\_mender-uboot = “16”  
#PREFERRED\_PROVIDER\_u-boot-fw-util= “u-boot-fw-utils-mender-auto-provided”

Thak you 🙂

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 23, 2021, 1:46pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/7 "2021-04-23T13:46:51Z")

</div>

The integrations we have for Variscite boards use the u-boot-variscite recipe and not the u-boot-imx recipe. Something is changing the configuration in your case; I suspect it is the b2qt layers. You can see the existing recipes [here](https://github.com/mendersoftware/meta-mender-community/tree/zeus/meta-mender-variscite/recipes-bsp/u-boot) and you will probably need to make a _u-boot-imx.bbappend_ modeled after the existing _u-boot-variscite.bbappend_.

Drew

---

<div class="post-metadata">

**Author:** ![ABTP](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ABTP](https://hub.mender.io/u/ABTP)\
**Post date:** [April 28, 2021, 11:01am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/8 "2021-04-28T11:01:19Z")

</div>

Hi Drew

Thank you for the quick reply. Its really appreciated 🙂

I manged to build the image, though I didn’t have to make any changes to u-boot-imx.bbappend nor to u-boot-variscite.bbappend. I just enabled “mender-uboot” feature in the local.conf file (MENDER\_FEATURES\_ENABLE\_append = " mender-image-sd mender-uboot" ). For other Linux distributions (Sumo) I did not have to add this, and the integration was successful, so its a bit strange I had to do it this time.

Nevertheless, even though the image was built successfully, it is not booting. Serial boot messages show this error message: “Bad Linux ARM64 Image magic!”

Here are the full boot messages:

> U-Boot SPL 2019.04-lf-5.4.y\_v2019.04\_var01+gbcdb05a53e (Apr 28 2021 - 08:00:24 +0000)  
> Normal Boot  
> Trying to boot from MMC1
> 
> U-Boot 2019.04-lf-5.4.y\_v2019.04\_var01+gbcdb05a53e (Apr 28 2021 - 08:00:24 +0000)
> 
> CPU: Freescale i.MX8MMQ rev1.0 1800 MHz (running at 1200 MHz)  
> CPU: Commercial temperature grade (0C to 95C) at 45C  
> Reset cause: POR  
> Model: Variscite VAR-SOM-MX8M-MINI  
> DRAM: 2 GiB  
> MMC: FSL\_SDHC: 1, FSL\_SDHC: 2  
> Loading Environment from MMC… OK  
> In: serial  
> Out: serial  
> Err: serial
> 
> BuildInfo:
> 
> - ATF 7b3389d
> - U-Boot 2019.04-lf-5.4.y\_v2019.04\_var01+gbcdb05a53e
> 
> Part number: VSM-MX8MM-101  
> Assembly: AS2002150192  
> Production date: 2020 Apr 06  
> Serial Number: f8:dc:7a:3e:81:ba  
> flash target is MMC:1  
> Net: eth0: ethernet@30be0000  
> Fastboot: Normal  
> Normal Boot  
> Hit any key to stop autoboot: 0  
> Bad Linux ARM64 Image magic!

This is the boot environment:

> u-boot=\> printenv  
> altbootcmd=run mender\_altbootcmd; run bootcmd  
> arch=arm  
> baudrate=115200  
> board=imx8mm\_var\_dart  
> board\_name=VAR-SOM-MX8M-MINI  
> boot\_a\_script=load ${devtype} ${devnum}:${distro\_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}  
> boot\_efi\_binary=if fdt addr ${fdt\_addr\_r}; then bootefi bootmgr ${fdt\_addr\_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro\_bootpart} ${kernel\_addr\_r} efi/boot/bootaa64.efi; if fdt addr ${fdt\_addr\_r}; then bootefi ${kernel\_addr\_r} ${fdt\_addr\_r};else bootefi ${kernel\_addr\_r} ${fdtcontroladdr};fi  
> boot\_extlinux=sysboot ${devtype} ${devnum}:${distro\_bootpart} any ${scriptaddr} ${prefix}${boot\_syslinux\_conf}  
> boot\_net\_usb\_start=usb start  
> boot\_prefixes=/ /boot/  
> boot\_script\_dhcp=boot.scr.uimg  
> boot\_scripts=boot.scr.uimg boot.scr  
> boot\_syslinux\_conf=extlinux/extlinux.conf  
> boot\_targets=mmc2 mmc1  
> bootargs=root=/dev/mmcblk1p1  
> bootcmd=run mender\_setup; setenv bootargs root=${mender\_kernel\_root} ${bootargs}; if test “${fdt\_addr\_r}” != “”; then load ${mender\_uboot\_root} ${fdt\_addr\_r} /boot/${mender\_dtb\_name}; fi; load ${mender\_uboot\_root} ${kernel\_addr\_r} /boot/${mender\_kernel\_name}; ${mender\_boot\_kernel\_type} ${kernel\_addr\_r} - ${fdt\_addr\_r}; run mender\_try\_to\_recover  
> bootcmd\_mfg=run mfgtool\_args;if iminfo ${initrd\_addr}; then if test ${tee} = yes; then bootm ${tee\_addr} ${initrd\_addr} ${fdt\_addr}; else booti ${loadaddr} ${initrd\_addr} ${fdt\_addr}; fi; else echo “Run fastboot …”; fastboot 0; fi;  
> bootcmd\_mmc1=devnum=1; run mmc\_boot  
> bootcmd\_mmc2=devnum=2; run mmc\_boot  
> bootcount=1  
> bootdelay=1  
> bootdir=/boot  
> bootlimit=1  
> cma\_size=cma=640M@1376M  
> console=ttymxc3,115200 earlycon=ec\_imx6q,0x30a60000,115200  
> cpu=armv8  
> distro\_bootcmd=for target in ${boot\_targets}; do run bootcmd\_${target}; done  
> efi\_dtb\_prefixes=/ /dtb/ /dtb/current/  
> emmc\_dev=1  
> ethaddr=f8:dc:7a:3e:81:ba  
> ethprime=FEC  
> fastboot\_dev=mmc1  
> fdt\_addr\_r=0x43000000  
> fdt\_high=0xffffffffffffffff  
> fdtcontroladdr=b6d2d7c0  
> fdtfile=imx8mm-var-som.dtb  
> findfdt=if test $fdtfile = undefined; then if test $board\_name = VAR-SOM-MX8M-MINI; then if test $som\_rev = som\_rev10; then setenv fdtfile imx8mm-var-som-rev10.dtb; else setenv fdtfile imx8mm-var-som.dtb; fi;else setenv fdtfile imx8mm-var-dart.dtb;fi; fi;  
> image=Image.gz  
> img\_addr=0x42000000  
> initrd\_addr=0x43800000  
> initrd\_high=0xffffffffffffffff  
> kboot=booti  
> kernel\_addr\_r=0x40480000  
> load\_efi\_dtb=load ${devtype} ${devnum}:${distro\_bootpart} ${fdt\_addr\_r} ${prefix}${efi\_fdtfile}  
> loadaddr=0x40480000  
> loadm4bin=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${m4\_bin}; cp.b ${loadaddr} ${m4\_addr} ${filesize}  
> m4\_addr=0x7e0000  
> m4\_bin=hello\_world.bin  
> mender\_altbootcmd=if test ${mender\_boot\_part} = 1; then setenv mender\_boot\_part 2; setenv mender\_boot\_part\_hex 2; else setenv mender\_boot\_part 1; setenv mender\_boot\_part\_hex 1; fi; setenv upgrade\_available 0; saveenv; run mender\_setup  
> mender\_boot\_kernel\_type=booti  
> mender\_boot\_part=1  
> mender\_boot\_part\_hex=1  
> mender\_boot\_part\_name=/dev/mmcblk1p1  
> mender\_check\_saveenv\_canary=1  
> mender\_kernel\_name=Image  
> mender\_kernel\_root=/dev/mmcblk1p1  
> mender\_kernel\_root\_name=/dev/mmcblk1p1  
> mender\_pre\_setup\_commands= if test “${ramsize\_check}” != “”; then run ramsize\_check; fi; if test “${mmcargs}” != “”; then run mmcargs; fi; if test “${videoargs}” != “”; then run videoargs; fi; if test “${optargs}” != “”; then run optargs; fi; run findfdt; setenv mender\_dtb\_name ${fdt\_file}; setenv kernel\_addr\_r ${loadaddr};  
> mender\_saveenv\_canary=1  
> mender\_setup=if test “${mender\_saveenv\_canary}” != “1”; then setenv mender\_saveenv\_canary 1; saveenv; fi; if test “${mender\_pre\_setup\_commands}” != “”; then run mender\_pre\_setup\_commands; fi; if test “${mender\_systemd\_machine\_id}” != “”; then setenv bootargs “systemd.machine\_id=${mender\_systemd\_machine\_id} ${bootargs}”; fi; setenv mender\_kernel\_root /dev/mmcblk1p${mender\_boot\_part}; if test ${mender\_boot\_part} = 1; then setenv mender\_boot\_part\_name /dev/mmcblk1p1; else setenv mender\_boot\_part\_name /dev/mmcblk1p2; fi; setenv mender\_kernel\_root\_name ${mender\_boot\_part\_name}; setenv mender\_uboot\_root mmc 0:${mender\_boot\_part\_hex}; setenv mender\_uboot\_root\_name ${mender\_boot\_part\_name}; setenv expand\_bootargs “setenv bootargs \”${bootargs}\“”; run expand\_bootargs; setenv expand\_bootargs; if test “${mender\_post\_setup\_commands}” != “”; then run mender\_post\_setup\_commands; fi  
> mender\_try\_to\_recover=if test ${upgrade\_available} = 1; then reset; fi  
> mender\_uboot\_boot=mmc 0:1  
> mender\_uboot\_dev=0  
> mender\_uboot\_if=mmc  
> mender\_uboot\_root=mmc 0:1  
> mender\_uboot\_root\_name=/dev/mmcblk1p1  
> mfgtool\_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk\_ignore\_unused  
> mmc\_boot=if mmc dev ${devnum}; then devtype=mmc; run scan\_dev\_for\_boot\_part; fi  
> mmcdev=0  
> mmcpart=1  
> ramsize\_check=if test $sdram\_size -le 512; then setenv cma\_size cma=320M; else setenv cma\_size cma=640M@1376M; fi;  
> runm4bin=if test ${m4\_addr} = 0x7e0000; then echo Booting M4 from TCM; else echo Booting M4 from DRAM; dcache flush; fi; bootaux ${m4\_addr};  
> scan\_dev\_for\_boot=echo Scanning ${devtype} ${devnum}:${distro\_bootpart}…; for prefix in ${boot\_prefixes}; do run scan\_dev\_for\_extlinux; run scan\_dev\_for\_scripts; done;run scan\_dev\_for\_efi;  
> scan\_dev\_for\_boot\_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro\_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro\_bootpart} bootfstype; then run scan\_dev\_for\_boot; fi; done; setenv devplist  
> scan\_dev\_for\_efi=setenv efi\_fdtfile ${fdtfile}; for prefix in ${efi\_dtb\_prefixes}; do if test -e ${devtype} ${devnum}:${distro\_bootpart} ${prefix}${efi\_fdtfile}; then run load\_efi\_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro\_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot\_efi\_binary; echo EFI LOAD FAILED: continuing…; fi; setenv efi\_fdtfile  
> scan\_dev\_for\_extlinux=if test -e ${devtype} ${devnum}:${distro\_bootpart} ${prefix}${boot\_syslinux\_conf}; then echo Found ${prefix}${boot\_syslinux\_conf}; run boot\_extlinux; echo SCRIPT FAILED: continuing…; fi  
> scan\_dev\_for\_scripts=for script in ${boot\_scripts}; do if test -e ${devtype} ${devnum}:${distro\_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot\_a\_script; echo SCRIPT FAILED: continuing…; fi; done  
> script=boot.scr  
> sd\_dev=0  
> sdram\_size=2048  
> serial#=220c1a09dab4b749  
> soc=imx8m  
> soc\_type=imx8mm  
> som\_rev=som\_rev11  
> stderr=serial  
> stdin=serial  
> stdout=serial  
> upgrade\_available=0  
> usb\_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan\_dev\_for\_boot\_part; fi  
> use\_m4=no  
> vendor=variscite
> 
> Environment size: 6623/131067 bytes

After going though posts from people facing similar error:

[https://hub.mender.io/t/issue-with-variscite-var-som-mx8m-nano/2840/11](https://hub.mender.io/t/issue-with-variscite-var-som-mx8m-nano/2840/11)  
[https://hub.mender.io/t/variscite-var-dart-imx8mm-problem/2811](https://hub.mender.io/t/variscite-var-dart-imx8mm-problem/2811)

I made a couple of changes to the local.conf according to those posts, but I am still getting the same error message.

local.conf:

> INHERIT += “rm\_work”
> 
> MENDER\_ARTIFACT\_NAME = “release-2”  
> INHERIT += “mender-full”  
> DISTRO\_FEATURES\_append = " systemd"  
> VIRTUAL-RUNTIME\_init\_manager = “systemd”  
> DISTRO\_FEATURES\_BACKFILL\_CONSIDERED = “sysvinit”  
> VIRTUAL-RUNTIME\_initscripts = “”
> 
> MENDER\_STORAGE\_TOTAL\_SIZE\_MB\_imx8mm-var-dart = “13312”  
> #MENDER\_IMAGE\_BOOTLOADER\_FILE\_imx8mm-var-dart = “imx-boot-imx8mm-var-dart-sd.bin”  
> MENDER\_IMAGE\_BOOTLOADER\_FILE\_imx8mm-var-dart = “imx-boot”  
> MENDER\_IMAGE\_BOOTLOADER\_BOOTSECTOR\_OFFSET\_imx8mm-var-dart = “66”
> 
> IMAGE\_BOOT\_FILES\_imx8mm-var-dart = “”  
> MENDER\_BOOT\_PART\_SIZE\_MB\_imx8mm-var-dart = “0”
> 
> IMAGE\_FSTYPES\_remove = “tar.gz wic.gz wic.bmap mender.bmap sdimg.bmap sdcard.gz wic ext4”
> 
> MENDER\_FEATURES\_ENABLE\_append = " mender-image-sd mender-uboot"  
> MENDER\_FEATURES\_DISABLE\_append = " mender-image-uefi mender-grub"
> 
> MENDER\_STORAGE\_DEVICE\_imx8mm-var-dart = “/dev/mmcblk1”  
> MENDER\_UBOOT\_STORAGE\_DEVICE\_imx8mm-var-dart= “0”  
> UBOOT\_CONFIG\_imx8mm-var-dart = “sd”
> 
> MACHINE\_ESSENTIAL\_EXTRA\_RDEPENDS = “kernel-image kernel-devicetree”  
> KERNEL\_IMAGETYPE\_mender-uboot = “Image”
> 
> IMAGE\_POSTPROCESS\_COMMAND\_remove = “do\_qbsp\_image;”
> 
> MACHINE\_EXTRA\_RDEPENDS = “u-boot-fw-utils”  
> IMAGE\_BOOT\_FILES = “u-boot.bin”  
> #MENDER\_BOOT\_PART\_SIZE\_MB\_mender-uboot = “16”  
> #PREFERRED\_PROVIDER\_u-boot-fw-util= “u-boot-fw-utils-mender-auto-provided”

Do have any suggestions to how I can fix this problem? Thank you

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 28, 2021, 2:05pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/9 "2021-04-28T14:05:35Z")

</div>

I think the issue with needing to add `mender-uboot` explicitly is due to a change in the Mender defaults in the newer branches. It’s possible we need to update the templates for Zeus. It looks like the templates for Dunfell already have that.

You may also want to review [the templates](https://github.com/mendersoftware/meta-mender-community/tree/zeus/meta-mender-variscite/templates) to make sure you have all of the required settings.

I think you want to use “zImage” for KERNEL\_IMAGETYPE rather than “Image”. I _think_ that may be causing the BADMAGIC error.

Drew

---

<div class="post-metadata">

**Author:** ![ABTP](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ABTP](https://hub.mender.io/u/ABTP)\
**Post date:** [April 30, 2021, 2:34pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/10 "2021-04-30T14:34:41Z")

</div>

Hi Drew

Thanks you for clarifying. I really appreciate your support 🙂

I went ahead and used the exact configs from the templates, and changed the KERNEL\_IMAGETYPE to zImage, but unfortunately I still get the same error ( Bad Linux ARM64 Image magic!) so the kernel is not loaded.

The only thing that kind of worked was to disable mender-uboot and enable mender-grub:

> MENDER\_FEATURES\_ENABLE\_append = " mender-image-sd mender-grub"  
> MENDER\_FEATURES\_DISABLE\_append = " mender-image-uefi mender-uboot"

By doing so, the kernel was loaded successfully and the board booted to Boot2qt, but took around 2 minutes to finish booting (without mender it took less than a minute). Doing it like this means that u-boot loaded grub, then grub loaded the kernel and this is not what I want. I need u-boot to load the kernel.

The guy from this post had the same problem, and said he solved it by changing the dtb file in u-boot-variscite.bbappend. I did the same but no success ☹  
[https://hub.mender.io/t/variscite-var-dart-imx8mm-problem/2811/13](https://hub.mender.io/t/variscite-var-dart-imx8mm-problem/2811/13)

Any other suggestions how to fix the “Bad Linux ARM64 Image magic!” error?

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [April 30, 2021, 4:57pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/11 "2021-04-30T16:57:14Z")

</div>

That error message _seems_ to indicate that it is still trying to use Image format for some reason. Can you run the following:

> bitbake -e core-image-minimal | grep -B25 ‘^KERNEL\_IMAGETYPE=’

and also run the following from uboot?

> env default -a -f  
> saveenv  
> printenv

Drew

---

<div class="post-metadata">

**Author:** ![ABTP](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ABTP](https://hub.mender.io/u/ABTP)\
**Post date:** [May 3, 2021, 8:13am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/12 "2021-05-03T08:13:41Z")

</div>

The command

> bitbake -e b2qt-embedded-qt5-image | grep -B25 ‘^KERNEL\_IMAGETYPE=’

returns nothing. I modified it and used:

> bitbake -e b2qt-embedded-qt5-image 2\>&1 | grep ^KERNEL\_IMAGETYPE=

which returns:

> KERNEL\_IMAGETYPE=“Image.gz”

and this was set in the local.conf file. So it seems it is not being set anywhere else.

> u-boot=\> env default -a -f
> 
> ## Resetting to default environment
> 
> u-boot=\> saveenv  
> Saving Environment to MMC… Writing to MMC(1)… OK  
> u-boot=\> printenv  
> altbootcmd=run mender\_altbootcmd; run bootcmd  
> baudrate=115200  
> boot\_fdt=try  
> bootcmd=run mender\_setup; setenv bootargs root=${mender\_kernel\_root} ${bootargs}; if test “${fdt\_addr\_r}” != “”; then load ${mender\_uboot\_root} ${fdt\_addr\_r} /boot/${mender\_dtb\_name}; fi; load ${mender\_uboot\_root} ${kernel\_addr\_r} /boot/${mender\_kernel\_name}; ${mender\_boot\_kernel\_type} ${kernel\_addr\_r} - ${fdt\_addr\_r}; run mender\_try\_to\_recover  
> bootcmd\_mfg=run mfgtool\_args;if iminfo ${initrd\_addr}; then if test ${tee} = yes; then bootm ${tee\_addr} ${initrd\_addr} ${fdt\_addr}; else booti ${loadaddr} ${initrd\_addr} ${fdt\_addr}; fi; else echo “Run fastboot …”; fastboot 0; fi;  
> bootcount=0  
> bootdelay=1  
> bootdir=/boot  
> bootlimit=1  
> bootscript=echo Running bootscript from mmc …; source  
> console=ttymxc0,115200 earlycon=ec\_imx6q,0x30860000,115200  
> emmc\_dev=1  
> ethprime=FEC  
> fdt\_addr\_r=0x43000000  
> fdt\_file=undefined  
> fdt\_high=0xffffffffffffffff  
> findfdt=if test $fdt\_file = undefined; then if test $board\_name = VAR-SOM-MX8M-MINI; then if test $som\_rev = som\_rev10; then setenv fdt\_file imx8mm-var-som-rev10.dtb; else setenv fdt\_file imx8mm-var-som.dtb; fi;else setenv fdt\_file imx8mm-var-dart.dtb;fi; fi;  
> image=Image.gz  
> img\_addr=0x42000000  
> initrd\_addr=0x43800000  
> initrd\_high=0xffffffffffffffff  
> ip\_dyn=yes  
> kboot=booti  
> loadaddr=0x40480000  
> loadbootscript=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${script};  
> loadfdt=run findfdt; echo fdt\_file=${fdt\_file}; load mmc ${mmcdev}:${mmcpart} ${fdt\_addr} ${bootdir}/${fdt\_file}  
> loadimage=load mmc ${mmcdev}:${mmcpart} ${img\_addr} ${bootdir}/${image};unzip ${img\_addr} ${loadaddr}  
> loadm4bin=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootdir}/${m4\_bin}; cp.b ${loadaddr} ${m4\_addr} ${filesize}  
> m4\_addr=0x7e0000  
> m4\_bin=hello\_world.bin  
> mender\_altbootcmd=if test ${mender\_boot\_part} = 1; then setenv mender\_boot\_part 2; setenv mender\_boot\_part\_hex 2; else setenv mender\_boot\_part 1; setenv mender\_boot\_part\_hex 1; fi; setenv upgrade\_available 0; saveenv; run mender\_setup  
> mender\_boot\_kernel\_type=booti  
> mender\_boot\_part=1  
> mender\_boot\_part\_hex=1  
> mender\_check\_saveenv\_canary=1  
> mender\_dtb\_name=imx8mm-var-som.dtb  
> mender\_kernel\_name=Image.gz  
> mender\_pre\_setup\_commands= if test “${ramsize\_check}” != “”; then run ramsize\_check; fi; if test “${mmcargs}” != “”; then run mmcargs; fi; if test “${videoargs}” != “”; then run videoargs; fi; if test “${optargs}” != “”; then run optargs; fi; run findfdt; setenv mender\_dtb\_name ${fdt\_file}; setenv kernel\_addr\_r ${loadaddr};  
> mender\_setup=if test “${mender\_saveenv\_canary}” != “1”; then setenv mender\_saveenv\_canary 1; saveenv; fi; if test “${mender\_pre\_setup\_commands}” != “”; then run mender\_pre\_setup\_commands; fi; if test “${mender\_systemd\_machine\_id}” != “”; then setenv bootargs “systemd.machine\_id=${mender\_systemd\_machine\_id} ${bootargs}”; fi; setenv mender\_kernel\_root /dev/mmcblk1p${mender\_boot\_part}; if test ${mender\_boot\_part} = 1; then setenv mender\_boot\_part\_name /dev/mmcblk1p1; else setenv mender\_boot\_part\_name /dev/mmcblk1p2; fi; setenv mender\_kernel\_root\_name ${mender\_boot\_part\_name}; setenv mender\_uboot\_root mmc 0:${mender\_boot\_part\_hex}; setenv mender\_uboot\_root\_name ${mender\_boot\_part\_name}; setenv expand\_bootargs “setenv bootargs \”${bootargs}\“”; run expand\_bootargs; setenv expand\_bootargs; if test “${mender\_post\_setup\_commands}” != “”; then run mender\_post\_setup\_commands; fi  
> mender\_try\_to\_recover=if test ${upgrade\_available} = 1; then reset; fi  
> mender\_uboot\_boot=mmc 0:1  
> mender\_uboot\_dev=0  
> mender\_uboot\_if=mmc  
> mfgtool\_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk\_ignore\_unused  
> mmcargs=setenv bootargs console=${console} rootwait rw ${cma\_size}  
> mmcautodetect=yes  
> mmcblk=1  
> mmcboot=echo Booting from mmc …; run mmcargs; run optargs; if test ${boot\_fdt} = yes || test ${boot\_fdt} = try; then if run loadfdt; then booti ${loadaddr} - ${fdt\_addr}; else echo WARN: Cannot load the DT; fi; else echo wait for boot; fi;  
> mmcdev=0  
> mmcpart=1  
> netargs=setenv bootargs console=${console} ${cma\_size} ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp  
> netboot=echo Booting from net …; if test ${ip\_dyn} = yes; then setenv get\_cmd dhcp; else setenv get\_cmd tftp; fi; ${get\_cmd} ${img\_addr} ${image}; unzip ${img\_addr} ${loadaddr};run ramsize\_check; run netargs; run optargs; if test ${boot\_fdt} = yes || test ${boot\_fdt} = try; then run findfdt; echo fdt\_file=${fdt\_file}; if ${get\_cmd} ${fdt\_addr} ${fdt\_file}; then booti ${loadaddr} - ${fdt\_addr}; else echo WARN: Cannot load the DT; fi; else booti; fi;  
> optargs=setenv bootargs ${bootargs} ${kernelargs};  
> ramsize\_check=if test $sdram\_size -le 512; then setenv cma\_size cma=320M; else setenv cma\_size cma=640M@1376M; fi;  
> runm4bin=if test ${m4\_addr} = 0x7e0000; then echo Booting M4 from TCM; else echo Booting M4 from DRAM; dcache flush; fi; bootaux ${m4\_addr};  
> script=boot.scr  
> sd\_dev=0  
> upgrade\_available=0  
> use\_m4=no
> 
> Environment size: 4900/131067 bytes

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [May 3, 2021, 4:46pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/13 "2021-05-03T16:46:26Z")

</div>

You need to use `zImage` instead of `Image.gz` for the KERNEL\_IMAGETYPE.  
Drew

---

<div class="post-metadata">

**Author:** ![ABTP](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ABTP](https://hub.mender.io/u/ABTP)\
**Post date:** [May 5, 2021, 8:56am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/14 "2021-05-05T08:56:21Z")

</div>

> [@ABTP](#):
>
> mage.gz

My mistake. Actually in the local.conf I have set KERNEL\_IMAGETYPE=“zImage” but yocto still packages Image.gz instead. I searched all files where this change can be happening and found only one file where it was set to “Image.gz” and that was “variscite.inc”. In this file there is this line:

> KERNEL\_IMAGETYPE\_mx8 = “Image.gz”

I changed it to zImage, but when I complied the kernel I got this error message:

> | make[1]: \*\*\* No rule to make target ‘zImage’. Stop.

I Googled this error message and found this interesting answer:

> No, it isn’t possible to build a zImage for ARM64 platforms (such as the i.MX8MQ).
> 
> That is because it was decided in Linux not to add zImage support, so there’s no way around it.

[https://community.nxp.com/t5/i-MX-Processors/how-to-build-zImage-for-i-mx8mq/td-p/813439](https://community.nxp.com/t5/i-MX-Processors/how-to-build-zImage-for-i-mx8mq/td-p/813439)

How can we work around this issue?

Many thanks and appreciation for your help 🙂

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [May 5, 2021, 2:26pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/15 "2021-05-05T14:26:29Z")

</div>

Oops, of course. Image is the correct type for 64-bit arm. Sorry about the diversion.

I think the issue is that you need to decompress the Image.gz file. It’s not handled automatically.

As a quick test you can try changing it to “Image” just to see if that gets past the “Bad Magic” issue but I suspect it will be fairly slow loading the kernel in that format.

You can see [here how the decompression is handled](https://github.com/mendersoftware/meta-mender-community/blob/dunfell/meta-mender-toradex-nxp/recipes-bsp/u-boot-distro-boot/files/boot.cmd.in) in the Toradex integration. Presumably something similar will need to be done [here](https://github.com/mendersoftware/meta-mender-community/blob/53b8cfb4dc5ebb28fff0758dbfe39f5a90ac85ab/meta-mender-variscite/recipes-bsp/u-boot/u-boot-variscite.bbappend#L26) for the Variscite platforms.

Drew

---

<div class="post-metadata">

**Author:** ![ABTP](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ABTP](https://hub.mender.io/u/ABTP)\
**Post date:** [May 5, 2021, 2:58pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/16 "2021-05-05T14:58:34Z")

</div>

Initially I had it set to “Image”. If you look at the serial boot output in my post on 28.04.2021 you can see it set to Image. But I was seeing the same “Bad Magic” issue even then.

Just to clarify, before I attempted to integrate mender the original Boot2Qt was using “Image.gz” kernel type and there was no problem decompressing the kernel then. The board booted successfully.

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [May 5, 2021, 3:35pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/17 "2021-05-05T15:35:25Z")

</div>

Dang. In that case, I don’t have any other ideas and no longer have access to the hardware to try and replicate. Hopefully, other community members may have some ideas.

---

<div class="post-metadata">

**Author:** ![ABTP](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ABTP](https://hub.mender.io/u/ABTP)\
**Post date:** [May 6, 2021, 7:19am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/18 "2021-05-06T07:19:38Z")

</div>

Thank you Drew for trying to help. I will post this issue as a new topic on Mender hub so that others can see it.  
Best regards,  
Adam

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [July 21, 2021, 6:22am UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/19 "2021-07-21T06:22:43Z")

</div>

Is there some roadpmap to update this layer to dunfell LTS poky release? Seems to be up to date to thud/warrior only. Thanks.

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [February 23, 2023, 4:43pm UTC](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918/20 "2023-02-23T16:43:44Z")

</div>

5 posts were split to a new topic: [Fail to build Yocto image for imx8mm-var-dart](https://hub.mender.io/t/fail-to-build-yocto-image-for-imx8mm-var-dart/5638)

[Next page](https://hub.mender.io/t/variscite-var-som-mx8m-mini-nxp-i-mx-8m-mini/1918.md?page=2)
