IMX8DXL Mender integration of yocto4.0

I am using IMX8DXL platform , succesfully build the yocto but unable to boot in the board and also below is the log attached we are getting .

Hi @tanushree.chandrashe,

Without knowing the board in question or how the integration looks like, its hard to give advice. Guessing, I would say that the Mender integration needs to be aligned with the specific boot scripts in u-boot.

Greetz,
Josef

Hi
I am trying to integrate mender on IMX8DXL.I have correctly 4 partitions and everything seems to be in place. but result was once it flashed booting is correctly when i powerd off and on then its not booting untill the next flash.
This is the build configuration
BB_VERSION = “2.0.0”
BUILD_SYS = “x86_64-linux”
NATIVELSBSTRING = “universal”
TARGET_SYS = “aarch64-poky-linux”
MACHINE = “imx8dxl-iwg46s”
DISTRO = “fsl-imx-xwayland”
DISTRO_VERSION = “5.15-kirkstone”
TUNE_FEATURES = “aarch64 armv8a crc crypto”

below is the machine configuration file
MENDER_STORAGE_DEVICE_DEFAULT = “/dev/mmcblk0”
MENDER_STORAGE_DEVICE_DEFAULT = “/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_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 = “0x2000”

Redundant environment

MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2 = “0x4000”
BOOTENV_SIZE = “0xE0000”
MENDER_UBOOT_PRE_SETUP_COMMANDS = “setenv kernel_addr_r ${loadaddr}; setenv bootargsconsole=ttyLP0,115200; setenv fdt_addr_r 0x83000000”
MENDER_SERVER_URL = “https://hosted.mender.io

This is the log when i bitbake the u-boot
Applying patch 0003-Integration-of-Mender-boot-code-into-U-Boot.patch
patching file include/env_default.h
Hunk #1 succeeded at 14 with fuzz 2 (offset 4 lines).
Hunk #2 succeeded at 30 (offset 4 lines).
patching file scripts/Makefile.autoconf
Hunk #1 succeeded at 109 (offset 1 line).

Applying patch 0004-Disable-CONFIG_BOOTCOMMAND-and-enable-CONFIG_MENDER_.patch
patching file include/env_default.h
Hunk #1 succeeded at 41 with fuzz 2 (offset 4 lines).

The context lines in the patches can be updated with devtool:

devtool modify u-boot-imx
devtool finish --force-patch-refresh u-boot-imx <layer_path>

Don’t forget to review changes done by devtool!

WARNING: u-boot-imx-2022.04-r0 do_patch: QA Issue: Patch log indicates that patches do not apply cleanly. [patch-fuzz]
WARNING: core-image-minimal-1.0-r0 do_image_sdimg: MENDER_BOOT_PART_SIZE_MB is set to zero, but IMAGE_BOOT_FILES is not empty. The files are being omitted from the image.

Hi i am trying to integrate mender on IMX8DXL with 5.15.52 BSP.
I am facing issue with values causing some of the functionalities to fail during testing.
MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 = “0x2000”

Redundant environment

MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2 = “0x4000”
BOOTENV_SIZE = “0xE0000”

I have tried different values, still no luck.

Do u have any suggestions to fix this.
is there any relation between OFFSET and suspend-to-RAM (put device to sleep)?
our issue was device is not going to sleep it gives write error.

Hi @tanushree.chandrashe,

Trying random values won’t do the trick here. The rationale here is making sure that the u-boot environment is properly set up and accessible. So these values need to reflect the u-boot config. You should have set CONFIG_ENV_IS_IN_MMC there, along with values for CONFIG_ENV_OFFSET and CONFIG_ENV_OFFSET_REDUND. Those are the values you need pass into MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 and MENDER_UBOOT_ENV_STORAGE_OFFSET_2". For an example on how the u-boot` config patch might look like, see the Raspberry Pi version of the patch here.

Summary: First you need to configure u-boot such that it fulfills the Mender requirements, then you need to tell Mender the specifics.

Greetz,
Josef

Hi,
In U-boot CONFIG_ENV_IS_IN_MMC was set and
MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 is set to 400000
MENDER_UBOOT_ENV_STORAGE_OFFSET_2 is set to 600000 .
In normal standard yocto with same software CPU suspend mode it going to sleep works fine but when we integrate to mender writing to suspend mode it give write error all other mender integration related its worked fine.
Is there any specific configuration for writing to suspend mode in mender?

Hi @tanushree.chandrashe,

We do not have any reports on conflicts between standby mode and the Mender integration. I can imagine that there are cross effects during resume, depending on the flow u-boot follows here, but nobody has stepped up to evaluate and polish it so far. If your use case requires it, we are happy to review and help with upstreaming patches.

Greetz,
Josef

hi @TheYoctoJester
Yes it requires once again i will share machine configuration file with worked mender.

MENDER_STORAGE_DEVICE_imx8dxlevk = “/dev/mmcblk0”
MENDER_STORAGE_DEVICE = “/dev/mmcblk0”

INHERIT += “mender-full”
IMAGE_FSTYPES:remove = “sdcard.bz2”
IMAGE_FSTYPES:append = " dataimg"
MENDER_ARTIFACT_NAME = “release-2.1”
MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi"
#MENDER_STORAGE_DEVICE_DEFAULT = “/dev/mmcblk0”
#MENDER_STORAGE_DEVICE_DEFAULT = “/dev/mmcblk0”
MENDER_STORAGE_DEVICE_BASE = “/dev/mmcblk0p”
MENDER_UBOOT_STORAGE_DEVICE_imx8dxl-iwg46s = “0”
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”
#OPTEE_BIN_EXT = “”
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = “10”

For rootfs size

IMAGE_ROOTFS_SIZE=“1887437”
ARTIFACTIMG_FSTYPE = “ext4”
EXTRA_IMAGECMD_ext4 = " -b 1024"

Environment

MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_1 = “0x400000”

Redundant environment

MENDER_UBOOT_ENV_STORAGE_DEVICE_OFFSET_2 = “0x600000”
BOOTENV_SIZE = “0x2000”
MENDER_UBOOT_PRE_SETUP_COMMANDS = “setenv kernel_addr_r ${loadaddr}; setenv bootargsconsole=ttyLP0,115200; setenv fdt_addr_r 0x83000000”

OPTLEVEL:remove = “-O2”

For enabling Mender 2.6.0

PREFERRED_VERSION_pn-mender = “3.1.%”
PREFERRED_VERSION_pn-mender-artifact = “3.6.%”
PREFERRED_VERSION_pn-mender-artifact-native = “3.6.%”

Build for hosted Mender

MENDER_SERVER_URL = “https://hosted.mender.io

MENDER_TENANT_TOKEN = “”

and also whatever mention in the previous reply that configs are already set and this all about suspend to RAM sleep wakeup.
can give a suggestion to fix this?

Hi @tanushree.chandrashe,

As already pointed out: if the integration works without using standby, then the common parts are okay. I assume that the boot flow in u-boot is different for the wakeup than for a cold boot, so you’d have to dig there and find out where the difference is, and eventually change/fix it.

We do not have any reports on standby related issues.

Greetz,
Josef