Update kernel_only_payload using Capsule update in R35.3.1

Hi,
I am using Orin develop kit with R35.3.1.
I have created a bl_only_payload and kernel_only_payload file by following the instructions in documents:
https://docs.nvidia.com/jetson/archives/r35.3.1/DeveloperGuide/text/SD/Bootloader/UpdateAndRedundancy.html#generating-a-single-spec-bup

  • To create a BUP image for a board that is connected to the host system:
  1. Place the target board into [Force Recovery Mode]
  2. Run the following commands:

$ cd ${ToT_BSP}
$ sudo ./build_l4t_bup.sh “device” mmcblk0p1
Where “device” is:

  • For Jetson AGX Orin: jetson-agx-orin-devkit
  • For Jetson Xavier NX series: jetson-xavier-nx-devkit-emmc
  • For Jetson AGX Xavier series: jetson-agx-xavier-devkit

Then I generated a bootloader Capsule Payload (named TEGRA_BL.Cap) by following:

$ cd ${ToT_BSP}
$ ./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t23x/bl_only_payload -o ./TEGRA_BL.Cap t234

I also build another capsule by changing input file with kernel_only_payload (named TEGRA_KL.Cap).

./generate_capsule/l4t_generate_soc_capsule.sh -i bootloader/payloads_t23x/kernel_only_payload -o ./TEGRA_KL.Cap t234

Then I followed instructions below to trigger capsule update.
Update and Redundancy — Jetson Linux Developer Guide documentation

Here’s the issue:

I can see update process in terminal while using TEGRA_BL.Cap.

nvbootctrl dump-slots-info also showed Capsule update successfully.

But TEGRA_KL.Cap seems not working: no update process and nvbootctrl show No Capsule update.

  • Is there any additional instructions to trigger capsule update build from kernel_only_payload?
  • What is the definition of the bit indicate by this in OsIndications UEFI variable:

printf “\x07\x00\x00\x00\ x04 \x00\x00\x00\x00\x00\x00\x00” > /tmp/var_tmp.bin

Hi ts01399984,

Are you trying to create a capsule payload of R35.3.1 and upgrade this package on the same board?

Can the update progress work w/o this change?

Is it showed on your serial console log?
Could you help to provide the serial console log from the board?

Hi Kevin,
Thanks for reply.

Are you trying to create a capsule payload of R35.3.1 and upgrade this package on the same board?

Yes

Can the update progress work w/o this change?

No, I copy this package to the EFI/UpdateCapsule directory in the esp partition.
And set the bit2 of the OsIndications UEFI variable.

Normally, it will show a progress bar on logs like this (Which I use TEGRA_BL.Cap):

