Capsule update is not triggered with 35.6.2

Hi,

On 35.6.2, I can generate the capsule for jetson-agx-xavier-devkit. However, regardless if I try to apply it via OTA or manually, the update is not triggered.

Cmd:
sudo ./l4t_generate_soc_bup.sh -e t19x_spec -b jetson-agx-xavier-devkit t19x
sudo ./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t19x/bl_only_payload -o ./TEGRA_BL.Cap t194

Here are some information
sudo /opt/nvidia/l4t-bootloader-config/nv-l4t-bootloader-config.sh -v

2888-400-0001-E.0-1-2-jetson-agx-xavier-devkit-
Info. eMMC only board jetson-agx-xavier-devkit
Info. Installing mtdblock.
Info. Active boot storage: mmcblk0
Info. Legacy mode: false
TNSPEC 2888-400-0001-L.0-1-2-jetson-agx-xavier-devkit-
COMPATIBLE_SPEC 2888-400-0001-E.0-1-2-jetson-agx-xavier-devkit-
TEGRA_LEGACY_UPDATE false
TEGRA_BOOT_STORAGE mmcblk0
TEGRA_EMMC_ONLY true
TEGRA_CHIPID 0x19
TEGRA_OTA_BOOT_DEVICE /dev/mmcblk0boot0
TEGRA_OTA_GPT_DEVICE /dev/mmcblk0boot1
Info. Skip writing variable TegraPlatformCompatSpec
Info. Uninstalling mtdblock.
Info. Verifying boot status.
Info: variable BootChainFwStatus is not found.

sudo i2cdump -y 0 0x50

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef

00: 01 00 ff 00 48 0b 01 00 04 4c 00 00 00 00 00 00 ?..H??.?L…
10: 00 00 00 00 36 39 39 2d 38 32 38 38 38 2d 30 30 …699-82888-00
20: 30 31 2d 34 30 30 20 4c 2e 30 00 00 00 00 00 00 01-400 L.0…
30: 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff …
40: ff ff ff ff c6 13 cc 4b 04 00 30 34 32 30 37 31 …???K?.042071
50: 39 30 38 32 35 37 39 00 00 00 00 00 00 00 00 00 9082579…
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
90: 00 00 00 00 00 00 4e 56 43 42 1c 00 4d 31 00 00 …NVCB?.M1..
a0: ff ff ff ff ff ff ff ff ff ff ff ff c6 13 cc 4b …???K
b0: 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?..
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f …?

I also noticed those two threads (for xavier nx though):

Where it is says that only some revisions trigger the capsule update so maybe this is related but I do not have access to another devkit.

What can be done to check that the .cap is compatible with my devkit?

Thanks

I notice the following:

efivarfs on /sys/firmware/efi/efivars type efivarfs (ro,nosuid,nodev,noexec,relatime)

So probably the write to OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c fails. How can I make it writable?

If this matter, I build UEFI source myself.

hello sebastien.schertenleib,

FYI,
UEFI updates the bootloader through UEFI capsule update. once the UEFI capsule update is finished, the device reboots to the updated chain; otherwise, the device reboots to the original.

may I also the steps you’ve executed on the target side to trigger capsule update?
here’re the steps we’ve tested for your reference.
$ ls -al /dev/disk/by-partlabel/ // Check “esp” partition
$ sudo mount /dev/mmcblk0p18 /mnt/
$ cd /mnt/EFI/UpdateCapsule/
$ sudo cp /home/nvidia/TEGRA_BL.Cap .
$ cd /sys/firmware/efi/efivars/
$ printf "\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00" > /tmp/var_tmp.bin
$ sudo dd if=/tmp/var_tmp.bin of=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c bs=12;sync
$ sudo reboot

Hello,

I have tried the same commands than you:

mkdir /mnt/efi
sudo mount /dev/mmcblk0p41 /mnt/efi
mkdir /mnt/efi/EFI
mkdir /mnt/efi/EFI/UpdateCapsule/
cd /mnt/efi/EFI/UpdateCapsule/
sudo cp /home/ansible/TEGRA_BL.Cap .
cd /sys/firmware/efi/efivars/
printf “\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00” > /tmp/var_tmp.bin
sudo dd if=/tmp/var_tmp.bin of=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c bs=12;sync
sudo reboot

However, as previously mentioned, I am getting read-only file system with the dd command and thus OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c is not written into.

hello sebastien.schertenleib,

please dump below..
$ xxd /sys/firmware/efi/efivars/OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c
please see-also UefiSpec.h for checking EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED

BTW, is this Jetson AGX Xavier developer kit? or, you’re using a customize board?

Hi,

Thanks, I will check. This is using the official agx xavier devkit not a custom board. At the end the goal is to have it working on our own board but for the time being, we rely entirely on the official devkit.

$ xxd /sys/firmware/efi/efivars/OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c

00000000: 0600 0000 4500 0000 0000 0000 …E…

And uefi.h has the following:

define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004

hello sebastien.schertenleib,

that dumped results looks normal.

do you have bootloader logs for reference?

Hi,

Please find in the attachment, the relevant logs.

Thanks

putty-jan26.log (72.3 KB)

Hi,

I noticed some disparity on the same BSP 35.6.2 but once using agx xavier and once orin nx.

On agx xavier

