Nv_update_engine dose not update kernel-dtb partition

environment: xavier, JetPack:4.2.1 L4T:32.2

i got the file ‘bl_update_payload’ from x86 host ‘Linux_for_Tegra’, command:

     $ sudo ./l4t_generate_soc_bup.sh t19x
     $ scp bootloader/payloads_t19x/bl_update_payload nvidia@xavier_ip_addr:/opt/ota_package/

on xavier, run the command:

     $ sudo nv_update_engine -i 2>&1 | tee nv_update_engine.log

kernel partition is updated, but kernel-dtb partition not update, how can i update the kernel-dtb with nv_update_engine?

and below is nv_update_engine.log
in the log: ENTRY_TABLE shows kernel-dtb is not UPDATABLE, that’s right? how can i change it to UPDATABLE?

Nvidia A/B-Redundancy Update tool Version 1.2
current slot 0
Start updating slot 1
Tegra User Block Device: /dev/disk/by-partlabel
Tegra Boot Block Device: /dev/mmcblk0boot0
HEADER: MAGIC NVIDIA__BLOB__V2
HEX_VALUE 131072
BLOB_SIZE 47626920
HEADER_SIZE 48
NUMBER_OF_ELEMENTS 18
HEADER_TYPE 0
UNCOMP_SIZE 47626920
MB1_RATCHET_LV 0
MTS_RATCHET_LV 0
ROLLBACK_FUSE_LV 0
Device TN Spec: 2888-400-0001-J.0-1-2-jetson-xavier-mmcblk0p1
Device is fused board.
ENTRY_TABLE:
PART POS LEN VER TNSPEC TYPE UPDATABLE
spe-fw 2208 94960 2 0 1
mb2 97168 170048 2 0 1
cpu-bootloader 267216 420336 2 1 1
secure-os 687552 324608 2 1 1
bpmp-fw 1012160 853856 2 1 1
rce-fw 1866016 273168 2 1 1
mb1 2139184 250144 2 2 1
mts-preboot 2389328 23968 2 0 1
mts-mce 2413296 144144 2 1 1
mts-proper 2557440 3372048 2 1 1
sc7 5929488 65696 2 1 1
bpmp-fw-dtb 5995184 609952 2 2888-400-0001-C.0-1-2-jetson-xavier-mmcblk0p1
1 0
bootloader-dtb 6605136 219888 2 2888-400-0001-C.0-1-2-jetson-xavier-mmcblk0p
1 1 0
BCT 6825024 2888 2 2888-400-0001-C.0-1-2-jetson-xavier-mmcblk0p1 2 0
MB1_BCT 6827912 30768 2 2888-400-0001-C.0-1-2-jetson-xavier-mmcblk0p1 0 0
MEM_BCT 6858680 198656 2 2888-400-0001-C.0-1-2-jetson-xavier-mmcblk0p1 0 0
kernel 7057336 40349696 2 1 1
kernel-dtb 47407032 219888 2 2888-400-0001-C.0-1-2-jetson-xavier-mmcblk0p1 1 0
Saving Entry table to /opt/ota_package/entry_table
spe-fw write: slot = 1 offset = 1261568 bytes = 94960
mb2 write: slot = 1 offset = 1654784 bytes = 170048
Writing 420336 bytes to /dev/disk/by-partlabel/cpu-bootloader_b for cpu-bootload
er
Writing 324608 bytes to /dev/disk/by-partlabel/secure-os_b for secure-os
Writing 853856 bytes to /dev/disk/by-partlabel/bpmp-fw_b for bpmp-fw
Writing 273168 bytes to /dev/disk/by-partlabel/rce-fw_b for rce-fw
mts-preboot write: slot = 1 offset = 2179072 bytes = 23968
Writing 144144 bytes to /dev/disk/by-partlabel/mts-mce_b for mts-mce
Writing 3372048 bytes to /dev/disk/by-partlabel/mts-proper_b for mts-proper
Writing 65696 bytes to /dev/disk/by-partlabel/sc7_b for sc7
Writing 40349696 bytes to /dev/disk/by-partlabel/kernel_b for kernel
GetEntryTable failed for BCT
Skipping partition: BCT
GetEntryTable failed for BCT
Skipping partition: BCT
Update successful
Setting slot 1 as active boot slot
Rebooting system…10.9.8.7.6.5.4.3.2.1

hello liu.jialu,

may I know more details about your usage of nv_update_engine?
according to Jetson AGX Xavier/TX2 Update and Redundancy, A/B redundancy is a feature for safety update in case the current slot is corrupted.

we’ll also check internally for the nv_update_engine functionality,
thanks

Hi liu.jialu,

Please use below command to generate the BUP:

$ sudo ./build_l4t_bup.sh jetson-xavier mmcblk0p1