sudo rebotot
[ 2604.397687] watchdog: watchdog0: watchdog did not stop!
[ 2604.922285] Trying to unregister non-registered hwtime source
[ 2605.161418] arm-smmu 8000000.iommu: disabling translation
[ 2605.167407] arm-smmu 10000000.iommu: disabling translation
[ 2605.173159] arm-smmu 12000000.iommu: disabling translation
[ 2605.179675] reboot: Restarting system
Jetson UEFI firmware (version 3.1-32827747 built on 2023-03-19T14:56:32+00:00)
Jetson UEFI firmware (version 3.1-32827747 built on 2023-03-19T14:56:32+00:00)
ESC to enter Setup.
F11 to enter Boot Manager Menu.
Enter to continue boot.
Update Progress - 5% **++++++++++++++++++++++++++++++++++++++++++++++++Update Progress - 6% ***+++++++++++++++++++++++++++++++++++++++++++++++Update Progress - 7% ***+++++++++++++++++++++++++++++++++++++++++++++++Update Progress - 8% ****++++++++++++++++++++++++++++++++++++++++++++++Update Progress - 9% ****++++++++++++++++++++++++++++++++++++++++++++++Update Progress - 10% *****+++++++++++++++++++++++++++++++++++++++++++++Update Progress - 11% *****+++++++++++++++++++++++++++++++++++++++++++++Update Progress - 12% ******++++++++++++++++++++++++++++++++++++++++++++Update Progress - 13% ******++++++++++++++++++++++++++++++++++++++++++++Update Progress - 14% *******+++++++++++++++++++++++++++++++++++++++++++Update Progress - 15% *******+++++++++++++++++++++++++++++++++++++++++++Update Progress - 65% ********************************++++++++++++++++++Update Progress - 66% *********************************+++++++++++++++++Update Progress - 67% *********************************+++++++++++++++++Update Progress - 68% **********************************++++++++++++++++Update Progress - 69% **********************************++++++++++++++++Update Progress - 70% ***********************************+++++++++++++++Update Progress - 95% ***********************************************+++Update Progress - 100% **************************************************Jetson UEFI firmware (version 3.1-32827747 built on 2023-03-19T14:56:32+00:00)
Jetson UEFI firmware (version 3.1-32827747 built on 2023-03-19T14:56:32+00:00)
ESC to enter Setup.
F11 to enter Boot Manager Menu.
Enter to continue boot.
** WARNING: Test Key is used. **
…L4TLauncher: Attempting Direct Boot
EFI stub: Booting Linux Kernel…
EFI stub: Using DTB from configuration table
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Exiting boot services and installing virtual address map…
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd421]
[ 0.000000] Linux version 5.10.104-tegra (buildbrain@mobile-u64-6289-d7000) (aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2020.08) 9.3.0, GNU ld (GNU Binutils) 2.33.1) #1 SMP PREEMPT Sun Mar 19 07:55:28 PDT 2023
[ 0.000000] OF: fdt: memory scan node memory@80000000, reg size 16,

But when I use TEGRA_KL.Cap, it doesn’t show any progress bar, just a normal boot log.
After boot done, I use nvbootctl to check status.

Success:

nvidia@nvidia-ubuntu:~$ sudo nvbootctrl dump-slots-info
[sudo] password for nvidia:
Current version: 35.3.1
Capsule update status: 1
Current bootloader slot: B
Active bootloader slot: B
num_slots: 2
slot: 0, status: normal
slot: 1, status: normal

Fail:

nvidia@nvidia-ubuntu:~$ sudo nvbootctrl dump-slots-info
[sudo] password for nvidia:
Current version: 35.3.1
Capsule update status: 0
Current bootloader slot: B
Active bootloader slot: B
num_slots: 2
slot: 0, status: normal
slot: 1, status: normal

I noticed that Cap file in UpdateCapsule disappeared after fail update.
Normally it will still in the folder if the update process is not executed,
so I think it do have executed update process, but something went wrong.

Here’s full log:
Good.txt (123.2 KB)
Bad.log (122.0 KB)

Why you don’t just use bl_only_payload instead?
It seems work as expected in your case. (TEGRA_BL.Cap)

If you want to generate specified partition BUP, please try the following command.

$ cd ${ToT_BSP}
$ sudo ./build_l4t_bup.sh --single-image-bup kl jetson-agx-orin-devkit mmcblk0p1

Hi Kevin,

Why you don’t just use bl_only_payload instead?

Because when I check l4t_bup_gen.func it seems that kernel & kernel_dtb partition is not included in bl_only_payload, so I need to update both capsule to achieve a complete update.

