L4T 35.6.2 Bootloader Update

We need to update the bootloader on our devices. The update does not seem to start though.
What we did:

  1. Generate Payload and update Capsule:
FAB=$BOARDFAB BOARDSKU=$BOARDSKU BOARDID=$BOARDID FUSELEVEL=$FUSELEVEL ./build_l4t_bup.sh ${BOARDNAME%-nvme} mmcblk0p1
${ToT_BSP}/bootloader/BUP_generator.py -c ${ToT_BSP}/bootloader/payloads_t19x/bl_only_payload
./generate_capsule/l4t_generate_soc_capsule.sh -i ${ToT_BSP}/bootloader/payloads_t19x/bl_only_payload -o ${ROOT_DIR}/bup/bootloader.capsule $SOC

This yields the correct output I think:

BLOB HEADER:
       Magic: NVIDIA__BLOB__V3
     Version: v3.1-2022.6-0 (0x01030622)
   Blob Size: 11,662,149 bytes
 Header Size: 48 bytes
 Entry Count: 26 partition(s)
        Type: 0 (0 for update, 1 for BMP)
Uncompressed
   Blob Size: 11,662,149 bytes
   Accessory: 0x0000000000000000

ENTRY TABLE:
|       part_name       |  offset  | part_size | version | op_mode |                 tnspec                |
|                   BCT |     4832 |      2888 |   3562  |    2    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|                 BCT_A |     7720 |      2888 |   3562  |    2    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|                 BCT_B |    10608 |      2888 |   3562  |    2    | 3668-100-0001--1-2-zc0805-0000+p3668- |
| BCT-boot-chain_backup |    13496 |     32768 |   3562  |    2    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|                   mb1 |    46264 |    249008 |   3562  |    2    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|                 mb1_b |   295272 |    249008 |   3562  |    2    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|               MB1_BCT |   544280 |     29984 |   3562  |    0    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|               MEM_BCT |   574264 |    198656 |   3562  |    0    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|                spe-fw |   772920 |     95232 |   3562  |    0    |                                       |
|                   mb2 |   868152 |    207584 |   3562  |    0    |                                       |
|           mts-preboot |  1075736 |     24016 |   3562  |    2    |                                       |
|               mts-mce |  1099752 |    145184 |   3562  |    2    |                                       |
|            mts-proper |  1244936 |   3429968 |   3562  |    2    |                                       |
|                   VER |  4674904 |       109 |   3562  |    0    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|        cpu-bootloader |  4675013 |   3280896 |   3562  |    0    |                                       |
|        bootloader-dtb |  7955909 |    368704 |   3562  |    0    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|             secure-os |  8324613 |   1137424 |   3562  |    0    |                                       |
|                   eks |  9462037 |      5136 |   3562  |    0    |                                       |
|               bpmp-fw |  9467173 |   1007392 |   3562  |    0    |                                       |
|           bpmp-fw-dtb | 10474565 |     42864 |   3562  |    0    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|                rce-fw | 10517429 |    529776 |   3562  |    0    |                                       |
|               adsp-fw | 11047205 |    396864 |   3562  |    0    |                                       |
|                   sc7 | 11444069 |     55264 |   3562  |    2    |                                       |
|               xusb-fw | 11499333 |    129024 |   3562  |    0    |                                       |
|         secondary_gpt | 11628357 |     16896 |   3562  |    0    | 3668-100-0001--1-2-zc0805-0000+p3668- |
|  secondary_gpt_backup | 11645253 |     16896 |   3562  |    0    | 3668-100-0001--1-2-zc0805-0000+p3668- |

On the System we run:

cd /sys/firmware/efi/efivars/
printf "\x07\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00" > /tmp/var_tmp.bin
dd if=/tmp/var_tmp.bin of=OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c bs=12;sync

Mount the esp partition of the nvme to /mnt/esp/
Copy our capsule:

cp /bup/bootloader.capsule /mnt/esp/EFI/TEGRA_BL.Cap

Reboot afterwards.
Serial Log does not show any indication that the update was attempted:

bootloader_update.log (112.6 KB)

The slots info shows it was not attempted:

nvbootctrl dump-slots-info
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

