Cannot flash Xavier tegrahost_v2 - Stat for TEGRABOOT failed

I am having trouble flashing the Xavier from a native Ubuntu 16.04 host. The confusing part is that this was actually working before, and I’m not sure what actually changed. Despite the failed flashing attempts, the previously installed system does still boot after resetting the device, so it’s bricked.

Below is the tail end of the output of ./flash.sh -t jetson-xavier mmcblk0p1

*** Flashing target device started. ***
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
 
[   0.0027 ] tegrasign_v2 --key None --getmode mode.txt
[   0.0043 ] Assuming zero filled SBK key
[   0.0061 ] 
[   0.0062 ] Generating RCM messages
[   0.0097 ] tegrahost_v2 --chip 0x19 0 --magicid MB1B --appendsigheader mb1_t194_prod.bin zerosbk
[   0.0199 ] Header already present for mb1_t194_prod.bin
[   0.0273 ] 
[   0.0357 ] tegrasign_v2 --key None --getmode mode.txt
[   0.0443 ] Assuming zero filled SBK key
[   0.0447 ] 
[   0.0476 ] tegrabct_v2 --chip 0x19 0 --sfuse tegra194-mb1-soft-fuses-l4t.cfg sfuse.bin
[   0.0562 ] 
[   0.0675 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x19 0 --sfuses sfuse.bin --download rcm mb1_t194_prod_sigheader.bin 0 0
[   0.0727 ] RCM 0 is saved as rcm_0.rcm
[   0.0778 ] RCM 1 is saved as rcm_1.rcm
[   0.0801 ] RCM 2 is saved as rcm_2.rcm
[   0.0847 ] List of rcm files are saved in rcm_list.xml
[   0.1138 ] 
[   0.1140 ] Signing RCM messages
[   0.1216 ] tegrasign_v2 --key None --list rcm_list.xml --pubkeyhash pub_key.key --getmontgomeryvalues montgomery.bin
[   0.1320 ] Assuming zero filled SBK key
[   0.1344 ] 
[   0.1346 ] Copying signature to RCM mesages
[   0.1382 ] tegrarcm_v2 --chip 0x19 0 --updatesig rcm_list_signed.xml
[   0.1431 ] 
[   0.1432 ] Parsing partition layout
[   0.1495 ] tegraparser_v2 --pt flash.xml.tmp
[   0.1607 ] 
[   0.1611 ] Creating list of images to be signed
[   0.1720 ] tegrahost_v2 --chip 0x19 0 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
[   0.1781 ] MB1: Nvheader already present
[   0.1804 ] MB1: Nvheader already present
[   0.1884 ] adding BCH for spe_t194.bin
[   0.1968 ] adding BCH for spe_t194.bin
[   0.2017 ] Stat for TEGRABOOT failed
[   0.2262 ] 
Error: Return value 4
Command tegrahost_v2 --chip 0x19 0 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
Failed flashing t186ref.

Here’s the serial console output:

��01.224] I> Welcome to Cboot
[0001.224] I> Cboot Version: 4e3f0bea4cf94837f65ddb512d987e4e8589e811.10.31.2018.43-t194-3d46�
[0001.225] I> CPU-BL Params @ 0xf2820000
[0001.226] I>  0) Base:0x00000000 Size:0x00000000
[0001.227] I>  1) Base:0xf2100000 Size:0x00100000
[0001.2��
[0329.153] I> MB1 (prd-version: 1.0.0.0-t194-41334769-a3872862)
[0329.159] I> Boot-mode: Platform RCM
[0329.162] I> chip revision : A02
[0329.165] I> Bootrom patch version : 7 (correctly patched)
[0329.170] I> ATE fuse revision : 0x200
[0329.173] I> Ram repair fuse : 0x0
[0329.177] I> Ram Code : 0x0
[0329.179] I> rst_source : 0x0
[0329.182] I> rst_level : 0x0
[0329.186] I> USB configuration success
[0331.220] I> Command received is 1
[0331.292] I> Command received is 1
[0331.373] I> Command received is 1
[0331.384] I> Command received is 2
[0331.400] I> mb2 image downloaded
[0331.466] I> Command received is 1
[0331.475] I> Command received is 10
[0331.478] I> Recovery boot mode 0
[0331.484] I> Boot-device: eMMC
[0331.489] I> UPHY full init done
[0331.493] I> MTS carveout BOM: 0x0
[0331.496] I> WP-0 triggered
[0331.499] I> MB1 done

[0331.504] W> Profiler not initialized
[0331.508] I> Welcome to MB2(TBoot-BPMP) Applet
[0331.512] W> Profiler not initialized
[0331.515] E> DEVICE_PROD: Invalid value data = 0, size = 0.
[0331.521] W> Device prod registration failed
[0331.525] W> Profiler not initialized
[0331.571] I> sdmmc DDR50 mode
[0331.575] E> QSPI Flash: Insufficient flash size (0 MB)
[0331.580] I> QSPI Flash is not present.
[0331.631] E> Link startup dme_set failed
[0331.635] E> UFS initialization failed
[0331.638] I> UFS is not present
[0331.641] W> Profiler not initialized
[0331.647] I> Found 15 partitions in SDMMC_BOOT (instance 3)
[0331.656] I> Found 36 partitions in SDMMC_BOOT (instance 3)
[0331.661] W> Profiler not initialized
[0331.665] I> Entering 3p server
[0331.668] I> USB configuration success
[0332.746] I> Populate eeprom info
[0332.751] I> Populate eeprom info for module cvm
[0332.911] I> Rebooting : reboot-recovery

[033

Ouch, this was a silly mistake. I had a stray -t flag when calling flash.sh, so TEGRABOOT variable was unset, thus the “Stat for TEGRABOOT failed”

flash.sh was silent about the fact that -t was specified without an actual filename.