[i.MX8M Mini EVK] [ARM SystemReady IR] EFI Capsule update issues

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

[i.MX8M Mini EVK] [ARM SystemReady IR] EFI Capsule update issues

Jump to solution
2,355 Views
rohitdubey
Contributor III

I've been trying to perform the EFI Capsule update procedure as detailed in sect.4.8 Arm SystemReady-IR  i.MX Linux User’s Guide​ but haven't been able to get it to work. I also found the attached document with slightly different instructions but those don't seem to work either.

To generate the capsule, I'm using the capsule.its and the procedure from one of the "See Also" links in the second document: https://git.linaro.org/people/paul.liu/systemready/build-scripts.git/tree/docs/iotgateimx8_capsule_u...

However, the process fails with the below error:

u-boot=> efidebug capsule update -v ${loadaddr}
Capsule guid: 6dcbd5ed-e82d-4c44-bda1-7194199ad92a
Capsule flags: 0x10000
Capsule header size: 0x1c
Capsule image size: 0x361da8
Cannot handle a capsule at 0000000040480000u-boot=>
u-boot=>

 

Are there any updated instructions and capsule.its/capsule.bin files I can test this with?

Labels (1)
0 Kudos
1 Solution
2,062 Views
rohitdubey
Contributor III

Hi,

We were able to get this to work after tweaking the procedure to copy the capsule to the EFI System partition instead of the BOOT partition. The working procedure is as follows:

  1. Write 8MMini SystemReady-IR certified bootloader to SDCard
  2. Mark mmcblk1p1 partion as EFI (with fdisk tool)
  3. Create /EFI/UpdateCapsule/ path on the efi partition and copy capsule1.bin there
  4. Boot 8MMini, stop in bootloader and run the below commands:

 

u-boot=> env set dfu_alt_info "mmc 1=1 raw 0x42 0x2000" 
u-boot=> efidebug boot add 0 Boot0000 mmc 1:1 capsule1.bin;efidebug boot next 0
u-boot=> setenv -e -nv -bs -rt -v OsIndications =0x04 
u-boot=> efidebug capsule disk-update /*at this point the bootloader is update*/ 
u-boot=> savee
u-boot=> reset

 

After the reset, the capsule1.bin file is deleted and the board should boot with the new bootloader

View solution in original post

0 Kudos
6 Replies
2,063 Views
rohitdubey
Contributor III

Hi,

We were able to get this to work after tweaking the procedure to copy the capsule to the EFI System partition instead of the BOOT partition. The working procedure is as follows:

  1. Write 8MMini SystemReady-IR certified bootloader to SDCard
  2. Mark mmcblk1p1 partion as EFI (with fdisk tool)
  3. Create /EFI/UpdateCapsule/ path on the efi partition and copy capsule1.bin there
  4. Boot 8MMini, stop in bootloader and run the below commands:

 

u-boot=> env set dfu_alt_info "mmc 1=1 raw 0x42 0x2000" 
u-boot=> efidebug boot add 0 Boot0000 mmc 1:1 capsule1.bin;efidebug boot next 0
u-boot=> setenv -e -nv -bs -rt -v OsIndications =0x04 
u-boot=> efidebug capsule disk-update /*at this point the bootloader is update*/ 
u-boot=> savee
u-boot=> reset

 

After the reset, the capsule1.bin file is deleted and the board should boot with the new bootloader

0 Kudos
2,336 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Please try by using below command in u-boot to generate the capsule image

./tools/mkeficapsule --raw flash.bin --index 1 capsule1.bin

Best regards,
Aldo.

0 Kudos
2,282 Views
rohitdubey
Contributor III

Hi Aldo,

I just had some success with the"--raw" option in mkeficapsule you suggested. The issue seemed to be a wrong offset and mmcpart values when setting up the dfu_alt_info variable, in addition to a reset needed to initialize EFI System Partition (detailed in another post).

Now, the capsule update works through the "efidebug capsule update" command, as well as the CapsuleApp.efi in the ACS image. However, the procedure mentioned in the i.MX Linux User's guide (Section 4.8.2) still doesn't seem to work for us. U-Boot simply ignores the capsule after the reset and we don't see any indication of an update.

I'd appreciate it if you could provide any suggestions about what could be causing issues with automatic update (using "efidebug capsule disk-update"), while the manual update ("efidebug capsule update"/CapsuleApp.efi) seems to work fine.

0 Kudos
2,276 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Got it, then please try the following:

u-boot=> env set dfu_alt_info "mmc 2=1 raw  0 0x2000 mmcpart 1"
u-boot=> efidebug boot add 0 Boot0000 mmc 2:1 capsule1.bin
u-boot=> efidebug boot next 0
u-boot=> setenv -e -nv -bs -rt -v OsIndications =0x04
u-boot=> efidebug capsule disk-update
u-boot=> reset

Best regards,
Aldo.

0 Kudos
2,230 Views
rohitdubey
Contributor III

Hi Aldo,

Thanks, the update doesn't seem to work on the EVK after running these commands:

