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,
Is there any additional configuration to be done for i.MX8M Mini platform?
Thanks & Regards,
Chaithanya
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
@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”
MENDER_DEMO_HOST_IP_ADDRESS = “192.168.0.100”
U-boot version - 2020.04
Yocto version - zeus
Mender version - 2.5
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