dmesg | grep -i efi
gives
[ 0.000000] efi: EFI v2.70 by EDK II
[ 0.000000] efi: RTPROP=0x475e68c18 SMBIOS=0xc7bb0000 SMBIOS 3.0=0x47b730000 MEMATTR=0x4759cd018 ESRT=0x4759cf998 RNG=0x469c10018 MEMRESERVE=0x46a589c18
[ 0.000000] Kernel command line: root=PARTUUID=4a79ecd7-f51d-4b26-b810-20321a5dc784 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 video=efifb:off net.ifnames=1 usbcore.usbfs_memory_mb=2048 fsck.repair=yes
[ 0.014738] Remapping and enabling EFI services.
[ 0.494195] Registered efivars operations
[ 6.837645] tegra-slvs-ec 15ac0000.slvs-ec: No streams defined - setting to zero
[ 10.780363] systemd[1]: Starting Load Kernel Module efi_pstore…
[ 10.932452] systemd[1]: modprobe@efi_pstore.service: Succeeded.
[ 10.939568] systemd[1]: Finished Load Kernel Module efi_pstore.

mount | grep efivarfs
gives
efivarfs on /sys/firmware/efi/efivars type efivarfs (ro,nosuid,nodev,noexec,relatime)

On orin nx:

dmesg | grep -i efi
gives
[ 0.000000] efi: EFI v2.70 by EDK II
[ 0.000000] efi: RTPROP=0x4681fba98 SMBIOS=0xffff0000 SMBIOS 3.0=0x46bd00000 MEMATTR=0x467bfb018 ESRT=0x467bfdf98 RNG=0x459bf0018 MEMRESERVE=0x45ab3cc18
[ 0.003933] Remapping and enabling EFI services.
[ 1.446483] Registered efivars operations
[ 24.849256] systemd[1]: Starting Load Kernel Module efi_pstore…

mount | grep efivarfs
gives
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)

As you can see efivars is RW for orin nx but RO for agx xavier that explains why writting to OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c is fine with orin nx but not with agx xavier.

Is it supposed to be RO on agx xavier and if not what could cause this issue? Is there are different way to trigger the capsule update on agx xavier?

I also see the following if I try to remount with rw:
sudo mount -o remount,rw /sys/firmware/efi/efivars
Firmware does not support SetVariableRT. Cat not remount with rw

Then I found this document: https://developer.download.nvidia.com/embedded/L4T/UEFI_Readme_8.26.html that says “SetVariable is not supported at UEFI runtime for Jetson AGX Xavier” Is it still the case and what is the workaround then?

Thanks

hello sebastien.schertenleib,

I assume there’s a slot to marked as unbootable.
you may check $ sudo nvbootctrl dump-slots-info for the slots info, both of the slots should be normal for running capsule update.
hence..
please try below workaround if there’s a slot marked as unbootable.
for instance, $ sudo nvbootctrl set-SR-BR <slot>

Hi,

This is what nvbootctrl dump-slots-info gives:

Current version: 35.6.2
Capsule update status: 0
Current bootloader slot: A
Active bootloader slot: A
num_slots: 2
slot: 0, status: normal
slot: 1, status: normal

Can you try on your agx xavier devkit the following commands and report back the output?

mount | grep efivarfs
sudo mount -o remount,rw /sys/firmware/efi/efivars

Also can you investigate if the limitation from https://developer.download.nvidia.com/embedded/L4T/UEFI_Readme_8.26.html is still relevant in 35.6.2

  • SetVariable is not supported at UEFI runtime for Jetson AGX Xavier

Thanks

hello sebastien.schertenleib,

that’s due to SetVariable is not applicable for AGX Xavier as it does not have QSPI.
please refer to Set the UEFI Variable in the Recovery Kernel Shell, you should follow the steps without QSPI flash.

here’s our verification steps for your reference,
Steps:

[Host]
Flash rootfs-AB enable:
$ sudo ROOTFS_AB=1 ./flash.sh jetson-agx-xavier-devkit internal

Generate a multi-spec Capsule payload:
$ sudo ROOTFS_AB=1 ./l4t_generate_soc_bup.sh t19x
$ ./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t19x/bl_only_payload -o ./TEGRA_BL.Cap t194

[Target]
$ sudo su
# ll /dev/disk/by-partlabel/esp
# sudo mount /dev/mmcblk0p41 /mnt/
# cd /mnt/EFI
# mkdir UpdateCapsule
# cd UpdateCapsule/
# cp ${HOME}/TEGRA_BL.Cap .

===without QSPI steps===
$ sudo mkdir -p /opt/nvidia/esp
$ esp_uuid=$(lsblk -o name,partlabel,uuid | grep "mmcblk0" | awk '{ if($2 == "esp") print $3 }')
$ sudo mount UUID=$esp_uuid /opt/nvidia/esp

$ cd /opt/nvidia/esp/EFI/NVDA/Variables
$ printf "\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00" > /tmp/var_tmp.bin
$ sudo dd if=/tmp/var_tmp.bin of=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c bs=12;sync

capsule update test results..

$ sudo nvbootctrl dump-slots-info
Current version: 35.6.2
Capsule update status: 1
Current bootloader slot: B
Active bootloader slot: B
num_slots: 2
slot: 0,             status: normal
slot: 1,             status: normal

besides, here’s examination of efivars on AGX Xavier for your reference.

$ mount | grep efivarfs
efivarfs on /sys/firmware/efi/efivars type efivarfs (ro,nosuid,nodev,noexec,relatime)
$ sudo mount -o remount,rw /sys/firmware/efi/efivars
[  221.395666] Firmware does not support SetVariableRT. Can not remount with rw
mount: /sys/firmware/efi/efivars: mount point not mounted or bad option.