U-Boot SPL 2021.04-lf_v2021.04+g1c0116f3da (Sep 06 2021 - 08:48:23 +0000)
Can't find PMIC:PCA9450
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
SEC0: RNG instantiated
Normal Boot
Trying to boot from MMC2
NOTICE: BL31: v2.4(release):lf-5.10.52-2.1.0-rc1-39-gbb4957067
NOTICE: BL31: Built : 04:45:39, Sep 8 2021


U-Boot 2021.04-lf_v2021.04+g1c0116f3da (Sep 06 2021 - 08:48:23 +0000)

CPU: i.MX8MMQ rev1.0 1800 MHz (running at 1200 MHz)
CPU: Commercial temperature grade (0C to 95C) at 39C
Reset cause: POR
Model: NXP i.MX8MM EVK board
DRAM: 2 GiB
TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x52]
Power supply on USB2
TCPC: Vendor ID [0x1fc9], Product ID [0x5110], Addr [I2C1 0x50]
MMC: FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
[*]-Video Link 0adv7535_mipi2hdmi adv7535@3d: Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
mxs_video lcdif@32e00000: failed to get any video link display timings
probe video device failed, ret -22

[0] lcdif@32e00000, video
[1] mipi_dsi@32e10000, video_bridge
[2] adv7535@3d, panel
adv7535_mipi2hdmi adv7535@3d: Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
mxs_video lcdif@32e00000: failed to get any video link display timings
probe video device failed, ret -22
In: serial
Out: serial
Err: serial
SEC0: RNG instantiated

BuildInfo:
- ATF bb49570

switch to partitions #0, OK
mmc2(part 0) is current device
flash target is MMC:2
Net: eth0: ethernet@30be0000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
starting USB...
Bus usb@32e40000: Port not available.
USB is stopped. Please issue 'usb start' first.
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
51015 bytes read in 4 ms (12.2 MiB/s)
Scanning disk mmc@30b50000.blk...
Scanning disk mmc@30b60000.blk...
Found 5 disks
adv7535_mipi2hdmi adv7535@3d: Can't find cec device id=0x3c
fail to probe panel device adv7535@3d
mxs_video lcdif@32e00000: failed to get any video link display timings
Remove /soc@0/bus@32c00000/usb@32e40000:extcon
Remove /soc@0/bus@30800000/ethernet@30be0000:phy-reset-gpios
Not a PE-COFF file
Loading Boot0000 'Boot0000' failed
Loading from BootNext failed, falling back to BootOrder
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/bootaa64.efi
647168 bytes read in 10 ms (61.7 MiB/s)
Remove /soc@0/bus@32c00000/usb@32e40000:extcon
Remove /soc@0/bus@30800000/ethernet@30be0000:phy-reset-gpios
Booting /efi\boot\bootaa64.efi
Welcome to GRUB!

Do you know what could be causing the BootNext  failure and if there are any other indications/messages we should expect in the bootlog when the disk-update is working correctly?

I'd also appreciate if you could provide us a capsule1.bin file (if you have a working one). That  might help rule out any setup issues.

Thanks & Regards,

Rohit

0 Kudos
2,321 Views
rohitdubey
Contributor III

Thanks Aldo!

The capsule update using the below command seems to work. However, the boot output doesn't seem to be any different, proving that the update went through. Also, it seems to corrupt the bootloader and the EVK doesn't get past the initial boot. 

Here's the procedure I'm following on the EVK:

  1. Use uuu to load an older version of the bootloader (with ARM System Ready support) to the eMMC (version: LF_v5.10_2.0.0_boot_IMX8MMEVK(SystemReady-IR certified)

 

./uuu.exe -b emmc imx-boot-imx8mmevk-sd.bin-flash_evk​

 

  • Program the ACS pre-built image on an SD card, boot the EVK from eMMC. Use the busybox option create and format an EFI System Partition on the eMMC
  • Create capsule1.bin using a newer bootloader (version LF_v5.10.52_2.1.0_boot_IMX8MMEVK-SystemReady-IR-certified) :

 

./tools/mkeficapsule --raw imx-boot-imx8mmevk-sd.bin-flash_evk --index 1 capsule1.bin​

 

  • Reboot the EVK board and run the below commands:

 

env set dfu_alt_info "mmc 1=1 raw 0x42 0x2000"
setenv -e -nv -bs -rt -v OsIndications =0x04
fatload mmc 1:1 ${loadaddr} capsule1.bin
efidebug capsule update -v ${loadaddr}​

 

  • The output from the update command seems to indicate it succeeded:

 

#u-boot=> efidebug capsule update -v ${loadaddr}
Capsule guid: 6dcbd5ed-e82d-4c44-bda1-7194199ad92a
Capsule flags: 0x10000
Capsule header size: 0x1c
Capsule image size: 0x362f7c
#u-boot=> ​
u-boot=> reset

 

However, the bootlog looks exactly the same and "version" command doesn't show that the version has been updated. Do you know what I could be missing in the procedure to cause the update to be ignored?

 

 

0 Kudos