The EFI variable OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c does not exist before running the commands, there is only OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c

Hi,

Little confused by your first step here.

  1. Generate Payload and update Capsule:
FAB=$BOARDFAB BOARDSKU=$BOARDSKU BOARDID=$BOARDID FUSELEVEL=$FUSELEVEL ./build_l4t_bup.sh ${BOARDNAME%-nvme} mmcblk0p1
${ToT_BSP}/bootloader/BUP_generator.py -c ${ToT_BSP}/bootloader/payloads_t19x/bl_only_payload
./generate_capsule/l4t_generate_soc_capsule.sh -i ${ToT_BSP}/bootloader/payloads_t19x/bl_only_payload -o ${ROOT_DIR}/bup/bootloader.capsule $SOC

So are you trying to use single spec or multi-spec here?

Also, BUP_generator is not needed here.

Hey, good that it is not required, tried before without the BUP_generator, no difference.
It should be single spec. Using the command according to the dev guide:

Generating a Single-Spec BUP

    To create a BUP image that will be stored in a file for a carrier board that is not connected to the host system:

$ cd ${ToT_BSP}
$ sudo FAB=100 BOARDID=3668 FUSELEVEL=fuselevel_production BOARDSKU=0001 ./build_l4t_bup.sh jetson-xavier-nx-devkit-emmc mmcblk0p1

The variables are filled by the build process.
Board ID(3668) version(100) sku(0001) revision()

build_l4t_bup.sh output was missing:

PARTITION INFO : multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/BCT/br_bct_BR.bct.prod BCT 3562 2 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/BCT_A/br_bct_BR.bct.prod BCT_A 3562 2 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/BCT_B/br_bct_b_BR.bct.prod BCT_B 3562 2 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/BCT-boot-chain_backup/bct_backup.img.prod BCT-boot-chain_backup 3562 2 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/mb1/mb1_t194_prod_aligned_sigheader.bin.encrypt mb1 3562 2 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/mb1_b/mb1_b_t194_prod_aligned_sigheader.bin.encrypt mb1_b 3562 2 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/MB1_BCT/mb1_cold_boot_bct_MB1_sigheader.bct.encrypt MB1_BCT 3562 0 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/MEM_BCT/mem_coldboot_sigheader.bct.encrypt MEM_BCT 3562 0 3668-100-0001–1-2-zc0805-0000+p3668-; signed/spe_t194_sigheader.bin.encrypt spe-fw 3562 0 common; signed/nvtboot_t194_sigheader.bin.encrypt mb2 3562 0 common; multi_signed/mts-preboot_fuselevel_production/preboot_c10_prod_cr_sigheader.bin.encrypt mts-preboot 3562 2 common; multi_signed/mts-mce_fuselevel_production/mce_c10_prod_cr_sigheader.bin.encrypt mts-mce 3562 2 common; multi_signed/mts-proper_fuselevel_production/mts_c10_prod_cr_sigheader.bin.encrypt mts-proper 3562 2 common; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/VER/qspi_bootblob_ver.txt VER 3562 0 3668-100-0001–1-2-zc0805-0000+p3668-; signed/nvdisp-init_sigheader.bin.encrypt cpu-bootloader 3562 0 common; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/bootloader-dtb/tegra194-p3668-0001-zc0805-0000_sigheader.dtb.encrypt bootloader-dtb 3562 0 3668-100-0001–1-2-zc0805-0000+p3668-; signed/tos-optee_t194_sigheader.img.encrypt secure-os 3562 0 common; signed/eks_t194_sigheader.img.encrypt eks 3562 0 common; signed/bpmp-2_t194_sigheader.bin.encrypt bpmp-fw 3562 0 common; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/bpmp-fw-dtb/tegra194-a02-bpmp-p3668-a00_lz4_sigheader.dtb.encrypt bpmp-fw-dtb 3562 0 3668-100-0001–1-2-zc0805-0000+p3668-; signed/camera-rtcpu-t194-rce_sigheader.img.encrypt rce-fw 3562 0 common;signed/adsp-fw_sigheader.bin.encrypt adsp-fw 3562 0 common; multi_signed/sc7_fuselevel_production/warmboot_t194_prod_sigheader.bin.encrypt sc7 3562 2 common; xusb_sil_rel_fw xusb-fw 3562 0 common; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/secondary_gpt/gpt_secondary_3_0.bin secondary_gpt 3562 0 3668-100-0001–1-2-zc0805-0000+p3668-; multi_signed/3668-100-0001–1-2-zc0805-0000+p3668-/secondary_gpt_backup/gpt_secondary_3_0.bin secondary_gpt_backup 3562 0 3668-100-0001–1-2-zc0805-0000+p3668- SUCCESS: bl_only_payload created