t23x_bl_table=(
#PART_NAME IMAGE_SIGNED BOARD_SPECIFIC OP_MODE_SPECIFIC SKIP
‘BCT 1 1 1 0’
‘BCT_A 1 1 1 0’
‘BCT_B 1 1 1 0’
‘BCT-boot-chain_backup 1 1 1 0’
‘A_mb1 1 1 1 0’
‘A_psc_bl1 1 0 1 0’
‘A_MB1_BCT 1 1 0 0’
‘A_MEM_BCT 1 1 0 0’
‘A_tsec-fw 1 0 0 0’
‘A_nvdec 1 0 1 0’
‘A_mb2 1 1 0 0’
‘A_bpmp-fw 1 1 1 0’
‘A_bpmp-fw-dtb 1 1 0 0’
‘A_psc-fw 1 0 1 0’
‘A_mts-mce 1 0 1 0’
‘A_sc7 1 0 1 0’
‘A_pscrf 1 0 1 0’
‘A_mb2rf 1 0 0 0’
‘A_cpu-bootloader 1 1 0 0’
‘A_secure-os 1 0 0 0’
‘A_smm-fw 1 0 0 1’
‘A_eks 1 0 0 0’
‘A_dce-fw 1 1 0 0’
‘A_spe-fw 1 0 0 0’
‘A_rce-fw 1 0 0 0’
‘A_adsp-fw 1 0 0 0’
‘uefi_variables 1 0 0 1’
‘uefi_ftw 1 0 0 1’
‘mb2-applet 0 0 0 0’
‘A_VER 0 1 0 0’
‘esp 1 0 0 1’
‘A_xusb-fw 1 0 1 0’
‘secondary_gpt 1 1 0 0’
‘secondary_gpt_backup 1 1 0 0’
)
t23x_kernel_table=(
#PART_NAME IMAGE_SIGNED BOARD_SPECIFIC OP_MODE_SPECIFIC SKIP
‘A_kernel 0 0 0 0’
‘A_kernel-dtb 0 1 0 0’
)

Any methods that I can use TEGRA_KL.Cap? Since the note says that Capsule update status in the output of nvbootctrl command is not reliable after single partition image Capsule update is complete.

Here’s an update:

Generate specified partition can’t generate kernel and kernel-dtb partition since it is not defined when using --single-image-bup.

In l4t_bup_gen.func:

t23x_table=(
#type #payload table
‘bl t23x_bl_table’
‘kernel t23x_kernel_table’
)
t23x_single_bl_table=(
#type #payload table
‘bl t23x_bl_table’
)

When using --single-image-bup, it will reference t23x_single_bl_table, t23x_kernel_table is not in it.

So, the only question is: How to update capsule built from kernel_only_payload?

The kernel_only_payload is used to update images in the kernel and kernel-dtb partitions. But the capsule only supports updating bootloader components, not kernel images.

To use kernel_only_payload, you can run the following commands to update individual partitions:

/usr/sbin/nv_bootloader_payload_updater kernel_only_payload --part A_kernel | A_kernel-dtb | B_kernel | B_ kernel-dtb

Hi Kevin,

I’ve tried these commands for all 4 partitions and I got logs below (A_kernel & A_kernel-dtb for example):

Start running: /opt/nvidia/l4t-bootloader-config/nv-l4t-bootloader-config.sh -c
3701-300-0000–1–jetson-agx-orin-devkit-
Got individual part name: A_kernel
Got update payload: ./kernel_only_payload
Tegra User Block Device: /dev/disk/by-partlabel
Tegra Boot Block Device: /dev/mtdblock0
Tegra GPT Block Device: /dev/mtdblock0
Skip querying the boot device parameters
HEADER: MAGIC NVIDIA__BLOB__V3
HEX_VALUE 16975394
BLOB_SIZE 43375531
HEADER_SIZE 48
NUMBER_OF_ELEMENTS 2
HEADER_TYPE 0
UNCOMP_SIZE 43375531
MB1_RATCHET_LV 0
MTS_RATCHET_LV 0
ROLLBACK_FUSE_LV 0
Device TN Spec: 3701-500-0000-H.0-1-1-jetson-agx-orin-devkit-
Device Compatible Spec: 3701-300-0000–1–jetson-agx-orin-devkit-
Device TN Spec: 3701-500-0000-H.0-1-1-jetson-agx-orin-devkit-
Device Compatible Spec: 3701-300-0000–1–jetson-agx-orin-devkit-
Device is fused board.
ENTRY_TABLE:
PART POS LEN VER TNSPEC TYPE UPDATABLE
A_kernel 416 42952704 13617 1 1
A_kernel-dtb 42953120 422411 13617 3701-300-0000–1-0-jetson-agx-orin-devkit- 1 1
Writing 42952704 bytes to /dev/disk/by-partlabel/A_kernel for A_kernel
Write successfully to individual partition A_kernel

