# Integration of mender to i.MX8M Mini

**URL:** <https://hub.mender.io/t/integration-of-mender-to-i-mx8m-mini/3696>\
**Category:** Yocto Project\
**Tags:** zeus\
**Created:** [May 31, 2021, 1:44pm UTC](https://hub.mender.io/t/integration-of-mender-to-i-mx8m-mini/3696 "2021-05-31T13:44:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaithanya](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@chaithanya](https://hub.mender.io/u/chaithanya)\
**Post date:** [May 31, 2021, 1:44pm UTC](https://hub.mender.io/t/integration-of-mender-to-i-mx8m-mini/3696/1 "2021-05-31T13:44:38Z")

</div>

Hi All,

I am integrating mender to i.MX8M Mini dev kit. I have added all the mender configuration required for the integration. Build is successful without any error, but after flashing the binaries board will not boot because environment variables are not set properly in uboot.

Below is the screenshot of the uboot environment variable,

 ![uboot_printenv](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/5/515717144d4443aaf05e977417d8c9b7a2507e22.png)

Is there any additional configuration to be done for i.MX8M Mini platform?

Thanks & Regards,  
Chaithanya

---

<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 31, 2021, 3:52pm UTC](https://hub.mender.io/t/integration-of-mender-to-i-mx8m-mini/3696/2 "2021-05-31T15:52:03Z")

</div>

You might try running `env default -a -f` followed by `saveenv`. If the environment for that platform is stored in a separate device from the bootloader itself, then simply installing the new bootloader is not sufficient to get the new environment in place.

That said, that seems like a suspiciously short list of environment variables for an U-Boot configuration I have ever seen. Can you share some more details of how you did the integration and build?

Drew

---

<div class="post-metadata">

**Author:** ![chaithanya](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@chaithanya](https://hub.mender.io/u/chaithanya)\
**Post date:** [June 1, 2021, 5:52am UTC](https://hub.mender.io/t/integration-of-mender-to-i-mx8m-mini/3696/3 "2021-06-01T05:52:44Z")

</div>

@drewmoseley

Below is the integration steps I followed,

- Adding mender layer to yocto build:

echo “# Mender Support” \>\> $BUILD\_DIR/conf/bblayers.conf  
echo "BBLAYERS += " ${BSPDIR}/sources/meta-mender/meta-mender-core “” \>\> $BUILD\_DIR/conf/bblayers.conf  
echo "BBLAYERS += " ${BSPDIR}/sources/meta-mender/meta-mender-demo “” \>\> $BUILD\_DIR/conf/bblayers.conf

- Added below lines in bb file of uboot

require recipes-bsp/u-boot/u-boot-mender.inc  
PROVIDES += “u-boot”  
RPROVIDES\_${PN} += “u-boot”

- Added below lines in …/conf/machine/include/imx-base.inc

PREFERRED\_PROVIDER\_u-boot ??= “u-boot-iwg”  
PREFERRED\_PROVIDER\_virtual/bootloader ??= “u-boot-iwg”

- Updated machine file with below changes

IMAGE\_INSTALL\_append = " systemd "  
MENDER\_ARTIFACT\_NAME = “release-1.1”  
INHERIT += “mender-full”  
IMAGE\_FSTYPES\_remove = “sdcard.bz2”  
IMAGE\_FSTYPES\_append = " dataimg"  
MENDER\_FEATURES\_ENABLE\_append = " mender-uboot mender-image-sd"  
MENDER\_FEATURES\_DISABLE\_append = " mender-grub mender-image-uefi"

IMAGE\_BOOT\_FILES += “u-boot.bin”  
ARTIFACTIMG\_FSTYPE = “ext4”  
EXTRA\_IMAGECMD\_ext4 = " -b 1024"  
KERNEL\_IMAGETYPE ?= “Image”

MENDER\_STORAGE\_DEVICE = “/dev/mmcblk0”  
MENDER\_STORAGE\_DEVICE\_BASE = “/dev/mmcblk0p”  
MENDER\_STORAGE\_TOTAL\_SIZE\_MB = “8192”  
MENDER\_BOOT\_PART\_SIZE\_MB = “0”  
MENDER\_DATA\_PART\_SIZE\_MB = “128”  
MENDER\_ROOTFS\_PART\_A = “${MENDER\_STORAGE\_DEVICE\_BASE}1”  
MENDER\_ROOTFS\_PART\_B = “${MENDER\_STORAGE\_DEVICE\_BASE}2”  
MENDER\_DATA\_PART = “${MENDER\_STORAGE\_DEVICE\_BASE}3”  
MENDER\_PERSISTENT\_CONFIGURATION\_VARS = “RootfsPartA RootfsPartB”  
MENDER\_IMAGE\_BOOTLOADER\_FILE = “imx-boot-${MACHINE}-sd.bin-flash\_iwg34m”  
MENDER\_IMAGE\_BOOTLOADER\_BOOTSECTOR\_OFFSET = “66”

IMAGE\_ROOTFS\_SIZE=“1887437”

MENDER\_UBOOT\_ENV\_STORAGE\_DEVICE\_OFFSET\_1 = “0x2000”

MENDER\_UBOOT\_ENV\_STORAGE\_DEVICE\_OFFSET\_2 = “0x4000”  
BOOTENV\_SIZE = “0x2000”  
MENDER\_UBOOT\_PRE\_SETUP\_COMMANDS = “run m4boot\_0”

PREFERRED\_VERSION\_pn-mender = “2.5.%”  
PREFERRED\_VERSION\_pn-mender-artifact = “3.5.%”  
PREFERRED\_VERSION\_pn-mender-artifact-native = “3.5.%”

MENDER\_SERVER\_URL = “[https://hosted.mender.io](https://hosted.mender.io)”

MENDER\_DEMO\_HOST\_IP\_ADDRESS = “192.168.0.100”

* * *

U-boot version - 2020.04  
Yocto version - zeus  
Mender version - 2.5

---

<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:** [June 1, 2021, 2:17pm UTC](https://hub.mender.io/t/integration-of-mender-to-i-mx8m-mini/3696/4 "2021-06-01T14:17:58Z")

</div>

Nothing immediately jumps out at me. I suspect something is not getting patched properly for your u-boot fork but hard to say what exactly. It could be related to the storage location of the environment so I suggest you start investigating what the ENV\_IS\_IN\_\* macros are set for your fork.

Drew
