Solidrun i.MX6 integration errors

My board is using SPL to bring up the board / load the boot loader and further loading the linux when i use the wic image alone…
Shall i need to add this SPL to IMAGE_BOOT_FILES ?=
I added uboot.img , boot.scr , SPL as well… But still uboot not up

Can you paste the content of the wks file that is by wic?

IMAGE_BOOT_FILES is typically not the variable to use for bootloader files and instead these are to be used,

To tell sdimg to embed the boot-loader you need to specific these two variables. e.g in you local.conf ,

https://docs.mender.io/1.7/artifacts/yocto-project/variables#mender_image_bootloader_bootsector_offset
https://docs.mender.io/1.7/artifacts/yocto-project/variables#mender_image_bootloader_file

@ramu did you try any of these steps to update SPL + u-boot to see if it’s working: link Juts my 2 cents.

  1. Specified imx-uboot-spl.wks name in machine/solidrun-imx6.conf. But I see solidrun_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/mender-sdimg.wks file. Content of the mender-sdimg.wks follows … I see SPL-partial and u-boot.img-partial as well in above dir…

embed bootloader

part --source rawcopy --sourceparams=“file=/home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/SPL-partial” --ondisk “mmcblk0” --align 1 --no-table
part --source rawcopy --sourceparams=“file=/home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/uboot.env” --ondisk “mmcblk0” --align 8192 --no-table
part --source rootfs --rootfs-dir /home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/bootfs.image_sdimg --ondisk “mmcblk0” --fstype=vfat --label boot --align 8192 --fixed-size 16 --active
part --source rootfs --ondisk “mmcblk0” --fstype=ext4 --label primary --align 8192 --fixed-size 5537792k --exclude-path data/ uboot/
part --source rootfs --ondisk “mmcblk0” --fstype=ext4 --label secondary --align 8192 --fixed-size 5537792k --exclude-path data/ uboot/
part --source rootfs --rootfs-dir /home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/rootfs/data --ondisk “mmcblk0” --fstype=ext4 --label data --align 8192 --fixed-size 128
bootloader --ptable msdos

  1. Following varaibles specified in local.conf

MENDER_ARTIFACT_NAME = “release-1”
INHERIT += “mender-full”
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"
MENDER_STORAGE_DEVICE = “/dev/mmcblk0”
MENDER_STORAGE_TOTAL_SIZE_MB = “11000”
IMAGE_INSTALL_append = " kernel-image kernel-devicetree"

For U-Boot

MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"
MENDER_IMAGE_BOOTLOADER_FILE = “u-boot.img”
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = “1”
ARTIFACTIMG_FSTYPE = “ext4”
MENDER_UBOOT_STORAGE_INTERFACE = “mmc”
MENDER_UBOOT_STORAGE_DEVICE = “0”
MENDER_IMAGE_BOOTLOADER_FILE = “u-boot.img”
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = “1”

I specified u-boot.img Instead of SPL for MENDER_IMAGE_BOOTLOADER_FILE in my previous builds… I have tried with SPL now… Still not Up…

I specified below variables in todays build only…
MENDER_UBOOT_STORAGE_INTERFACE = “mmc”
MENDER_UBOOT_STORAGE_DEVICE = “0”

3.## These are imp contents of machine/solidrun-imx6.conf

PREFERRED_PROVIDER_u-boot = “u-boot-solidrun-imx6”

#Changes End

UBOOT_MACHINE ?= “mx6cuboxi_defconfig”
UBOOT_MAKE_TARGET = “all”
UBOOT_SUFFIX = “img”
SPL_BINARY = “SPL”
WKS_FILE = “imx-uboot-spl.wks”

I added this when i added folder for u-boot-scr creation

WKS_FILE_DEPENDS = “virtual/bootloader solidrun-imx6-u-boot-scr”

I added SPL and boot.scr

IMAGE_BOOT_FILES_append = " SPL boot.scr extlinux.conf;extlinux/extlinux.conf"

UBOOT_EXTLINUX = “1”
UBOOT_EXTLINUX_ROOT = “root=PARTUUID=${uuid}”

KERNEL_IMAGETYPE = “zImage”
KERNEL_DEVICETREE = "
imx6q-hummingboard2.dtb
imx6q-hummingboard2-emmc.dtb
imx6q-hummingboard2-emmc-som-v15.dtb \

@MarekBelisko Wic image created from Yocto build working very fine… I am unable to integrated properly with mender… But wic image alone from Mender Yocto build able to bring up the board at least till uboot.

Not really interested in this one. I want the imx-uboot-spl.wks, as this is the one that works for you, correct?