Start running: /opt/nvidia/l4t-bootloader-config/nv-l4t-bootloader-config.sh -c
3701-300-0000–1–jetson-agx-orin-devkit-
Got individual part name: A_kernel-dtb
Got update payload: ./kernel_only_payload
Tegra User Block Device: /dev/disk/by-partlabel
Tegra Boot Block Device: /dev/mtdblock0
Tegra GPT Block Device: /dev/mtdblock0
Skip querying the boot device parameters
HEADER: MAGIC NVIDIA__BLOB__V3
HEX_VALUE 16975394
BLOB_SIZE 43375531
HEADER_SIZE 48
NUMBER_OF_ELEMENTS 2
HEADER_TYPE 0
UNCOMP_SIZE 43375531
MB1_RATCHET_LV 0
MTS_RATCHET_LV 0
ROLLBACK_FUSE_LV 0
Device TN Spec: 3701-500-0000-H.0-1-1-jetson-agx-orin-devkit-
Device Compatible Spec: 3701-300-0000–1–jetson-agx-orin-devkit-
Device TN Spec: 3701-500-0000-H.0-1-1-jetson-agx-orin-devkit-
Device Compatible Spec: 3701-300-0000–1–jetson-agx-orin-devkit-
Device is fused board.
ENTRY_TABLE:
PART POS LEN VER TNSPEC TYPE UPDATABLE
A_kernel 416 42952704 13617 1 1
A_kernel-dtb 42953120 422411 13617 3701-300-0000–1-0-jetson-agx-orin-devkit- 1 1
Writing 422411 bytes to /dev/disk/by-partlabel/A_kernel-dtb for A_kernel-dtb
Write successfully to individual partition A_kernel-dtb

But the DTB build time in boot log did not changed.

[ 0.004144] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-5.10/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t23x/concord/kernel-dts/tegra234-p3701-0000-p3737-0000.dts
[ 0.004153] DTB Build time: Mar 19 2023 08:08:40

And I think the change I did to device tree did not applied.

But the DTS File Name and DTB Build Time will change if I use the flash cmd

[ 0.004166] DTB Build time: Apr 26 2023 19:53:03

Here’s the steps I build kernel_only_payload:

1 ) Build kernel using nvbuild.sh -o $TEGRA_KERNEL_OUT
2 ) Copy dtbo and dtb to Linux_for_Tegra/kernel/dtb/
3 ) Go to /Linux_for_Tegra, build BUP : sudo ./build_l4t_bup.sh jetson-agx-orin-devkit mmcblk0p1

Anything wrong with my steps? Is there any extra steps I need to do to apply the changes written to partitions?

Could you help to dissemble the DTB with dtc command to check if the content applied?

You could also refer to the following thread about image usage.
Kernel upgrade using OTA - #2
It seems the bootloader would read kernel from /boot/Image instead of from partition.

Hi Kevin,

I have dissembled DTB

dtc /boot/dtb/kernel_tegra234-p3701-0000-p3737-0000.dtb

Content in dtb file before and after I use nv_bootloader_payload_updater are the same.

The result is expected.
The kernel_only_payload is for the images in the partition, not the filesystem.

If you want to update for the data in rootfs, please use the Debian update instead.
Or just copy the related image and dtb files manually.

Hi kevin,

I think there’s something wrong while building payload file.

I redo whole process again an now I can use nv_bootloader_payload_updater to update my dtb partition.

Thanks for the help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.