Solidrun i.MX6 integration errors

Thanks for your reply Mirzak… We have build the image for solidrun IMX6 board using Yocto framework and board is working fine with linux kernel… Now, I am trying to integrate the mender into yocto for my board. I have meta layer called meta-solidrun-arm-imx6 for u-boot… Build is throwing below errors with below changes … Image is getting generated but not booing up… Any suggestions??

  1. In conf/machine/solidrun-imx6.conf
    PREFERRED_PROVIDER_u-boot = “u-boot-my-fork”
  2. In recipes-bsp/u-boot/u-boot-solidrun-common_2018.01.inc
    require recipes-bsp/u-boot/u-boot-mender.inc
    +RPROVIDES_${PN} += “u-boot”
    BOOTENV_SIZE = “0x20000”
    3.`

ERROR: Nothing PROVIDES ‘u-boot-my-fork’
ERROR: Nothing PROVIDES ‘u-boot-fw-utils-mender-auto-provided’
No eligible PROVIDERs exist for ‘u-boot-fw-utils-mender-auto-provided’
ERROR: Nothing RPROVIDES ‘u-boot-fw-utils-mender-auto-provided’ (but /home/tcs/new-workspace/mender/poky/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-fw-utils-mender-auto-provided_1.0.bb RDEPENDS on or otherwise requires it)
No eligible RPROVIDERs exist for ‘u-boot-fw-utils-mender-auto-provided’
NOTE: Runtime target ‘u-boot-fw-utils-mender-auto-provided’ is unbuildable, removing…
Missing or unbuildable dependency chain was: [‘u-boot-fw-utils-mender-auto-provided’]
ERROR: Nothing RPROVIDES ‘u-boot-fw-utils-mender-auto-provided-dev’ (but /home/tcs/new-workspace/mender/poky/meta-mender/meta-mender-core/recipes-bsp/u-boot/u-boot-fw-utils-mender-auto-provided_1.0.bb RDEPENDS on or otherwise requires it)
No eligible RPROVIDERs exist for ‘u-boot-fw-utils-mender-auto-provided-dev’
NOTE: Runtime target ‘u-boot-fw-utils-mender-auto-provided-dev’ is unbuildable, removing…
Missing or unbuildable dependency chain was: [‘u-boot-fw-utils-mender-auto-provided-dev’]

Well you need to replace,

 PREFERRED_PROVIDER_u-boot = “u-boot-my-fork”

With the actual name of your U-boot fork, and I suspect it is something like u-boot-solidrun.

Thanks Mirzak…
I added below line in conf/machine and it compiled with out errors… But still board not booting up
PREFERRED_PROVIDER_u-boot = “u-boot-solidrun-imx6”

Just Loaded core-image-full-cmdline-solidrun-imx6–20190402133350.wic image instead of .sdimg and board booted up and showing the uboot prompt…

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

Defined as below in my previous build as well…
conf/local.conf:56:MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET = “1”

Defined it in one of the previous build and but now I will try now with this by removing the comment
conf/local.conf:55:#MENDER_IMAGE_BOOTLOADER_FILE = “u-boot-solidrun-imx6.img”

Please paste the content of wks file used when it worked.

I will share the details and configuration here…

Board not booting up even after adding those variables in local.conf… The boot partition shows only few .dtb files, uImaze and extlinux folder… Not seeing any boot.scr etc… But u-boot.img is there in /boot folder in 1st and 2nd partition of sd card…

Unclear to me what boot process is on your board and hard to comment without further details.

But I would compare the “wic” image (since you have it working) to “sdimg” and see what is missing.

How to compare these 2 images?
What is this u-boot-fw-utils? I see u-boot code in u-boot-fw-utils and as well as in u-boot-solidrun-imx6…
Patches were applied in both places…

How to compare these 2 images?

I do not have insight to how you system works so not able to provide any detailed comments. But I was mostly referring to as you have something that is working/booting (wic image) that is always a good starting point for further debugging.

What is this u-boot-fw-utils? I see u-boot code in u-boot-fw-utils and as well as in u-boot-solidrun-imx6…
Patches were applied in both places…

It is expected for these to share patches. u-boot-fw-utils are the fw_setenv/fw_getenv user-space tools that allows you to manipulate the U-boot environment and this is something that Mender uses.

fw_setenv/fw_getenv are actually part of the U-boot source (make env will build them) and that is why you are seeing duplication but this is expected and both of this recipes have to apply the same patches to get the correct default U-boot environment.

u-boot-fw-utils sources are getting downloaded from : poky/meta/recipes-bsp/u-boot/u-boot-common_2018.07.inc
SRC_URI = "git://git.denx.de/u-boot.git
file://CVE-2018-1000205-1.patch
file://CVE-2018-1000205-2.patch \

And u-boot for Solidrun getting downloaded from:poky/meta-solidrun-arm-imx6/recipes-bsp/u-boot/u-boot-solidrun-common_2018.01.inc

require recipes-bsp/u-boot/u-boot.inc
require recipes-bsp/u-boot/u-boot-mender.inc

PROVIDES += “u-boot”
RPROVIDES_{PN} += "u-boot" SRC_URI = "git://github.com/SolidRun/u-boot.git;branch={SRCBRANCH}"

Mender patches are failing on u-boot-fw-utils (include/env_default.h)…

I have tried following things for above problem:

  1. I included boot-solidrun-common_2018.01.inc in poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.07.bb file instead of u-boot-common_2018.07.inc… But failed…
  2. I have confusions on using u-boot-fw-utils-mender-auto-provided… Done following this for it
    cat …/…/…/meta-solidrun-arm-imx6/conf/machine/solidrun-imx6.conf | grep auto
    PREFERRED_PROVIDER_u-boot-fw-utils = “u-boot-fw-utils-mender-auto-provided”
    PREFERRED_RPROVIDER_u-boot-fw-utils = “u-boot-fw-utils-mender-auto-provided”

I am able to now download the same source for fw-utils and u-boot… But now facing below issues
tall: cannot stat ‘/home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/u-boot-solidrun-fw-utils/v2018.01-solidrun-imx6+gitAUTOINC+457cdd60c3-r0/git/tools/env/fw_printenv’: No such file or directory

install: cannot stat ‘/home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/u-boot-solidrun-fw-utils/v2018.01-solidrun-imx6+gitAUTOINC+457cdd60c3-r0/build/u-boot.img’: No such file or directory

I am able to now download the same source for fw-utils and u-boot… But now facing below issues
tall: cannot stat ‘/home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/u-boot-solidrun-fw-utils/v2018.01-solidrun-imx6+gitAUTOINC+457cdd60c3-r0/git/tools/env/fw_printenv’: No such file or directory

Looks like the fw_printenv util was not build, I would check the logs if there was an error or if it even tried to do so.

install: cannot stat ‘/home/tcs/new-workspace/mender/poky/build/tmp/work/solidrun_imx6-poky-linux-gnueabi/u-boot-solidrun-fw-utils/v2018.01-solidrun-imx6+gitAUTOINC+457cdd60c3-r0/build/u-boot.img’: No such file or directory

Why is the u-boot-solidrun-fw-utils recipe trying to install u-boot.img?

There is a tmp-src/ in u-boot-solidrun-fw-utils/v2018.01-solidrun-imx6+gitAUTOINC+457cdd60c3-r0/ and fw_printenv binary placed here not in git/ dir… do_install is trying install it from git/ folder…

Do you see any problem in below
machine/solidrun-imx6.conf:
PREFERRED_PROVIDER_u-boot-fw-utils = “u-boot-solidrun-fw-utils”
PREFERRED_RPROVIDER_u-boot-fw-utils = “u-boot-solidrun-fw-utils”

PREFERRED_PROVIDER_u-boot = “u-boot-solidrun-imx6”
IMAGE_BOOT_FILES ?= “u-boot.img”
IMAGE_BOOT_FILES_append = " extlinux.conf;extlinux/extlinux.conf"

This all looks ok to me.

You could try to drop these lines,

PREFERRED_PROVIDER_u-boot-fw-utils = “u-boot-solidrun-fw-utils”
PREFERRED_RPROVIDER_u-boot-fw-utils = “u-boot-solidrun-fw-utils”

And then this one will be used,

https://github.com/mendersoftware/meta-mender/blob/master/meta-mender-core/recipes-bsp/u-boot/u-boot-fw-utils-mender-auto-provided_1.0.bb

Also compare your u-boot-solidrun-fw-utils recipe with the upstream one.

Removed below lines and compiled…

PREFERRED_PROVIDER_u-boot-fw-utils = “u-boot-solidrun-fw-utils”
PREFERRED_RPROVIDER_u-boot-fw-utils = “u-boot-solidrun-fw-utils”
There is no changes in the u-boot-fw-utils folder in the work/ folder..  But the compilation done  in the u-boot-solidrun-imx6/v2018.01-solidrun-imx6+gitAUTOINC+457cdd60c3-r0/**tmp-src**/tools/env/ folder and fw_printenv got created here...  Same way u-boot.img and u-boot.env created in build/ dir..

What is the difference between .img and .env here in below? Which one should be there in the **boot** partition of SD card.. I see only uImage, dtb file and extlinux.conf files in it.. I think u-boot.img / u-boot.env should be there in this boot partition to load the u-boot image right??

331872 Apr  7 22:08 u-boot-solidrun-imx6-v2018.01-solidrun-imx6+gitAUTOINC+457cdd60c3-r0.img
16777216 Apr  7 22:08 uboot.env

According to mender documentation, boot partition contains the U-Boot bootloader and its environment but I see boot.scr, dtb and uImage , when i built and loaded your clearfog .sdimg…
How boot partition finds and loads the u-boot bootloader for clearfog…?
I am very new to this uboot and linux kernel stuff, partitions etc…

Where U-boot is stored for the boot ROM to load it is highly board specific and as I do not have experience from your board I can not really provide any suggestions.

On the Clearfog Base board U-boot is stored in the first block (512 bytes) on the SD/eMMC, but this is probably not transferable to the Solidrun i.MX6 board.

The below stuff is missing or I have not added as part of Mender integration…

  1. u-boot.scr stuff missing for my board like below which is there for Clearfog
    meta-clearfog/recipes-bsp/clearfog-u-boot-scr
    2.Even not I have not created .wks for my board like below for Clearfog
    mender-clearfog/sources/meta-clearfog/wic$ ls
    clearfog.wks

What is the veriable through which you specified U-boot location for the boot ROM to load it for Clearfog??