Interrupted OTA update can cause retries to fail

If an OTA updated is interrupted (e.g. power off) at a couple of key points then attempts to retry the same update (or updates containing the same alt image components) will always fail.

Log output:

Sha1 checksum for /tmp/recovery-dtb_alt_part.tmp (b13396fa7dbc17a6ced972c4fd08fc71b812dbba != 6a521e1d2a632c26e53b83d2cc4b0edecfc1e68c) does not match
recovery-dtb_alt needs to be erased
Current update state: err.
Enter error update state, exiting update process...
Failed to run "update_specified_partitions_alt recovery-dtb /raymarine/Data/ota_work/external_device/images-R36-ToT/tegra234-p3768-0000+p3767-0000-nv-raymarine-bluefin-v2.dtb.rec /tmp/sha1sum.tmp "
Failed to run "install_partition_with_alt /raymarine/Data/ota_work/external_device/images-R36-ToT recovery-dtb"
Failed to run "update_misc_partitions /raymarine/Data/ota_work /raymarine/Data/ota_work/external_device/images-R36-ToT"

The root cause is an interruption in updating the alt partitions - after the partition names have been switched but before the old partition is erased.

This should be caught in state S3 in the function check_update_state in nv_ota_update_alt_part.func but instead drops through with current_state=err, as at this point the old partition still matches the new image and the condition for state S3 is not met

Attached is a patch file with the fix

ota_tools_R36.4.3.txt (959 Bytes)

Hi alexander.home,

What’s the Jetpack version in use to verify OTA update?

Please share the result of the following commands on your board.

$ cat /etc/nv_tegra_release
$ cat /etc/nv_boot_control.conf

What’s the exact command you used to flash the board?

Do you mean the patch you shared can help with the situation about “If an OTA updated is interrupted (e.g. power off) at a couple of key points”?

$ cat /etc/nv_tegra_release 
# R36 (release), REVISION: 4.3, GCID: 38968081, BOARD: generic, EABI: aarch64, DATE: Wed Jan  8 01:49:37 UTC 2025
$ cat /etc/nv_boot_control.conf
TNSPEC 3767-300-0000-P.1-1-0-<product name>
COMPATIBLE_SPEC 3767-000-0000--1--<product name>
TEGRA_BOOT_STORAGE nvme0n1
TEGRA_CHIPID 0x23
TEGRA_OTA_BOOT_DEVICE /dev/mtdblock0
TEGRA_OTA_GPT_DEVICE /dev/mtdblock0

The function check_update_state examines three conditional variables as booleans to determine the state of the existing and _alt partitions. This give eight possible combinations. In seven of the eight combinations a resulting state is set { S1, S2, S3, S4 }. In the eighth combination (is_part_new=true, is_part_alt_erased=false, is_part_alt_new=true) an error condition is set despite the state being recoverable. The patch allows recovery in all cases.

Please also share the command you used to flash the board before.

Thanks for sharing the patch, it has been merged into our codeline, will be included at the next JetPack 6 release. Thanks

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