Writing eMMC firmware boot image from Linux on IMX8MQ-EVK

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

Writing eMMC firmware boot image from Linux on IMX8MQ-EVK

Jump to solution
1,301 Views
cminyard
Contributor II

I have an iMX8MQuadEVK board.  I can use mkimage to build an image and burn it to eMMC with uuu.  I can boot an ARM systemready SD card without issue.

I haven't found any instructions to write the eMMC firmware image from Linux.

On the target I have /dev/mmcblk0, which I assume is the eMMC.  There are three partitions, boot0, boot1, and rpmb.  I know what rpmb is.  How do I write the image to these devices?  Can you make it switch between boot0 and boot1?

Thanks.

0 Kudos
1 Solution
1,276 Views
cminyard
Contributor II

I was able to figure this out by trial and error.  The boot image that you normally write with uuu can be written on the target from Linux using:

# echo 0 > /sys/block/mmcblk0boot0/force_ro
# dd if=<image> of=/dev/mmcblk0boot0 bs=1024 seek=33 status=progress
# sync
# echo 1 > /sys/block/mmcblk0boot0/force_ro

So the boot loader starts 33K from the beginning of the boot0 partition.

It would be nice to know if you could use the boot1 partition as a backup partition, but that doesn't seem possible.  I suppose you could write a small firmware loader that ran in boot0 that would load from boot0 or boot1.  But that's kind of a pain.

I don't know if this will work on other boards, but I assume they have something similar.

View solution in original post

0 Kudos
3 Replies
1,277 Views
cminyard
Contributor II

I was able to figure this out by trial and error.  The boot image that you normally write with uuu can be written on the target from Linux using:

# echo 0 > /sys/block/mmcblk0boot0/force_ro
# dd if=<image> of=/dev/mmcblk0boot0 bs=1024 seek=33 status=progress
# sync
# echo 1 > /sys/block/mmcblk0boot0/force_ro

So the boot loader starts 33K from the beginning of the boot0 partition.

It would be nice to know if you could use the boot1 partition as a backup partition, but that doesn't seem possible.  I suppose you could write a small firmware loader that ran in boot0 that would load from boot0 or boot1.  But that's kind of a pain.

I don't know if this will work on other boards, but I assume they have something similar.

0 Kudos
973 Views
yixinchi
Contributor I
你好,您知道/dev/mmcblk0和/dev/mmcblk1在emmc的地址吗,我可以uboot命令行下将uboot进行在线更新吗
0 Kudos
961 Views
cminyard
Contributor II

> Hello, do you know the addresses of /dev/mmcblk0 and /dev/mmcblk1 in emmc? Can you update uboot online under the uboot command line?

You can look in the device tree for that information.

You could update it from the uboot command line, but I have not tried it.

0 Kudos