Unexpected U-Boot behavior when building Boot2Qt distro with Yocto

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unexpected U-Boot behavior when building Boot2Qt distro with Yocto

Jump to solution
1,543 Views
q325mg
Contributor II

I am working with NXP i.MX 8QuadXPlus Multisensory Enablement Kit (MEK) and I'd like to use Boot2Qt so I created Boot2Qt distro using this guide, the steps I did are:

$ git clone -b thud git://code.qt.io/yocto/meta-boot2qt.git
$ cd meta-boot2qt
$ ./b2qt-init-build-env init --device imx8qxpmek
$ export MACHINE=imx8qxpmek
$ source ./setup-environment.sh
$ bitbake -k b2qt-automotive-qt5-image.bb


After a while the image is generated, then I use the NXP manufacturing tool to flash it to the eMMC that MEK board includes:

sudo ./uuu -v -b emmc_all imx-boot-imx8qxpmek-sd.bin b2qt-automotive-qt5-image-imx8qxpmek.img

Finally Boot2Qt boots fine and I can see Neptune starting, but when I try to modify the U-Boot enviroment variables, somehow the boot partition gets corrupted.
Here is my U-Boot output

U-Boot 2018.03-imx_v2018.03_4.14.98_2.0.0_ga+g0d6d880779 (Jan 29 2020 - 17:15:28 +0000)
CPU: Freescale i.MX8QXP revB A35 at 1200 MHz at 22C
Model: Freescale i.MX8QXP MEK
Board: iMX8QXP MEK
Boot: MMC0
DRAM: 2.8 GiB
VService: Connection is ok on MU mu@5d230000
TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x50]
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
[pcie_ctrlb_sata_phy_init_rc] LNK DOWN 8600000
In: serial
Out: serial
Err: serial
BuildInfo:
 - SCFW f83a2bed, SECO-FW 92ef1143, IMX-MKIMAGE dd023400, ATF 1cb68fa
 - U-Boot 2018.03-imx_v2018.03_4.14.98_2.0.0_ga+g0d6d880779
switch to partitions #0, OK
mmc0(part 0) is current device
flash target is MMC:0
Net: eth0: ethernet@5b040000 [PRIME]
Warning: ethernet@5b050000 (eth1) using random MAC address - 5a:51:06:58:75:ab
, eth1: ethernet@5b050000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
=> setenv serverip '172.17.44.150'
=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=> boot
switch to partitions #0, OK
mmc0(part 0) is current device
** Unrecognized filesystem type **
** Unrecognized filesystem type **
Booting from net ...
BOOTP broadcast 1
BOOTP broadcast 2
DHCP client bound to address 172.17.44.45 (280 ms)
Using ethernet@5b040000 device
TFTP from server 172.17.44.150; our IP address is 172.17.44.45
Filename 'Image'.
Load address: 0x80280000
Loading: *
Abort
BOOTP broadcast 1
DHCP client bound to address 172.17.44.45 (35 ms)
Using ethernet@5b040000 device
TFTP from server 172.17.44.150; our IP address is 172.17.44.45
Filename 'fsl-imx8qxp-mek-rpmsg.dtb'.
Load address: 0x83000000
Loading: *
Abort
WARN: Cannot load the DT
=> fatls mmc 0
** Unrecognized filesystem type **
=>

Any tip of what I need to do to get to the modify the environment variables in U-Boot without corrupting my boot partition? or maybe I need to modify something in my recipes?

Thanks

0 Kudos
1 Solution
1,369 Views
q325mg
Contributor II

I found out how to fix it: I need to change the CONFIG_ENV_OFFSET definition in "u-boot-imx\include\configs\imx8qxp_mek.h‍" to make it higher than the boot image length

diff --git a/include/configs/imx8qxp_mek.h b/include/configs/imx8qxp_mek.h
index f9667db9f6..12f0362dfb 100755
--- a/include/configs/imx8qxp_mek.h
+++ b/include/configs/imx8qxp_mek.h
@@ -316,7 +316,7 @@
 #define CONFIG_ENV_SPI_MODE    CONFIG_SF_DEFAULT_MODE
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
 #else
-#define CONFIG_ENV_OFFSET       (64 * SZ_64K)
+#define CONFIG_ENV_OFFSET       (64 * SZ_128K)
 #define CONFIG_SYS_MMC_ENV_PART                0       /* user area */
 #endif‍‍‍‍‍‍‍‍‍‍‍‍

View solution in original post

0 Kudos
3 Replies
1,370 Views
q325mg
Contributor II

I found out how to fix it: I need to change the CONFIG_ENV_OFFSET definition in "u-boot-imx\include\configs\imx8qxp_mek.h‍" to make it higher than the boot image length

diff --git a/include/configs/imx8qxp_mek.h b/include/configs/imx8qxp_mek.h
index f9667db9f6..12f0362dfb 100755
--- a/include/configs/imx8qxp_mek.h
+++ b/include/configs/imx8qxp_mek.h
@@ -316,7 +316,7 @@
 #define CONFIG_ENV_SPI_MODE    CONFIG_SF_DEFAULT_MODE
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
 #else
