How is it possible to flash an image (wic-file) to emmc?

Stahl, Michael mstahl at moba.de
Tue Jul 23 07:32:16 CEST 2024


Hi,
after I swichted to the new uboot (2024.01) I can't flash a wic-file to the emmc anymore.

I use a uboot version for imx8 processors but I think the fastboot parts are equal. There is a special tool supported from NXP called uuu-tool to flash files by the fastboot protocol

With the old uboot (2021.04) I can flash the uboot-image as the wic-image as follows:

uuu.exe -b emmc flash.bin                 -> (flashes only the uboot)
uuu.exe -b emmc_all flash.bin wic.bin       -> (load the uboot into ram, start it and flash the wic-image)

My emmc has two separate boot-partitions with 16MB per partition. The emmc itself has 8GB

With the parameter -b the uuu-tool uses internal scripts.

Here is the simplified scirpt of emmc_all:
# @_flash.bin            | bootloader
# @_image   [_flash.bin] | image burn to emmc, default is the same as bootloader

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f _flash.bin

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash -raw2sparse all _image
FB: flash -scanterm -scanlimited 0x800000 bootloader _flash.bin
FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
FB: done


My emmc device number is 2. So the environment variable emmc_dev is also 2. The -raw2sparse parameter let the uuu tool download and flash chunks of the wic-image-file.

I found out that build-in script "emmc" also not work anymore.

The original emmc script:
# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f _flash.bin

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash bootloader _image
FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
FB: ucmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
FB: Done

I have to change the bold marked line into:
"FB: flash boot0 _image" or "FB: flash boot1 _image"
to flash the bootloade into the boot partitions of my emmc

But I did not find out how to modify the "emmc_all" script to flash the entire emmc

The wic-file is an image which contains:
partition 1: kernel
partition 2: rootfs
partition 3: kernel
partition 4: rootfs
partition 5: user memory

This is what I expect what the fb_mmc.c  and  image-sparse.c  should do in Linux-like-syntax
dd if=wic-image of=/dev/mmcblk2 bs=1M

I put some debug messages into fb_mmc.c to have a closer look to the thinks what happen during the flashing.
It seems that always is looked for partitions and its not possible to write to the raw emmc.


Which fastboot command can I use to flash the raw emmc regardless of whether there are already partitions or not?





Mit freundlichen Grüßen / Best Regards

Michael Stahl
Staatl. gepr. Techniker
Lead Engineer - Advanced Development

MOBA Mobile Automation AG


[Location]      Kapellenstraße 15,  65555 Limburg, Deutschland  [Globe]         www.moba-automation.de<https://moba-automation.de>
[Mail.png]      mstahl at moba.de<mailto:mstahl at moba.de>   [phone]         +49 6431 9577-439<tel:+49%206431%209577-439>
[MOBA Logo]     [cid:2e5b8e33-e905-441f-ac10-1803e0a80da3] <https://www.xing.com/companies/mobamobileautomationag>   <https://twitter.com/MOBA_Automation> [cid:d7cfd9f4-059e-414b-814d-493142624df5] <https://twitter.com/MOBA_Automation>   [cid:117f85e5-b05d-4481-9dc6-5120cafd20f3] <https://de.linkedin.com/company/moba-mobile-automation>   [cid:cb580079-18a8-43db-bdc1-db3fadc8d0fc] <https://www.facebook.com/MOBAWorldwide>   [cid:682a418e-9b49-4793-a415-54f1aef33637] <https://www.youtube.com/user/MOBALive>

Chairman of the supervisory board: Ralf Konrad;
Executive board: Volker G. Harms, Dr. Holger Barthel;
Corporate headquarters: Limburg;
Register court: Limburg, HRB 2552, USt-IdNr.: DE 113865988

Information about the protection of your personal data can be found here:
https://moba-automation.de/datenschutzinfo-geschaeftspartner

This message is intended for the addressee only as it contains private and confidential information.
The contents are not to be disclosed to anyone other than the addressee.
Unauthorized recipients are requested to comply with the above and inform the sender immediately of any error in transmission
P Before printing this email, please consider if it´s really necessary
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_location_05b23d7e-9cc5-496e-a772-f401f84b18e6.png
Type: image/png
Size: 2076 bytes
Desc: C2_signature_location_05b23d7e-9cc5-496e-a772-f401f84b18e6.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_globe_0c20eced-fd12-41b1-be5f-aabad1cdd2e4.png
Type: image/png
Size: 5047 bytes
Desc: C2_signature_globe_0c20eced-fd12-41b1-be5f-aabad1cdd2e4.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_mail_02e01343-3a27-4e98-8d00-a8a862359354.png
Type: image/png
Size: 2146 bytes
Desc: C2_signature_mail_02e01343-3a27-4e98-8d00-a8a862359354.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_moba_logo_2017_black_51caa85a-8b1d-4cae-b974-f4424d4dd509.png
Type: image/png
Size: 5034 bytes
Desc: C2_signature_moba_logo_2017_black_51caa85a-8b1d-4cae-b974-f4424d4dd509.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_xing_e334a75f-9c5c-4267-bd96-e76289037e90.png
Type: image/png
Size: 3502 bytes
Desc: C2_signature_xing_e334a75f-9c5c-4267-bd96-e76289037e90.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_twitter-x-logo_99e50335-4e29-499c-b35c-dbb6c2a3ac77.png
Type: image/png
Size: 4982 bytes
Desc: C2_signature_twitter-x-logo_99e50335-4e29-499c-b35c-dbb6c2a3ac77.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_linkedin_33b0278b-fa8a-4caf-b105-bf4c51334424.png
Type: image/png
Size: 1285 bytes
Desc: C2_signature_linkedin_33b0278b-fa8a-4caf-b105-bf4c51334424.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_facebook_6020928b-f0b9-4278-93e0-f51cdada49a7.png
Type: image/png
Size: 1170 bytes
Desc: C2_signature_facebook_6020928b-f0b9-4278-93e0-f51cdada49a7.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_youtube_6f3e8815-f822-430a-a56c-e6bbe330ff02.png
Type: image/png
Size: 1375 bytes
Desc: C2_signature_youtube_6f3e8815-f822-430a-a56c-e6bbe330ff02.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: C2_signature_pngwing.com_3702eb1d-f7af-4350-b9df-18068ce369bf.png
Type: image/png
Size: 48490 bytes
Desc: C2_signature_pngwing.com_3702eb1d-f7af-4350-b9df-18068ce369bf.png
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240723/8cf791e9/attachment-0009.png>


More information about the U-Boot mailing list