We need to update our devices with ROOTFS_AB=1 (Orin Nano 8GB with custom base board) from 35.5.0 to 36.5.0 in order to get the rce-fw fix for the 49day bug.
The procedure for this is:
- update rootfs in other partition to our image with 36.5.0
- copy bl capsule to esp partition
- set OsIndications uefi var
- copy new efi launcher (BOOTAA64.efi) to esp partition
- reboot
Now this works perfectly fine on devices that come from our factory (i.e. fully flashed with 35.5.0), starting from slot A.
I can see in the serial console that the qspi is flashed with the bootloader in the capsule, then switches to slot B and then picks up the new efi launcher which boots into our updated rootfs and all runs as expected.
From the updated slot B I can also successfully update slot A to 36.5.0 using exactly the same capsule and procedure.
Problem is that if I use another fresh device and only switch boot slots via nvbootctrl set-active-boot-slot 1, wait until it’s fully booted and ready (and hence nvbootctrl verify also ran already), the capsule is not applied and then the boot of course get’s stuck because the 35.5.0 bootloader can’t use the new L4T efi launcher.
When I then manually copy the old efi launcher back, it boots into slot B/1 again and esrt contains:
==> /sys/firmware/efi/esrt/entries/entry0/capsule_flags <==
0x0
==> /sys/firmware/efi/esrt/entries/entry0/fw_class <==
bf0d4599-20d4-414e-b2c5-3595b1cda402
==> /sys/firmware/efi/esrt/entries/entry0/fw_type <==
1
==> /sys/firmware/efi/esrt/entries/entry0/fw_version <==
2295040
==> /sys/firmware/efi/esrt/entries/entry0/last_attempt_status <==
6163
==> /sys/firmware/efi/esrt/entries/entry0/last_attempt_version <==
0
==> /sys/firmware/efi/esrt/entries/entry0/lowest_supported_fw_version <==
2295040
The same also happens if I switch back to A again before applying the capsule (6163, capsule not applied, and stil in slot A with incompatible efi launcher).
What is going on here? How can I make this work for devices we already have in the field, where we already updated the rootfs serveral times and hence switched boot slots multiple times?
In all cases the TNSPEC in /etc/nv_boot_control.conf is the same:
TNSPEC 3767-300-0003-S.1-1-1-rc_visard_ng-
COMPATIBLE_SPEC 3767--0003--1--rc_visard_ng-
TEGRA_LEGACY_UPDATE false
TEGRA_BOOT_STORAGE nvme0n1
TEGRA_EMMC_ONLY false
TEGRA_CHIPID 0x23
TEGRA_OTA_BOOT_DEVICE /dev/mtdblock0
TEGRA_OTA_GPT_DEVICE /dev/mtdblock0
and matches what is in the efi var:
sudo cat /sys/firmware/efi/efivars/TegraPlatformSpec-781e084c-a330-417c-b678-38e696380cb9
3767-300-0003-S.1-1-1-rc_visard_ng-
sudo cat /sys/firmware/efi/efivars/TegraPlatformCompatSpec-781e084c-a330-417c-b678-38e696380cb9
3767--0003--1--rc_visard_ng-
The bup in the capsule contains a bootloader with nearly the same tnspec (just 0 instead of 1 in the field before the board).
Apparently that has something to do with the slot? But none of the bups have a 1 there…
BLOB PATH:
Linux_for_Tegra/bootloader/payloads_t23x/bl_only_payload
BLOB HEADER:
Magic: NVIDIA__BLOB__V3
Version: v3.1-2022.6-0 (0x01030622)
Blob Size: 10,981,541 bytes
Header Size: 40 bytes
Entry Count: 30 partition(s)
Type: 0 (0 for update, 1 for BMP)
Uncompressed
Blob Size: 10,981,541 bytes
Accessory: Not Present
ENTRY TABLE:
| part_name | offset | part_size | version | op_mode | tnspec |
| BCT | 5560 | 8192 | 3650 | 2 | 3767-300-0003--1-0-rc_visard_ng- |
| BCT_A | 13752 | 8192 | 3650 | 2 | 3767-300-0003--1-0-rc_visard_ng- |
| BCT_B | 21944 | 8192 | 3650 | 2 | 3767-300-0003--1-0-rc_visard_ng- |
| mb1 | 30136 | 283120 | 3650 | 2 | 3767-300-0003--1-0-rc_visard_ng- |
| psc_bl1 | 313256 | 139264 | 3650 | 2 | |
| MB1_BCT | 452520 | 17664 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| MEM_BCT | 470184 | 243712 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| tsec-fw | 713896 | 192512 | 3650 | 0 | |
| nvdec | 906408 | 294912 | 3650 | 2 | |
| mb2 | 1201320 | 440880 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| xusb-fw | 1642200 | 164864 | 3650 | 2 | |
| bpmp-fw | 1807064 | 1027072 | 3650 | 2 | 3767-300-0003--1-0-rc_visard_ng- |
| bpmp-fw-dtb | 2834136 | 294528 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| psc-fw | 3128664 | 310768 | 3650 | 2 | |
| mts-mce | 3439432 | 187120 | 3650 | 2 | |
| sc7 | 3626552 | 187168 | 3650 | 2 | |
| pscrf | 3813720 | 139264 | 3650 | 2 | |
| mb2rf | 3952984 | 122688 | 3650 | 0 | |
| cpu-bootloader | 4075672 | 3184864 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| secure-os | 7260536 | 1932448 | 3650 | 0 | |
| eks | 9192984 | 9232 | 3650 | 0 | |
| dce-fw | 9202216 | 792368 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| spe-fw | 9994584 | 270336 | 3650 | 0 | |
| rce-fw | 10264920 | 458096 | 3650 | 0 | |
| adsp-fw | 10723016 | 124832 | 3650 | 0 | |
| pva-fw | 10847848 | 67024 | 3650 | 0 | |
| BCT-boot-chain_backup | 10914872 | 32768 | 3650 | 2 | 3767-300-0003--1-0-rc_visard_ng- |
| secondary_gpt_backup | 10947640 | 16896 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| VER | 10964536 | 109 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
| secondary_gpt | 10964645 | 16896 | 3650 | 0 | 3767-300-0003--1-0-rc_visard_ng- |
So to me it seems like the bup/capsule and procedure is fine, just for some reason silently rejected (no error in the serial console) if we already updated the rootfs before (or even only switched slots).
Since the last_attempt_status is set to 6163 and the cap is also deleted from the esp partition, OsIndications clearly was set correctly and EFI found the capule and deleted it.
Also the slots are all normal, and retry_count is at the configured max:
sudo nvbootctrl dump-slots-info
Current version: 35.5.0
Capsule update status: 0
Current bootloader slot: A
Active bootloader slot: A
num_slots: 2
slot: 0, status: normal
slot: 1, status: normal
sudo nvbootctrl -t rootfs dump-slots-info
Current rootfs slot: A
Active rootfs slot: A
num_slots: 2
slot: 0, retry_count: 1, status: normal
slot: 1, retry_count: 1, status: normal
I haven’t been able to find any difference between the cases where it works and where it fails, except that slots were switched at least once in the cases where it fails.
We’re out of ideas and need help here.