Hello,
With yocto we can create a custom sdcard image. Then boot it on iMX8MMini EVK
1. How to compile the bootloader (u-boot) which is compatible with UUU?
if I try to execute uuu -v -b emmc my_freshly_backed_u-boot.bin,
I get: Fail Can find validate IVT header,
and only bootloader bin files supplied with imx-yocto-L4.14.98_2.0.0_ga package can be flashed.
2. How to flash the bootloader from the userspace???
echo 0 > /sys/block/mmcblk2boot0/force_ro
dd if=/tmp/_flash.bin of=/dev/mmc2boot0 bs=1K seek=32
echo 1 > /sys/block/mmcblk2boot0/force_ro
what else???
Flashing this with proper seek was not enough to get it working to boot from boot0. I changed partconf too. But no sign of life.
How can I know it starts reading data from boot0? Is there maybe something to change/configure in spl?
The UUU utility follows a two-step approach to program something into flash memory:
uuu <commands> <secondary loader firmware> <binary>
We have prepared the secondary loader firmware for different use cases, they can be found in the demo image package from our website here: https://www.nxp.com/webapp/Download?colCode=L4.14.98_2.0.0_MX8MM&appType=license
The name of the file describes rather well what it's used for:
If you flash something into eMMC, then most likely it should be something bootable. This means you have to create a bootable image, u-boot is just one component in this bootable image. So you don't flash just a bootloader, you flash a complete boot image, which contains several components required for booting.
The utility mkimage is used to create such a bootable image: GitHub - Freescale/imx-mkimage: FSLC Community fork of i.MX MkImage (original code in https://source... (please use the project on the CodeAurora server)
Regards,
Bernhard.
Hello,
Thank you for the answer.
And is there a yocto recipe, that creates the bootable eMMC image?
(seems like imx-boot or virtual/bootloader targets are creating imx-boot-imx8mmevk-sd.bin-flash_evk file in deploy folder)
The second question remains:
How to flash a bootloader image into eMMC when booted from the SDCard, and not using the UUU tool?
And I have an answer for this too:
the bootable image imx-boot-imx8mmevk-sd.bin-flash_evk has to be located at /dev/mmcblkXboot0 with offset of 0x8400 (33K) as stated in IMX8MMRM Table 6-25.
The command sequence is, assuming that the board has booted from the SDCard:
echo 0 > /sys/block/mmcblk2boot0/force_ro
dd if=imx-boot-imx8mmevk-sd.bin-flash_evk of /dev/mmcblk2boot0 bs=1K seek=33
echo 1 > /sys/block/mmcblk2boot0/force_ro
-Pauli