-#define CONFIG_ENV_OFFSET       (64 * SZ_64K)
+#define CONFIG_ENV_OFFSET       (64 * SZ_128K)
 #define CONFIG_SYS_MMC_ENV_PART                0       /* user area */
 #endif‍‍‍‍‍‍‍‍‍‍‍‍
0 Kudos
1,369 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Isaias Acosta,

Boot2Qt is not supported by the BSP Release so I would recommend looking for more information on Qt centric forums.

That being said, have you tested changing the u-boot variables manually using setenv to doublecheck that the values are nor giving any problems? I see that you are setting up the IP address but have you tried each of the other variables to try to isolate the problem? If all boot environment variables are working correctly then I would check that the u-boot recipes are setting up these values as they are intended to.

From the log there is a problem loading the device tree as well, I would make sure that the device tree binary is not corrupt and that it’s the correct device tree for your hardware.

I hope this helps!
Regards,

0 Kudos
1,369 Views
q325mg
Contributor II

Hello gusarambula,

Thanks for answering.

Yes, I've tested other variables and I got the same result: after the saveenv command the partition gets corrupted and the boot no longer continue after U-Boot, it looks like the environment variables are being saved to some wrong part of the eMMC, but I am not sure. I also can see now that I have a message that states:

Loading Environment from MMC... *** Warning - bad CRC, using default environment‍

See this other U-Boot output:

U-Boot 2018.03-imx_v2018.03_4.14.98_2.0.0_ga+g0d6d880779 (Feb 10 2020 - 23:25:06 +0000)

CPU:   Freescale i.MX8QXP revB A35 at 1200 MHz at 22C
Model: Freescale i.MX8QXP MEK
Board: iMX8QXP MEK
Boot:  MMC0
DRAM:  3 GiB
TCPC:  Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x50]
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

Failed (-5)
[pcie_ctrlb_sata_phy_init_rc] LNK DOWN 8600000
In:    serial
Out:   serial
Err:   serial

 BuildInfo:
  - SCFW f83a2bed, SECO-FW d7523fe8, IMX-MKIMAGE dd023400, ATF 1cb68fa
  - U-Boot 2018.03-imx_v2018.03_4.14.98_2.0.0_ga+g0d6d880779

switch to partitions #0, OK
mmc0(part 0) is current device
flash target is MMC:0
Net:
Warning: ethernet@5b040000 using MAC address from ROM
eth0: ethernet@5b040000 [PRIME]
Warning: ethernet@5b050000 (eth1) using random MAC address - 76:47:86:97:a3:a4
, eth1: ethernet@5b050000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
=> fatls mmc 0
 22901248   Image
    83664   fsl-imx8qxp-mek-dom0.dtb
    83709   fsl-imx8qxp-mek-dsi-rm67191.dtb
    83359   fsl-imx8qxp-mek-dsp.dtb
    83315   fsl-imx8qxp-mek-enet2-tja1100.dtb
    83064   fsl-imx8qxp-mek-enet2.dtb
     4996   fsl-imx8qxp-mek-inmate.dtb
    83124   fsl-imx8qxp-mek-it6263-lvds0-dual-channel.dtb
    83124   fsl-imx8qxp-mek-it6263-lvds1-dual-channel.dtb
    83263   fsl-imx8qxp-mek-jdi-wuxga-lvds0-panel.dtb
    83263   fsl-imx8qxp-mek-jdi-wuxga-lvds1-panel.dtb
    83799   fsl-imx8qxp-mek-lcdif.dtb
    82458   fsl-imx8qxp-mek-ov5640-rpmsg.dtb
    83517   fsl-imx8qxp-mek-ov5640.dtb
    83591   fsl-imx8qxp-mek-root.dtb
    82009   fsl-imx8qxp-mek-rpmsg.dtb
    83068   fsl-imx8qxp-mek.dtb

17 file(s), 0 dir(s)

=> printenv bootdelay
bootdelay=3
=> setenv bootdelay 0
=> printenv bootdelay
bootdelay=0
=> saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=> printenv bootdelay
bootdelay=0
=> fatls mmc 0
** Unrecognized filesystem type **
=> boot
switch to partitions #0, OK
mmc0(part 0) is current device
** Unrecognized filesystem type **
Booting from net ...
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 172.17.44.38 (1294 ms)
Using ethernet@5b040000 device
TFTP from server 0.0.0.0; our IP address is 172.17.44.38
Filename 'Image'.
Load address: 0x80280000
Loading: T T
Abort
BOOTP broadcast 1
DHCP client bound to address 172.17.44.38 (4 ms)
Using ethernet@5b040000 device
TFTP from server 0.0.0.0; our IP address is 172.17.44.38
Filename 'fsl-imx8qxp-mek.dtb'.
Load address: 0x83000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
WARN: Cannot load the DT
=>
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Could you give some additional suggestions to what else too look for?

Thanks

0 Kudos