.WKS definition for Clearfog as below
WKS_FILE = “clearfog.wks”
WKS_FILE_DEPENDS = “virtual/bootloader clearfog-u-boot-scr”

But generated mender-sdimg.wks file only not the clearfog.wks. But clearfog.wks defined in meta-clearfog/ folder…

Are we need to write this file in meta-solidrun/wic folder?

I see meta-mender-core/classes/mender-part-images.bbclass creating mender-sdimg.wks file in core-image-full-cmdline/1.0-r0/ folder.

Hi Mirzak,
Here is the content of imx-uboot-spl.wks file… This one is used for WIC image creation…
File location: meta-freescale/wic/imx-uboot-spl.wks

short-description: Create SD card image with a boot partition
long-description:
 Create an image that can be written onto a SD card using dd for use
 with i.MX SoC family.
 It uses SPL and u-boot

 The disk layout used is:
  - ----- --------- --------------
 | | SPL | u-boot  |    rootfs    |  - ----- --------- --------------
 ^ ^     ^         ^              ^
 | |     |         |              |
 0 1kiB  69kiB   4MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)

part SPL --source rawcopy --sourceparams="file=SPL" --ondisk mmcblk --no-table --align 1
part u-boot --source rawcopy --sourceparams="file=u-boot.img" --ondisk mmcblk --no-table --align 69
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

bootloader --ptable msdos

Edit: @mirzak: prettified file syntax

Oki, now I see what you need to do. You have two different files SPL and u-boot.img that need to be embedded. That is both must be written at the beginning of the disk.

Unfortunately MENDER_IMAGE_BOOTLOADER_FILE/OFFSET only accept one file as a argument. And to get around this you need to do something similar to this,

And then you can set,

MENDER_IMAGE_BOOTLOADER_FILE = "u-boot.img`
MENDER_IMAGE_BOOTLOADER_OFFSET = "1"

Thanks you Mirzak… I am just trying to understand where to add this make_u_boot_spl_image…
I added above function as below in board specific location @ recipes-bsp/u-boot/u-boot-tcs-imx6_2018.01.bbappend

u-boot-spl.img deployed into deploy/images but I am not seeing this file in boot partition and primary partitions /boot folder as well…

do_deploy() {
install -m 644 {B}/{config}/{SPL_BINARY} {DEPLOYDIR}/u-boot-spl-{PV}-{PR}.img
rm -f {DEPLOYDIR}/u-boot-spl.img ln -sf u-boot-spl-{PV}-{PR}.img {DEPLOYDIR}/u-boot-spl.img
dd if={DEPLOYDIR}/u-boot.img of={DEPLOYDIR}/u-boot-spl-{PV}-{PR}.img bs=1K seek=68 conv=notrunc
}

But i see this file getting written in mender-sdimg.wks file…

embed bootloader

part --source rawcopy --sourceparams=“file=/home/tcs/new-workspace/mender/poky/build/tmp/work/tcs_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/u-boot-spl.img partial” --ondisk “mmcblk0” --align 1 --no-table
part --source rawcopy --sourceparams=“file=/home/tcs/new-workspace/mender/poky/build/tmp/work/tcs_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/uboot.env” --ondisk “mmcblk0” --align 8192 --no-table
part --source rootfs --rootfs-dir /home/tcs/new-workspace/mender/poky/build/tmp/work/tcs_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/bootfs.image_sdimg --ondisk “mmcblk0” --fstype=vfat --label boot --align 8192 --fixed-size 16 --active
part --source rootfs --ondisk “mmcblk0” --fstype=ext4 --label primary --align 8192 --fixed-size 5537792k --exclude-path data/ uboot/
part --source rootfs --ondisk “mmcblk0” --fstype=ext4 --label secondary --align 8192 --fixed-size 5537792k --exclude-path data/ uboot/
part --source rootfs --rootfs-dir /home/tcs/new-workspace/mender/poky/build/tmp/work/tcs_imx6-poky-linux-gnueabi/core-image-full-cmdline/1.0-r0/rootfs/data --ondisk “mmcblk0” --fstype=ext4 --label data --align 8192 --fixed-size 128

Now i changes boot sector to 2 and checking it

Many thanks to you Mirzak… Board is up and even the linux also up and running…Below changes made the difference…

MENDER_IMAGE_BOOTLOADER_FILE = " u-boot-spl.img"
MENDER_IMAGE_BOOTLOADER_OFFSET = “2”

I need to try for updating the board with new artifact using mender client…

1 Like

Great to hear you where able to progress.