Copy the BUP from the host system to this newly created BUP directory with the command:
$ scp <host_loc:bl_update_payload> /opt/ota_package/

I plan to use nv_update_engine for A/B update, just only with network connection, but without USB connection between host and xavier.
the main purpose is to update kernel and kernel-dtb.

hello liu.jialu,

please note that you should update kernel and kernel-dtb with sign and encrypt binaries, there’s zero encrypt if no key assign.
you may generate these binaries locally with flash script,
for example,

$ sudo ./flash.sh --no-flash -k kernel jetson-xavier mmcblk0p1
[ 1.6144 ] Signed file: $OUT/full_linux_for_tegra/Linux_for_Tegra/bootloader/boot_sigheader.img.encrypt

and…

$ sudo ./flash.sh --no-flash -k kernel-dtb jetson-xavier mmcblk0p1
[ 0.0284 ] Signed file: $OUT/full_linux_for_tegra/Linux_for_Tegra/bootloader/tegra194-p2888-0001-p2822-0000_sigheader.dtb.encrypt

after that,
you might be able to copy those singed and encrypted binaries to the device.
for example,

$ ls -la /dev/disk/by-partlabel/
kernel -> .mmcblk0p34

using dd commands to overwrite the corresponding partition.

$ sudo dd if=/tmp/boot_sigheader.img.encrypt of=/dev/mmcblk0p34

you’ll also need to perform warm-reboot to let change takes effect.

$ sudo reboot

BTW,
you may also refer to Topic 122019 for loading DTB instead of flashing to eMMC.
thanks

1 Like

according to your answer, i got the same result, kernel-dtb still not be updated.

i tried to get BUP from my xavier with fresh image, and connect xavier in recovery mode with USB wire.

$ sudo ./build_l4t_bup.sh jetson-xavier mmcblk0p1
it works, and i got new bl_update_payload.

run nv_update_engine in my another xavier with old version image, got the same nv_update_engine.log, like below shows:>

Nvidia A/B-Redundancy Update tool Version 1.2
current slot 0
Start updating slot 1
Tegra User Block Device: /dev/disk/by-partlabel
Tegra Boot Block Device: /dev/mmcblk0boot0
HEADER: MAGIC NVIDIA__BLOB__V2
HEX_VALUE 131072
BLOB_SIZE 47626920
HEADER_SIZE 48
NUMBER_OF_ELEMENTS 18
HEADER_TYPE 0
UNCOMP_SIZE 47626920
MB1_RATCHET_LV 0
MTS_RATCHET_LV 0
ROLLBACK_FUSE_LV 0
Device TN Spec: 2888-400-0001-J.0-1-2-jetson-xavier-mmcblk0p1
Device is fused board.
ENTRY_TABLE:
PART POS LEN VER TNSPEC TYPE UPDATABLE
spe-fw 2208 94960 2 0 1
mb2 97168 170048 2 0 1
cpu-bootloader 267216 420336 2 1 1
secure-os 687552 324608 2 1 1
bpmp-fw 1012160 853856 2 1 1
rce-fw 1866016 273168 2 1 1
mb1 2139184 250144 2 2 1
mts-preboot 2389328 23968 2 0 1
mts-mce 2413296 144144 2 1 1
mts-proper 2557440 3372048 2 1 1
sc7 5929488 65696 2 1 1
bpmp-fw-dtb 5995184 609952 2 2888-400-0001-L.0-1-2-jetson-xavier-mmcblk0p1
1 0
bootloader-dtb 6605136 219888 2 2888-400-0001-L.0-1-2-jetson-xavier-mmcblk0p
1 1 0
BCT 6825024 2888 2 2888-400-0001-L.0-1-2-jetson-xavier-mmcblk0p1 2 0
MB1_BCT 6827912 30768 2 2888-400-0001-L.0-1-2-jetson-xavier-mmcblk0p1 0 0
MEM_BCT 6858680 198656 2 2888-400-0001-L.0-1-2-jetson-xavier-mmcblk0p1 0 0
kernel 7057336 40349696 2 1 1
kernel-dtb 47407032 219888 2 2888-400-0001-L.0-1-2-jetson-xavier-mmcblk0p1 1 0
Saving Entry table to /opt/ota_package/entry_table
spe-fw write: slot = 1 offset = 1261568 bytes = 94960
mb2 write: slot = 1 offset = 1654784 bytes = 170048
Writing 420336 bytes to /dev/disk/by-partlabel/cpu-bootloader_b for cpu-bootload
er
Writing 324608 bytes to /dev/disk/by-partlabel/secure-os_b for secure-os
Writing 853856 bytes to /dev/disk/by-partlabel/bpmp-fw_b for bpmp-fw
Writing 273168 bytes to /dev/disk/by-partlabel/rce-fw_b for rce-fw
mts-preboot write: slot = 1 offset = 2179072 bytes = 23968
Writing 144144 bytes to /dev/disk/by-partlabel/mts-mce_b for mts-mce
Writing 3372048 bytes to /dev/disk/by-partlabel/mts-proper_b for mts-proper
Writing 65696 bytes to /dev/disk/by-partlabel/sc7_b for sc7
Writing 40349696 bytes to /dev/disk/by-partlabel/kernel_b for kernel
GetEntryTable failed for BCT
Skipping partition: BCT
GetEntryTable failed for BCT
Skipping partition: BCT
Update successful
Setting slot 1 as active boot slot
Rebooting system…10.9.8.7.6.5.4.3.2.1

