Problems Flashing U-Boot only

I am trying to make some minor changes to u-boot, and then I would like to flash u-boot only. Per the L4T documentation you are supposed to run:

$ sudo ./flash.sh -k kernel jetson-tx2 mmcblk0p1

This doesn’t work for me because I have configured my Tx2 for secure boot, so I also need to provide my private key. Instead I use use the command:

$ sudo ./flash.sh -x 0x18 -y PKC -u /home/David_N/work/nvidia/secureboot/tx2_secureboot.pem -r -k kernel jetson-tx2 mmcblk0p1

When I do this, flash.sh gets stuck at:

[   3.6196 ] tegradevflash_v2 --iscpubl
[   3.6352 ] CPU Bootloader is not running on device.

Am I doing anything wrong? Is there an easier way I can flash just u-boot so that I don’t have to flash the entire system.img?

BTW, here is my full log:

$ sudo ./flash.sh -x 0x18 -y PKC -u /home/David_N/work/nvidia/secureboot/tx2_secureboot.pem -r -k kernel jetson-tx2 mmcblk0p1
[sudo] password for David_N: 
./tegraflash.py --chip 0x18 --applet "/home/David_N/nvidia/factory_image_28.1/factory/bootloader/mb1_recovery_prod.bin" --cmd "dump eeprom boardinfo cvm.bin" --skipuid --key "/home/David_N/work/nvidia/secureboot/tx2_secureboot.pem" 
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.0076 ] Generating RCM messages
[   0.0129 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x18 --download rcm /home/David_N/nvidia/factory_image_28.1/factory/bootloader/mb1_recovery_prod.bin 0 0
[   0.0202 ] RCM 0 is saved as rcm_0.rcm
[   0.0225 ] RCM 1 is saved as rcm_1.rcm
[   0.0227 ] List of rcm files are saved in rcm_list.xml
[   0.0241 ] 
[   0.0242 ] Signing RCM messages
[   0.0272 ] tegrasign_v2 --key /home/David_N/work/nvidia/secureboot/tx2_secureboot.pem --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0291 ] PKC key in Open SSL format
[   0.0298 ] Saving public key  in pub_key.key
[   0.1884 ] 
[   0.1884 ] Copying signature to RCM mesages
[   0.1897 ] tegrarcm_v2 --chip 0x18 --updatesig rcm_list_signed.xml --pubkeyhash pub_key.key
[   0.1967 ] 
[   0.1968 ] Boot Rom communication
[   0.1979 ] tegrarcm_v2 --chip 0x18 --rcm rcm_list_signed.xml --skipuid
[   0.1992 ] RCM version 0X180001
[   0.2017 ] Boot Rom communication completed
[   1.2252 ] 
[   1.2336 ] tegrarcm_v2 --isapplet
[   1.2372 ] USB communication failed.Check if device is in recovery
[   1.7239 ] 
[   1.7317 ] tegradevflash_v2 --iscpubl
[   1.7345 ] CPU Bootloader is not running on device.
[   1.8102 ] 
[   2.8947 ] Retrieving EEPROM data
[   2.8954 ] tegrarcm_v2 --oem platformdetails eeprom cvm /home/David_N/nvidia/factory_image_28.1/factory/bootloader/cvm.bin
[   2.8997 ] Applet version 01.00.0000
[   2.9728 ] Saved platform info in /home/David_N/nvidia/factory_image_28.1/factory/bootloader/cvm.bin
[   3.1273 ] 
Board ID(3310) version(B02) 
copying bctfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/P3310_A00_8GB_Samsung_8GB_lpddr4_204Mhz_A02_l4t.cfg)... done.
copying misc_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/tegra186-mb1-bct-misc-si-l4t.cfg)... done.
copying pinmux_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg)... done.
copying pmic_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/tegra186-mb1-bct-pmic-quill-p3310-1000-c04.cfg)... done.
copying pmc_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg)... done.
copying prod_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/tegra186-mb1-bct-prod-quill-p3310-1000-c03.cfg)... done.
copying scr_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/minimal_scr.cfg)... done.
copying scr_cold_boot_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/mobile_scr.cfg)... done.
copying bootrom_config(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/tegra186-mb1-bct-bootrom-quill-p3310-1000-c03.cfg)... done.
copying dev_params(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/BCT/emmc.cfg)... done.
Existing bootloader(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/nvtboot_cpu.bin) reused.
	populating kernel to rootfs... done.
	populating initrd to rootfs... done.
	populating extlinux.conf.emmc to rootfs... done.
	populating /home/David_N/nvidia/JetPack_3.1/64_TX2/Linux_for_Tegra_tx2/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb to rootfs... done.