Could you just attach the result in a text file instead of using forum?

The format you posted is actually not easy to read.

It has no newlines, removed the code enclosure, now you can read it

Independent of the file. Should I see any logs in the serial log after i set the OSIndications EFI Variable? I am a bit confused that I don’t see anything about an update being attempted or failing.

There should be a progress bar to indicate the capsule update status in your next reboot.

We will try with NV devkit locally first.

Okay, thank you very much!

Hi,

In the meantime, please also enable UEFI debug log by rebuild the UEFI binary.

would like to check the UEFI log.

No time today, but I’ll do it tomorrow. Might need some time as I don’t have that prepared. I just remember the build process had some issues when I tried it last year.

If you get any result in the meantime, let me know!

@WayneWWW

I assume I need the UEFI branch r35.6.2-updates?
Where do I enable the uefi debug logs? Could not find an explanation in the wiki.
Simply use the uefi_Jetson_DEBUG.bin?

correct. Replacing the old uefi binary in your Linux_for_Tegra/bootloader with that DEBUG.bin.

The release.bin won’t have any log print as default one. Only the debug version will enable verbose log.

Okay I think the issue is related to this?

CodLibGetAllCapsuleOnDisk fail to open RootDir!
GetAllCapsuleOnDisk Status - 0x2
HandleCapsules: CoDRelocateCapsule failed: Not Found
HandleCapsules: capsule update complete, resetting ...

Full Log:

bootloader_update_debug.log (221.1 KB)

I just realized that it seems you didn’t make your BUP file into a capsule with script l4t_generate_soc_capsule.sh?

So you actually copied a old BUP format into ESP.

I think I did?

./generate_capsule/l4t_generate_soc_capsule.sh -i ${ToT_BSP}/bootloader/payloads_t19x/bl_only_payload -o ${ROOT_DIR}/bup/bootloader.capsule $SOC

The capsule is like 3KB bigger than the payload itself

Sorry. Not sure why the search did’t show me that.

Could you elaborate your steps to mount the esp partition from NVMe?

We did same thing on XNX (but with emmc) today and didn’t hit this.

Used blkid to see that p12 is my esp partition:

/dev/nvme0n1p12: UUID="5466-D060" TYPE="vfat" PARTLABEL="esp" PARTUUID="0c422ef3-fef5-4ef7-a319-c37b29c5c008"

Made a directory in /mnt/esp and mounted:

mount /dev/nvme0n1p12 /mnt/esp

And there is is:

tree /mnt/esp/
/mnt/esp/
????????? EFI
    ????????? BOOT
        ????????? BOOTAA64.efi

2 directories, 1 file

Copied the file there:

$ cp /bup/bootloader.capsule /mnt/esp/EFI/TEGRA_BL.Cap
$ tree /mnt/esp/
/mnt/esp/
????????? EFI
    ????????? BOOT
    ??????? ????????? BOOTAA64.efi
    ????????? TEGRA_BL.Cap

2 directories, 2 files

Folder seems wrong…need to try again!

Copy the generated multi-spec Capsule payload to the EFI/UpdateCapsule directory in the esp partition of the active boot media.

@WayneWWW My bad, seems I followed a wrong guide when I tested it. I was sure I had to copy it directly into the EFI folder. Now I see the update progress bar.

1 Like

@WayneWWW
Is there a way to check which bootloader/dtb is installed except from /sys/firmware/efi/esrt/entries/entry0/fw_version?
That will always be 35.6.2, but only the device tree changed , so the version is actually the same. Is there a build date or so readable anywhere?

Second question:
After updating the bootloader, my system has switched the OS slot too, is that intended?