thanks for reply.
dd works well for kernel and kernel-dtb partition.
and please help to have a check about nv_update_payload update kernel-dtb, because A/B update is better, thanks.

hi,

we had confirmed locally that nv_update_engine able to update dtb files.
may I know more details about “old version image”, would you like to update kernel-dtb with different l4t release version?
thanks

i’m sorry for my fault word, old version image means old image, nothing about version, they are the same version, just only changed the device tree configuration.

but in the nv_update_engine.log, did not display writing data to /dev/disk/by-partlable/kernel-dtb_b
can i have your nv_update_engine.log?

written partitions, list below:

Writing 420336 bytes to /dev/disk/by-partlabel/cpu-bootloader_b for cpu-bootloader
Writing 324608 bytes to /dev/disk/by-partlabel/secure-os_b for secure-os
Writing 853856 bytes to /dev/disk/by-partlabel/bpmp-fw_b for bpmp-fw
Writing 273168 bytes to /dev/disk/by-partlabel/rce-fw_b for rce-fw
mts-preboot write: slot = 1 offset = 2179072 bytes = 23968
Writing 144144 bytes to /dev/disk/by-partlabel/mts-mce_b for mts-mce
Writing 3372048 bytes to /dev/disk/by-partlabel/mts-proper_b for mts-proper
Writing 65696 bytes to /dev/disk/by-partlabel/sc7_b for sc7
Writing 40349696 bytes to /dev/disk/by-partlabel/kernel_b for kernel

hello liu.jialu,

please refer to below steps to update kernel-dtb with nv_update_engine, you’ll need to generate a payload.
for example,

steps:

  1. Change the dtb file from /kernel/dtb
  2. Run $ sudo FAB=400 BOARDID=2888 ./build_l4t_bup.sh jetson-xavier mmcblk0p1 to generate bl_update_payload
  3. scp bl_update_payload to /opt/ota_package
  4. Update engine: sudo nv_update_engine --install

we’re able to update dtb file from /kernel/dtb successfully.
thanks

$ sudo nv_update_engine --install
Nvidia A/B-Redundancy Update tool Version 1.2

PART POS LEN VER TNSPEC TYPE UPDATABLE
kernel-dtb 47201090 279920 2 2888-400—1-2-jetson-xavier-mmcblk0p1 1 1

thanks, i will try it in another L4T version.
but in my working version: Jetpack 4.2.1 L4T 32.2, it didn’t update the kernel-dtb partition.
i used the command ‘dd’ to update it extra like this:

$ sudo dd if=/tmp/tegra194-p2888-0001-p2822-0000_sigheader.dtb.encrypt of= /dev/disk/by-partlabel/kernel-dtb_b

and it works, dtb was updated, check it like this:

$ cat /proc/device-tree/nvidia,dtbbuildtime

FYI,
we had verification the steps to update kernel-dtb with nv_update_engine in comment #11 based-on l4t-r32.4.2

suggest you to have code integration to the latest l4t release,
or, you may using dd commands as your temporary solution.
thanks

Hi jialu

I encountered a problem when using AGX-xavier. After building the kernel,I used the following command to flash and found that the kernel could not be updated.
sudo ./flash.sh -r -k kernel jetson-xavier mmcblk0p1

In the kernel source code, I only modified “CONFIG_VIDEO_OV5693 = y” in the tegra_defconfig file.

The following methods were tried, but the results were the same. The kernel still cannot be updated.
sudo ./flash.sh -r -K kernel/Image jetson-xavier mmcblk0p1
Replace /boot/Image
Replace bl_update_payload
sudo dd if=/tmp/boot_sigheader.img.encrypt of=/dev/mmcblk0p34
sudo nv_update_engine -i

I have been troubled by this problem for a long time, How did you update the kernel?
Could you share the complete flashing steps and precautions?

Thanks.

have you update the kernel image in L4T?
cp tmp/arch/arm64/boot/Image Linux_for_Tegra/kernel/