Over the Air Update from L4T 32.X to L4T 35.3.1

I’m trying to update a Jetson Xavier AGX devkit using the image-based over the air update mechanism as described in the online Linux for Tegra documentation.

The AGX is flashed with L4T 32.6.1, and I wish to update it to the latest release L4T 35.3.1.

I have successfully generated the ota payload by following the steps in the documentation, however when running the nv_ota_start script on the Jetson, I am met with this error:

Command: ./nv_ota_start.sh /ota/ota_payload_package.tar.gz                 cd ../                                                         r
Current rootfs is on /dev/nvme0n1
init_ota_log /ota_log/ota/Linux_for_Tegra/tools/ota_tools$ cd version_upgrade/tools/ota_tools/
Create log file at /ota_log/ota_20230704-131753.log_tools/version_upgrade$ cd ver
OTA_LOG_FILE=/ota_log/ota_20230704-131753.log
Extract /ota/ota_payload_package.tar.gz
update_nv_boot_control_in_rootfs /ota_work
2888-400-0001-E.0-1-2-jetson-agx-xavier-devkit-
check_prerequisites
decompress_ota_package ota_package.tar /ota_work
decompress_ota_package: start at Tue Jul  4 13:18:27 UTC 2023
Sha1 checksum for /ota_work/ota_package.tar (b2c5266465f2e2f7a8e537d210e6dcf8076590cf) matches
decompress_ota_package: end at Tue Jul  4 13:18:47 UTC 2023
nv_ota_update_with_layout_change.sh /dev/nvme0n1
Command: nv_ota_update_with_layout_change.sh /dev/nvme0n1
duplicate_bct_copy
cat: /sys/class/mtd/mtd0/erasesize: No such file or directory
mtd_debug: error!: open()
Failed to read bct from /dev/mtd0
Failed to run "dupclicate_bct_copy"

It seems the ota scripts are trying to read some information from /dev/mtd0, which is not present on my L4T 32.6.1 Jetson AGX Xavier, with no modifications to the rootfs.

Am I missing something?

Hi,

do you have mtd-utils installed on your device?

Yes, dpkg lists the package as being installed;

nvidia@tegra-ubuntu:~$ cat /etc/nv_tegra_release 
# R32 (release), REVISION: 6.1, GCID: 27863751, BOARD: t186ref, EABI: aarch64, DATE: Mon Jul 26 19:36:31 UTC 2021

nvidia@tegra-ubuntu:~$ sudo dpkg --list | grep mtd-utils
ii  mtd-utils                                     1:2.0.1-1ubuntu3                           arm64        Memory Technology Device Utilities

Hi,

what are the complete commands you used to create the OTA package?
Maybe you made something wrong like selecting the wrong target boards.

/dev/mtd0 will only be present on devices with QSPI memory (Nano, NX…), so it’s expected that you won’t see it on AGX Xavier.

After setting up the environment variables, I generate the recovery image and dtb, and the ota image using the following commands;

sudo ./tools/ota_tools/version_upgrade/build_base_recovery_image.sh jetson-agx-xavier-devkit R32-6 ${BASE_BSP} ${BASE_BSP}/rootfs ${TARGET_BSP}

sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh jetson-agx-xavier-devkit R32-6

I don’t believe it has to do with the OTA payload generation, as the issue is with a script that is part of the OTA tools. I traced the error back to these lines within nv_ota_update_with_layout_change.sh

# Create the redundant copy of BCT in case it is not in place
if [ "${OTA_DEVICE}" != "${SDMMC_USER_DEVICE}" ]; then
        ota_log "duplicate_bct_copy"
        if ! duplicate_bct_copy; then
                ota_log "Failed to run \"dupclicate_bct_copy\""
                exit 1
        fi  
fi

Which then calls this function from nv_ota_common.func

duplicate_bct_copy()
{
	# Duplicate the BCT image from the first erasable block
	# to the second erasable block.
	# Usage:
	#    duplicate_bct_copy
	local erase_size=
	local mtd_dev="${_MTD_DEVICE}"
	local bct_tmp="/tmp/bct.bin.tmp"
	erase_size="$(cat /sys/class/mtd/mtd0/erasesize)"
	if ! mtd_debug read "${mtd_dev}" 0 "${erase_size}" "${bct_tmp}"; then
		ota_log "Failed to read bct from ${mtd_dev}"
		return 1
	fi
        .
        .
        .

and

_MTD_DEVICE="/dev/mtd0"

Seems this function will always be called if the current rootfs is not on the internal eMMC, as is in my scenario.

Hi,

sounds like it may be a bug.
We’ll see if we can re-produce this issue on our side.

Hi,

I just checked the document and script, and found this:

<external_device> specifies the external device to be upgraded, and nvme0n1 is the supported device. This option is only valid when <target_board> is set to jetson-xavier-nx-devkit-emmc.

So looks like you won’t be able to do OTA with an NVMe drive on AGX Xavier.

2 Likes

Thanks for the confirmation @DaveYYY

For anyone encountering this, I got around this issue by adding a script to rsync the contents of the APP partition on the eMMC to the NVMe drive, after the OTA process has been completed, and modify extlinux.conf to set nvme0n1p1 as my root device.

This involved the addition of the script, adding the script to the OTA_TASKS variable in nv_ota_customer.conf, and adding in rsync and its required libraries in nv_ota_customer.conf

I am able to do this as in my scenario, the nvme contains only my rootfs.

1 Like

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