Flashing WIC image by UUU over Fastboot

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Flashing WIC image by UUU over Fastboot

ソリューションへジャンプ
4,896件の閲覧回数
Oleh
Contributor II

Hello!
I'm trying to use the next script for UUU that flashes U-Boot and rootfs image to eMMC:

 

uuu_version 1.2.39

SDP: boot -f u-boot.imx
FB: flash mmc0boot0 u-boot.bin
FB: flash mmc0boot1 u-boot.bin
FB: ucmd mmc partconf ${mmcdev} 1 1 0
FB: flash -raw2sparse mmc0 core-image-minimal.wic
FB: acmd reset
FB: done

 

This script successfully flashes u-boot to mmc0boot0 and mmc0boot1,
but can't flash WIC image to eMMC's user area:

 

USB EHCI 1.00
Starting download of 450560 bytes
...
downloading of 450560 bytes finished
........ wrote 450560 bytes to EMMC_BOOT1
Starting download of 450560 bytes
...
downloading of 450560 bytes finished
........ wrote 450560 bytes to EMMC_BOOT2
Starting download of 16769064 bytes
..........................................................................
.....................................................
downloading of 16769064 bytes finished
fastboot_mmc_flash_write: updating MBR, Primary and Backup GPT(s)
GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
fastboot_mmc_flash_write: invalid GPT - refusing to write to flash

 

Logs from UUU:

 

uuu uuu.zip
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.4.72-0-g8e9e189

Success 0    Failure 1                                                                                                                                                                                            
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   5:12     4/ 6 [invalid GPT partition           ] FB: flash -raw2sparse mmc0 core-image-minimal.wic                                                                                           

WIC image:

 

 

Disk /tmp/core-image-minimal.wic: 392.63 MiB, 411697152 bytes, 804096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: CD05058F-4EEF-484A-A93A-7586FB4F8203

Device                                       Start    End Sectors   Size Type
/tmp/core-image-minimal.wic1  2048   4095    2048     1M Linux reserved
/tmp/core-image-minimal.wic2  4096 804061  799966 390.6M Linux root (ARM)

U-Boot version is 2021.04

 

Any ideas on how to solve this issue?

ラベル(1)
0 件の賞賛
1 解決策
4,864件の閲覧回数
Oleh
Contributor II
0 件の賞賛
8 返答(返信)
4,000件の閲覧回数
BiyongSUN
NXP Employee
NXP Employee

use emmc_alll instead of emmc for -b 

uuu -b emmc_all  flash.bin  abc.wic

 

uuu's help


uuu [-d -m -v] -b[run] <emmc|emmc_all|fat_write|nand|qspi|sd|sd_all|spl> arg...
Run Built-in scripts
emmc burn boot loader to eMMC boot partition
arg0: _flash.bin bootloader
arg1: _image[Optional] image burn to emmc, default is the same as bootloader
emmc_all burn whole image to eMMC
arg0: _flash.bin bootloader, which can extract from wic image
arg1: _image[Optional] wic image burn to emmc.
fat_write update one file in fat partition, require uboot fastboot running in board
arg0: _image image, which cp to fat partition
arg1: _device storage device, mmc\sata
arg2: _partition fat partition number, like 1:1
arg3: _filename[Optional] file name in target fat partition, only support rootdir now
nand burn boot loader to NAND flash
arg0: _flash.bin bootloader
arg1: _image[Optional] image burn to nand, default is the same as bootloader
qspi burn boot loader to qspi nor flash
arg0: _flexspi.bin bootloader
arg1: _image[Optional] image burn to flexspi, default is the same as bootloader
sd burn boot loader to sd card
arg0: _flash.bin bootloader
arg1: _image[Optional] image burn to emmc, default is the same as bootloader
sd_all burn whole image to sd card
arg0: _flash.bin bootloader, which can extract from wic image
arg1: _image[Optional] wic image burn to emmc.
spl boot spl and uboot
arg0: _flash.bin

0 件の賞賛
4,004件の閲覧回数
josephzhou1
Contributor V
uuu_version 1.2.39
SDPS: boot -f imx-boot-imx8mmevk-sd.bin-flash_evk
FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash -raw2sparse all fsl-image-validation-imx-imx8mmevk.sdcard
FB: flash bootloader imx-boot-imx8mmevk-sd.bin-flash_evk
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
Best Regards,
Joseph Zhou Jianhui / Senior Embedded Software Engineer, Singapore
0 件の賞賛
4,865件の閲覧回数
Oleh
Contributor II
0 件の賞賛
4,881件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

 

Did you refer to uuu.auto in demo images?

 

BR

Zhiming

0 件の賞賛
4,857件の閲覧回数
Oleh
Contributor II

Yes,
I've looked at those.

0 件の賞賛
4,839件の閲覧回数
thomas_C172
Contributor I

Hello,

may I ask a question? What exactly is inside your wic image? I'm just wondering, because you flash the bootloader(s) and the wic image, which itself contain the imx-boot (u-boot spl and u-boot).

Currently I'm trying to understand how to flash a whole wic image (containing everything, partitions, imx-boot, rootfs) to emmc via fastboot... can someone help?

Thanks in advance!

Thomas

0 件の賞賛
4,828件の閲覧回数
Oleh
Contributor II

Hello @thomas_C172,
My WIC images have two partitions:

fdisk -l core-image-minimal.wic
Disk core-image-minimal.wic: 392.63 MiB, 411697152 bytes, 804096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 62537CF6-741C-43F1-8EB7-6AEB3386CD57

Device Start End Sectors Size Type
core-image-minimal.wic1 2048 4095 2048 1M Linux reserved
core-image-minimal.wic2 4096 804061 799966 390.6M Linux root (ARM)

First used for U-Boot environment.
The second is a Linux Root File system.

But eMMC has hardware partitions:

  • mmcblk0 user area
  • mmcblk0boot0 and mmcblk0boot1 booting partitions (the only one that can be active)
  • mmcblk0rpmb

[ 8.145297] mmc0: new DDR MMC card at address 0001
[ 8.179060] mmcblk0: mmc0:0001 Q2J54A 3.59 GiB
[ 8.200411] mmcblk0boot0: mmc0:0001 Q2J54A partition 1 16.0 MiB
[ 8.221849] mmcblk0boot1: mmc0:0001 Q2J54A partition 2 16.0 MiB
[ 8.247040] mmcblk0rpmb: mmc0:0001 Q2J54A partition 3 512 KiB, chardev (243:0)

So I'm flashing U-Boot to hardware boot partitions to make the device more robust.
User will be able to unbrick a device even if Linux with rootfs partitions is gone.

Root FS doesn't have a U-Boot binary.

0 件の賞賛
4,821件の閲覧回数
thomas_C172
Contributor I

Thanks for sharing!

0 件の賞賛