done.
Making Boot image... done.
Existing sosfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/mb1_recovery_prod.bin) reused.
copying tegraboot(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/nvtboot.bin)... done.
Existing mb2blfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/nvtboot_recovery.bin) reused.
Existing mtspreboot(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/preboot_d15_prod_cr.bin) reused.
Existing mts(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/mce_mts_d15_prod_cr.bin) reused.
Existing mb1file(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/mb1_prod.bin) reused.
Existing bpffile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/bpmp.bin) reused.
copying bpfdtbfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2.dtb)... done.
Existing scefile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/camera-rtcpu-sce.bin) reused.
Existing spefile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/spe.bin) reused.
copying wb0boot(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/warmboot.bin)... done.
Existing tosfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/tos.img) reused.
Existing eksfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/eks.img) reused.
copying dtbfile(/home/David_N/nvidia/JetPack_3.1/64_TX2/Linux_for_Tegra_tx2/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb)... done.
Reusing existing system.img... 
done.
Existing tbcfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/cboot.bin) reused.
copying tbcdtbfile(/home/David_N/nvidia/JetPack_3.1/64_TX2/Linux_for_Tegra_tx2/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb)... done.
copying cfgfile(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/t186ref/cfg/flash_l4t_t186.xml) to flash.xml... done.
Existing flasher(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/nvtboot_recovery_cpu.bin) reused.
Existing flashapp(/home/David_N/nvidia/factory_image_28.1/factory/bootloader/tegraflash.py) reused.
*** Updating :kernel with boot.img ***
./flash.sh: line 1617: [: -eq: unary operator expected
./tegraflash.py  --bl nvtboot_recovery_cpu.bin   --chip 0x18 --applet mb1_recovery_prod.bin --sdram_config P3310_A00_8GB_Samsung_8GB_lpddr4_204Mhz_A02_l4t.cfg --misc_config tegra186-mb1-bct-misc-si-l4t.cfg --pinmux_config tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg --pmic_config tegra186-mb1-bct-pmic-quill-p3310-1000-c04.cfg --pmc_config tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg --prod_config tegra186-mb1-bct-prod-quill-p3310-1000-c03.cfg --scr_config minimal_scr.cfg --scr_cold_boot_config mobile_scr.cfg --br_cmd_config tegra186-mb1-bct-bootrom-quill-p3310-1000-c03.cfg --dev_params emmc.cfg  --cfg  flash.xml --bins "mb2_bootloader nvtboot_recovery.bin; mts_preboot preboot_d15_prod_cr.bin; mts_bootpack mce_mts_d15_prod_cr.bin; bpmp_fw bpmp.bin; bpmp_fw_dtb tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2.dtb; tlk tos.img; eks eks.img; bootloader_dtb tegra186-quill-p3310-1000-c03-00-base.dtb"  --cmd "write kernel-dtb tegra186-quill-p3310-1000-c03-00-base.dtb; write kernel boot.img;"  
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.0152 ] Generating RCM messages
[   0.0196 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x18 --download rcm mb1_recovery_prod.bin 0 0
[   0.0228 ] RCM 0 is saved as rcm_0.rcm
[   0.0269 ] RCM 1 is saved as rcm_1.rcm
[   0.0289 ] List of rcm files are saved in rcm_list.xml
[   0.0297 ] 
[   0.0298 ] Signing RCM messages
[   0.0327 ] tegrasign_v2 --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0438 ] Assuming zero filled SBK key
[   0.0561 ] 
[   0.0562 ] Copying signature to RCM mesages
[   0.0585 ] tegrarcm_v2 --chip 0x18 --updatesig rcm_list_signed.xml
[   0.0615 ] 
[   0.0621 ] Boot Rom communication
[   0.0697 ] tegrarcm_v2 --chip 0x18 --rcm rcm_list_signed.xml
[   0.0745 ] BootRom is not running
[   1.0761 ] 
[   1.0808 ] tegrarcm_v2 --isapplet
[   1.0849 ] Applet version 01.00.0000
[   1.1613 ] 
[   1.1626 ] tegrasign_v2 --key None --getmode mode.txt
[   1.1636 ] Assuming zero filled SBK key
[   1.1668 ] 
[   1.1669 ] Parsing partition layout
[   1.1718 ] tegraparser_v2 --pt flash.xml.tmp
[   1.1792 ] 
[   1.1798 ] Creating list of images to be signed
[   1.1867 ] tegrahost_v2 --chip 0x18 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
[   1.2233 ] 
[   1.2236 ] Generating signatures
[   1.2278 ] tegrasign_v2 --key None --list images_list.xml --pubkeyhash pub_key.key
[   1.2301 ] Assuming zero filled SBK key
[   1.3589 ] 
[   1.3589 ] Reading BCT from device for further operations
[   1.3590 ] Generating blob
[   1.3604 ] tegrahost_v2 --align blob_nvtboot_recovery_cpu.bin
[   1.3616 ] 
[   1.3631 ] tegrahost_v2 --appendsigheader blob_nvtboot_recovery_cpu.bin zerosbk
[   1.3646 ] 
[   1.3661 ] tegrasign_v2 --key None --list blob_nvtboot_recovery_cpu_sigheader.bin_list.xml
[   1.3709 ] Assuming zero filled SBK key
[   1.3792 ] 
[   1.3842 ] tegrahost_v2 --updatesigheader blob_nvtboot_recovery_cpu_sigheader.bin.encrypt blob_nvtboot_recovery_cpu_sigheader.bin.hash zerosbk
[   1.3885 ] 
[   1.3950 ] tegrahost_v2 --align blob_nvtboot_recovery.bin
[   1.4000 ] 
[   1.4027 ] tegrahost_v2 --appendsigheader blob_nvtboot_recovery.bin zerosbk
[   1.4102 ] 
[   1.4148 ] tegrasign_v2 --key None --list blob_nvtboot_recovery_sigheader.bin_list.xml
[   1.4181 ] Assuming zero filled SBK key
[   1.4208 ] 
[   1.4236 ] tegrahost_v2 --updatesigheader blob_nvtboot_recovery_sigheader.bin.encrypt blob_nvtboot_recovery_sigheader.bin.hash zerosbk
[   1.4262 ] 
[   1.4276 ] tegrahost_v2 --align blob_preboot_d15_prod_cr.bin
[   1.4327 ] 
[   1.4352 ] tegrahost_v2 --appendsigheader blob_preboot_d15_prod_cr.bin zerosbk
[   1.4370 ] 
[   1.4408 ] tegrasign_v2 --key None --list blob_preboot_d15_prod_cr_sigheader.bin_list.xml
[   1.4449 ] Assuming zero filled SBK key
[   1.4570 ] 
[   1.4634 ] tegrahost_v2 --updatesigheader blob_preboot_d15_prod_cr_sigheader.bin.encrypt blob_preboot_d15_prod_cr_sigheader.bin.hash zerosbk
[   1.4776 ] 
[   1.4875 ] tegrahost_v2 --align blob_mce_mts_d15_prod_cr.bin
[   1.4912 ] 
[   1.5032 ] tegrahost_v2 --appendsigheader blob_mce_mts_d15_prod_cr.bin zerosbk
[   1.5480 ] 
[   1.5577 ] tegrasign_v2 --key None --list blob_mce_mts_d15_prod_cr_sigheader.bin_list.xml
[   1.5638 ] Assuming zero filled SBK key
[   1.6352 ] 
[   1.6419 ] tegrahost_v2 --updatesigheader blob_mce_mts_d15_prod_cr_sigheader.bin.encrypt blob_mce_mts_d15_prod_cr_sigheader.bin.hash zerosbk
[   1.6572 ] 
[   1.6620 ] tegrahost_v2 --align blob_bpmp.bin
[   1.6658 ] 
[   1.6688 ] tegrahost_v2 --appendsigheader blob_bpmp.bin zerosbk
[   1.6833 ] 
[   1.6863 ] tegrasign_v2 --key None --list blob_bpmp_sigheader.bin_list.xml
[   1.6906 ] Assuming zero filled SBK key
[   1.7075 ] 
[   1.7116 ] tegrahost_v2 --updatesigheader blob_bpmp_sigheader.bin.encrypt blob_bpmp_sigheader.bin.hash zerosbk
[   1.7137 ] 
[   1.7153 ] tegrahost_v2 --align blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2.dtb
[   1.7201 ] 
[   1.7225 ] tegrahost_v2 --appendsigheader blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2.dtb zerosbk
[   1.7286 ] 
[   1.7380 ] tegrasign_v2 --key None --list blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2_sigheader.dtb_list.xml
[   1.7421 ] Assuming zero filled SBK key
[   1.7589 ] 
[   1.7663 ] tegrahost_v2 --updatesigheader blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2_sigheader.dtb.encrypt blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2_sigheader.dtb.hash zerosbk
[   1.7782 ] 
[   1.7814 ] tegrahost_v2 --align blob_tos.img
[   1.7841 ] 
[   1.7875 ] tegrahost_v2 --appendsigheader blob_tos.img zerosbk
[   1.7982 ] 
[   1.8054 ] tegrasign_v2 --key None --list blob_tos_sigheader.img_list.xml
[   1.8130 ] Assuming zero filled SBK key
[   1.8263 ] 
[   1.8341 ] tegrahost_v2 --updatesigheader blob_tos_sigheader.img.encrypt blob_tos_sigheader.img.hash zerosbk
[   1.8461 ] 
[   1.8495 ] tegrahost_v2 --align blob_eks.img
[   1.8595 ] 
[   1.8656 ] tegrahost_v2 --appendsigheader blob_eks.img zerosbk
[   1.8707 ] 
[   1.8752 ] tegrasign_v2 --key None --list blob_eks_sigheader.img_list.xml
[   1.8828 ] Assuming zero filled SBK key
[   1.8843 ] 
[   1.8882 ] tegrahost_v2 --updatesigheader blob_eks_sigheader.img.encrypt blob_eks_sigheader.img.hash zerosbk
[   1.8947 ] 
[   1.9005 ] tegrahost_v2 --align blob_tegra186-quill-p3310-1000-c03-00-base.dtb
[   1.9037 ] 
[   1.9046 ] tegrahost_v2 --appendsigheader blob_tegra186-quill-p3310-1000-c03-00-base.dtb zerosbk
[   1.9082 ] 
[   1.9112 ] tegrasign_v2 --key None --list blob_tegra186-quill-p3310-1000-c03-00-base_sigheader.dtb_list.xml
[   1.9137 ] Assuming zero filled SBK key
[   1.9273 ] 
[   1.9329 ] tegrahost_v2 --updatesigheader blob_tegra186-quill-p3310-1000-c03-00-base_sigheader.dtb.encrypt blob_tegra186-quill-p3310-1000-c03-00-base_sigheader.dtb.hash zerosbk
[   1.9464 ] 
[   1.9524 ] tegrahost_v2 --generateblob blob.xml blob.bin
[   1.9561 ] number of images in blob are 9
[   1.9570 ] blobsize is 3725048
[   1.9571 ] Added binary blob_nvtboot_recovery_cpu_sigheader.bin.encrypt of size 184576
[   1.9651 ] Added binary blob_nvtboot_recovery_sigheader.bin.encrypt of size 78080
[   1.9656 ] Added binary blob_preboot_d15_prod_cr_sigheader.bin.encrypt of size 61472
[   1.9668 ] Added binary blob_mce_mts_d15_prod_cr_sigheader.bin.encrypt of size 2077088
[   1.9849 ] Added binary blob_bpmp_sigheader.bin.encrypt of size 528800
[   1.9906 ] Added binary blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2_sigheader.dtb.encrypt of size 466160
[   1.9921 ] Added binary blob_tos_sigheader.img.encrypt of size 58880
[   1.9922 ] Added binary blob_eks_sigheader.img.encrypt of size 1488
[   1.9924 ] Added binary blob_tegra186-quill-p3310-1000-c03-00-base_sigheader.dtb.encrypt of size 268352
[   2.0192 ] 
[   2.0194 ] Sending bootloader and pre-requisite binaries
[   2.0240 ] tegrarcm_v2 --download blob blob.bin
[   2.0302 ] Applet version 01.00.0000
[   2.0969 ] Sending blob
[   2.0970 ] [................................................] 100%
[   3.3694 ] 
[   3.3757 ] tegrarcm_v2 --boot recovery
[   3.3794 ] Applet version 01.00.0000
[   3.4946 ] 
[   3.5048 ] tegrarcm_v2 --isapplet
[   3.6036 ] 
[   3.6196 ] tegradevflash_v2 --iscpubl
[   3.6352 ] CPU Bootloader is not running on device.
[   3.7103 ]

hello David_N,

since partial update should NEVER be used in factory environment.
we don’t support partial update with fused device.
just make sure clean-full flashing/fusing used all the time.
thanks

Okay, got it. Thanks. I will find a non-fused device for boot development.