Hello,
This is related to my other active community post, but the issue is general enough that I thought it deserved its own thread. I have a working image (imx-image-full with a couple of custom layers) saved to an SD card that I can use to successfully boot my imx8mpevk development board. For the purpose of my other topic, I needed to modify a .dts file and recompile the associated .dtb file so that it can be added to our existing (working) image.
I backed up my .dts file and made my changes, then grabbed a blank SD card (to preserve my working image on the old card) and ran the following commands:
bitbake -f -c compile linux-imx
bitbake imx-image-full
bunzip2 -dk -f imx-image-full-imx8mpevk.wic.bz2
sudo dd if=imx-image-full-imx8mpevk.wic of=/dev/sdc bs=1M && sync
Outputs from the two bitbake steps are included in attachments.
When the dd command finishes, I can see the correct boot and root partitions on my SD card. I eject the SD card from my Linux machine and plug it into my development board, then I load up a serial terminal to get into the U-Boot console.
When the board powers on, I promptly receive the following warning:
Loading Environment from MMC... *** Warning - No block device, using default environment
This prevents "saveenv" commands from working, so I cannot save changes to environment variables, and ultimately the board cannot boot, as below:
u-boot=> boot
MMC Device 0 not found
no mmc device at slot 0
The full u-boot output is also attached for reference.
I went back and restored my old .dts file, recompiled and flashed the card again. This image should now be identical in every way to the one I have working on a different card, but I am getting the same U-Boot errors and finding myself unable to boot into Linux.
I suspect I must be missing some step in updating my existing image, but reading through the Yocto Project User's Guide and the Linux User's Guide has not brought me to any answers thus far. Any advice would be much appreciated! Please do let me know if I can provide any additional helpful detail.
Thank you,
Cody Robson
You need to customize the u-boot for it to have its environment on EMMC.
Please refer to chapter 3 of i.MX Porting Guide:
https://www.nxp.com/docs/en/user-guide/IMX_PORTING_GUIDE.pdf
Hi, thanks for your response. I will read through that chapter right away, but I have to say I don't understand why I would need to make these changes in U-Boot now when I haven't changed anything in my image. Why can't I continue using the standard U-Boot?
Hi @Cbrobson,
As far as I understand, you still want to boot from SD card not yet the eMMC, right? Even you expect to boot from eMMC, you do not need to change anything in u-Boot but reconfigure the DIPSWITCH on the board to select the correct boot mode /media (in the condition that you already flash the image into eMMC in advance).
Can you detail how to make change to your .dts ? Did you modify directly one of the EVK dtbs (imx8mp-evk.dts, imx8mp-evk-basler.dts, imx8mp-evk-dual-basler.dts, ...) ?
I don't see any problem if you haven't changed anything in u-Boot. At least it would let you to do setenv and savenv on the fdt_file variable to select the required .dtb.
Before dd'ing, please remove the mounted partitions of older image on your SD card when you insert it into your host machine first :
sudo umount /media/<user-name>/boot /media/<user-name>/root
Then for the .wic.bz2, I would propose to use the file with the build-date suffix rather than its symbolic link :
bzip2 -dkf imx-image-full-imx8mpevk-20211012093945.rootfs.wic.bz2
Then flash it :
sudo dd if=imx-image-full-imx8mpevk-20211012093945.rootfs.wic of=/dev/sdc bs=1M status=progress && sync
Make sure that above process take enough time and reports appropriate image size.
Regards,
K