Create .wic file that contains signed flash.bin and Image

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Create .wic file that contains signed flash.bin and Image

跳至解决方案
1,307 次查看
amosercq
Contributor III

Hello,

I have successfully been following the instructions from uboot-imx/doc/imx/habv4/guides/mx8m_secure_boot.txt at lf_v2022.04 · nxp-imx/uboot-imx to enable HABv4 on my iMX8MP.

I now have:

  1. The signed bootloader signed_flash.bin
  2. The signed kernel Image_signed.bin
  3. The (unsigned) OS image .wic

Currently, I have been flashing the .wic file to an SD card and manually replaced flash.bin and Image with their signed counterparts.

I was wondering whether there is a way I could modify my Yocto recipe so that the resulting .wic file already has the signed flash and Image?

many thanks,

Alex

0 项奖励
回复
1 解答
1,235 次查看
amosercq
Contributor III

Thank you, it seems that it is possible for me to replace the bootlader and kernel files in the deploy folder with their signed version (signed_flash.bin becomes imx-boot and Image_signed.bin becomes Image).
However, the new .wic file works when burned on an SD card, but seems to have problems when using uuu.

In` particular, even after adding the tag to the bootloader file, the uuu command errors with "This wic boot length is wrong".

The command used to flash the new (signed) wic file to eMMC is:
`uuu.exe -b emmc_all <image.wic>`

The output:
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.182-0-gda3cd53
Success 0 Failure 1
2:14-2016A80 1/ 1 [This wic boot length is wrong ] SDPS: boot -scanterm -f <image.wic> -scanlimited 0x800000

I was wondering if you knew what the cause of this error could be, before I dive into the mfgtools code to try reverse engineer it? 

 

Many thanks,

Alex

在原帖中查看解决方案

标记 (4)
0 项奖励
回复
3 回复数
1,279 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

The i.MX BSP package contains several root file systems. They are named with the following convention:
[image name]-[backend]-[platform][board].[ext4|wic]. The ext4 extension indicates a standard
file system. It can be mounted as NFS, or its contents can be stored on a boot media such as an SD/MMC card.
Check the Linux user guide to how to burn and copy firmware with hab container:

https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf

 

Regards

0 项奖励
回复
1,236 次查看
amosercq
Contributor III

Thank you, it seems that it is possible for me to replace the bootlader and kernel files in the deploy folder with their signed version (signed_flash.bin becomes imx-boot and Image_signed.bin becomes Image).
However, the new .wic file works when burned on an SD card, but seems to have problems when using uuu.

In` particular, even after adding the tag to the bootloader file, the uuu command errors with "This wic boot length is wrong".

The command used to flash the new (signed) wic file to eMMC is:
`uuu.exe -b emmc_all <image.wic>`

The output:
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.182-0-gda3cd53
Success 0 Failure 1
2:14-2016A80 1/ 1 [This wic boot length is wrong ] SDPS: boot -scanterm -f <image.wic> -scanlimited 0x800000

I was wondering if you knew what the cause of this error could be, before I dive into the mfgtools code to try reverse engineer it? 

 

Many thanks,

Alex

标记 (4)
0 项奖励
回复
1,204 次查看
amosercq
Contributor III

Update: the issue was due to a malformed imx-boot file that caused the length field not to match the actual size of the bootloader. It has now been fixed however uuu still fails to flash the signed .wic to eMMC.
It reaches 10% and then hangs, eventually erroring with HID(W): LIBUSB_ERROR_TIMEOUT (-7).

标记 (3)
0 项奖励
回复