How to modify the bootloader in TX2?

I want to modify the boot loader of TX2 to choose between two image locations to boot from. Plan is to wait for some instructions on uart1 (instead of uart0) to make the choice. I found that dual boot setup could be done from a forum discussion
https://devtalk.nvidia.com/default/topic/1048631/jetson-tx2-dual-boot-support/

But, how to build u-boot? Should it be built on the target or host? Can the built boot loader be then placed in the jetpack folder to be flashed on to the TX2 ?

On rel-32.3.1, you should be able to see boot option in u-boot asks you to choose 2 boot location. Though currently they are both on emmc.

Is that what you want?

yes, I could see that the boot loader is expecting input on the UART0 at some point in the booting process to choose the boot location. But I want to use a different port (UART1/UART2) to process user inputs as they are the ones that are physically connected to our carrier board processor. Hence I want to modify the boot code to wait for the commands. I don’t have experience in modifying bootloader. Hence I had asked for guidance.

To update u-boot, you could refer to the guidance here.
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fuboot_guide.html%23

I followed the steps in the link to build the u-boot in the host system. Then when I flashed it, I got the following error

###############################################################################
# L4T BSP Information:
# R32 , REVISION: 2.1
###############################################################################
# Target Board Information:
# Name: jetson-tx2, Board Family: t186ref, SoC: Tegra 186, 
# OpMode: production, Boot Authentication: NS, 
###############################################################################
./tegraflash.py --chip 0x18 --applet "/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/mb1_recovery_prod.bin" --skipuid --cmd "dump eeprom boardinfo cvm.bin" 
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.0023 ] Generating RCM messages
[   0.0031 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x18 0 --download rcm /home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/mb1_recovery_prod.bin 0 0
[   0.0039 ] RCM 0 is saved as rcm_0.rcm
[   0.0043 ] RCM 1 is saved as rcm_1.rcm
[   0.0043 ] List of rcm files are saved in rcm_list.xml
[   0.0043 ] 
[   0.0044 ] Signing RCM messages
[   0.0050 ] tegrasign_v2 --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0057 ] Assuming zero filled SBK key
[   0.0084 ] 
[   0.0084 ] Copying signature to RCM mesages
[   0.0092 ] tegrarcm_v2 --chip 0x18 0 --updatesig rcm_list_signed.xml
[   0.0101 ] 
[   0.0101 ] Boot Rom communication
[   0.0107 ] tegrarcm_v2 --chip 0x18 0 --rcm rcm_list_signed.xml --skipuid
[   0.0113 ] RCM version 0X180001
[   0.0123 ] Boot Rom communication completed
[   1.0189 ] 
[   2.0233 ] tegrarcm_v2 --isapplet
[   2.0261 ] Applet version 01.00.0000
[   2.0466 ] 
[   2.0487 ] Retrieving EEPROM data
[   2.0489 ] tegrarcm_v2 --oem platformdetails eeprom cvm /home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/cvm.bin
[   2.0506 ] Applet version 01.00.0000
[   2.0862 ] Saved platform info in /home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/cvm.bin
[   2.1591 ] 
Board ID(3310) version(B02) sku(1000) revision(B.0)
copying bctfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/P3310_A00_8GB_Samsung_8GB_lpddr4_204Mhz_A02_l4t.cfg)... done.
copying misc_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-misc-si-l4t.cfg)... done.
copying pinmux_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg)... done.
copying pmic_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pmic-quill-p3310-1000-c04.cfg)... done.
copying pmc_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pad-quill-p3310-1000-c03.cfg)... done.
copying prod_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-prod-quill-p3310-1000-c03.cfg)... done.
copying scr_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/minimal_scr.cfg)... done.
copying scr_cold_boot_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/mobile_scr.cfg)... done.
copying bootrom_config(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-bootrom-quill-p3310-1000-c03.cfg)... done.
copying dev_params(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/BCT/emmc.cfg)... done.
Existing bootloader(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying initrd(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
	populating kernel to rootfs... done.
	populating initrd to rootfs... done.
	populating /home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb to rootfs... done.
Making Boot image... done.
Existing sosfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/mb1_recovery_prod.bin) reused.
copying tegraboot(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/nvtboot.bin)... done.
Existing cpu_bootloader(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
Existing mb2blfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
Existing mtspreboot(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/preboot_d15_prod_cr.bin) reused.
Existing mts(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/mce_mts_d15_prod_cr.bin) reused.
Existing mb1file(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/mb1_prod.bin) reused.
Existing bpffile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/bpmp.bin) reused.
copying bpfdtbfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2.dtb)... done.
Existing scefile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/camera-rtcpu-sce.img) reused.
Existing spefile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/spe.bin) reused.
Existing drameccfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/dram-ecc.bin) reused.
Existing badpagefile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/badpage.bin) reused.
copying wb0boot(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/warmboot.bin)... done.
Existing tosfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/tos-trusty.img) reused.
Existing eksfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb)... done.
Copying nv_boot_control.conf to rootfs
Existing tbcfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/cboot.bin) reused.
copying tbcdtbfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb)... done.
copying cfgfile(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/t186ref/cfg/flash_l4t_t186.xml) to flash.xml... done.
Existing flasher(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/nvtboot_recovery_cpu.bin) reused.
Existing flashapp(/home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/tegraflash.py) reused.
*** Updating [LNX] with boot.img ***
./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-trusty.img; eks eks.img; bootloader_dtb tegra186-quill-p3310-1000-c03-00-base.dtb"  --cmd "write DTB tegra186-quill-p3310-1000-c03-00-base.dtb; write LNX boot.img; reboot"  
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.0075 ] Generating RCM messages
[   0.0083 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x18 0 --download rcm mb1_recovery_prod.bin 0 0
[   0.0090 ] RCM 0 is saved as rcm_0.rcm
[   0.0093 ] RCM 1 is saved as rcm_1.rcm
[   0.0093 ] List of rcm files are saved in rcm_list.xml
[   0.0093 ] 
[   0.0093 ] Signing RCM messages
[   0.0100 ] tegrasign_v2 --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0106 ] Assuming zero filled SBK key
[   0.0133 ] 
[   0.0133 ] Copying signature to RCM mesages
[   0.0139 ] tegrarcm_v2 --chip 0x18 0 --updatesig rcm_list_signed.xml
[   0.0148 ] 
[   0.0148 ] Boot Rom communication
[   0.0154 ] tegrarcm_v2 --chip 0x18 0 --rcm rcm_list_signed.xml
[   0.0159 ] BootRom is not running
[   5.0339 ] 
[   6.0376 ] tegrarcm_v2 --isapplet
[   6.0397 ] Applet version 01.00.0000
[   6.0428 ] 
[   6.0447 ] tegrasign_v2 --key None --getmode mode.txt
[   6.0463 ] Assuming zero filled SBK key
[   6.0466 ] 
[   6.0467 ] Parsing partition layout
[   6.0479 ] tegraparser_v2 --pt flash.xml.tmp
[   6.0495 ] 
[   6.0496 ] Creating list of images to be signed
[   6.0507 ] tegrahost_v2 --chip 0x18 0 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
[   6.0751 ] 
[   6.0751 ] Generating signatures
[   6.0760 ] tegrasign_v2 --key None --list images_list.xml --pubkeyhash pub_key.key
[   6.0766 ] Assuming zero filled SBK key
[   6.3232 ] 
[   6.3232 ] Reading BCT from device for further operations
[   6.3233 ] Generating blob
[   6.3243 ] tegrahost_v2 --chip 0x18 --align blob_nvtboot_recovery_cpu.bin
[   6.3251 ] 
[   6.3257 ] tegrahost_v2 --appendsigheader blob_nvtboot_recovery_cpu.bin zerosbk
[   6.3267 ] 
[   6.3276 ] tegrasign_v2 --key None --list blob_nvtboot_recovery_cpu_sigheader.bin_list.xml
[   6.3282 ] Assuming zero filled SBK key
[   6.3329 ] 
[   6.3344 ] tegrahost_v2 --updatesigheader blob_nvtboot_recovery_cpu_sigheader.bin.encrypt blob_nvtboot_recovery_cpu_sigheader.bin.hash zerosbk
[   6.3358 ] 
[   6.3369 ] tegrahost_v2 --chip 0x18 --align blob_nvtboot_recovery.bin
[   6.3376 ] 
[   6.3382 ] tegrahost_v2 --appendsigheader blob_nvtboot_recovery.bin zerosbk
[   6.3390 ] 
[   6.3399 ] tegrasign_v2 --key None --list blob_nvtboot_recovery_sigheader.bin_list.xml
[   6.3404 ] Assuming zero filled SBK key
[   6.3426 ] 
[   6.3434 ] tegrahost_v2 --updatesigheader blob_nvtboot_recovery_sigheader.bin.encrypt blob_nvtboot_recovery_sigheader.bin.hash zerosbk
[   6.3443 ] 
[   6.3451 ] tegrahost_v2 --chip 0x18 --align blob_preboot_d15_prod_cr.bin
[   6.3459 ] 
[   6.3466 ] tegrahost_v2 --appendsigheader blob_preboot_d15_prod_cr.bin zerosbk
[   6.3473 ] 
[   6.3481 ] tegrasign_v2 --key None --list blob_preboot_d15_prod_cr_sigheader.bin_list.xml
[   6.3486 ] Assuming zero filled SBK key
[   6.3501 ] 
[   6.3509 ] tegrahost_v2 --updatesigheader blob_preboot_d15_prod_cr_sigheader.bin.encrypt blob_preboot_d15_prod_cr_sigheader.bin.hash zerosbk
[   6.3516 ] 
[   6.3523 ] tegrahost_v2 --chip 0x18 --align blob_mce_mts_d15_prod_cr.bin
[   6.3529 ] 
[   6.3539 ] tegrahost_v2 --appendsigheader blob_mce_mts_d15_prod_cr.bin zerosbk
[   6.3582 ] 
[   6.3593 ] tegrasign_v2 --key None --list blob_mce_mts_d15_prod_cr_sigheader.bin_list.xml
[   6.3599 ] Assuming zero filled SBK key
[   6.4073 ] 
[   6.4085 ] tegrahost_v2 --updatesigheader blob_mce_mts_d15_prod_cr_sigheader.bin.encrypt blob_mce_mts_d15_prod_cr_sigheader.bin.hash zerosbk
[   6.4112 ] 
[   6.4120 ] tegrahost_v2 --chip 0x18 --align blob_bpmp.bin
[   6.4127 ] 
[   6.4133 ] tegrahost_v2 --appendsigheader blob_bpmp.bin zerosbk
[   6.4146 ] 
[   6.4155 ] tegrasign_v2 --key None --list blob_bpmp_sigheader.bin_list.xml
[   6.4161 ] Assuming zero filled SBK key
[   6.4288 ] 
[   6.4300 ] tegrahost_v2 --updatesigheader blob_bpmp_sigheader.bin.encrypt blob_bpmp_sigheader.bin.hash zerosbk
[   6.4312 ] 
[   6.4319 ] tegrahost_v2 --chip 0x18 --align blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2.dtb
[   6.4325 ] 
[   6.4332 ] tegrahost_v2 --appendsigheader blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2.dtb zerosbk
[   6.4344 ] 
[   6.4352 ] tegrasign_v2 --key None --list blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2_sigheader.dtb_list.xml
[   6.4358 ] Assuming zero filled SBK key
[   6.4465 ] 
[   6.4474 ] 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
[   6.4485 ] 
[   6.4491 ] tegrahost_v2 --chip 0x18 --align blob_tos-trusty.img
[   6.4498 ] 
[   6.4504 ] tegrahost_v2 --appendsigheader blob_tos-trusty.img zerosbk
[   6.4515 ] 
[   6.4522 ] tegrasign_v2 --key None --list blob_tos-trusty_sigheader.img_list.xml
[   6.4528 ] Assuming zero filled SBK key
[   6.4599 ] 
[   6.4608 ] tegrahost_v2 --updatesigheader blob_tos-trusty_sigheader.img.encrypt blob_tos-trusty_sigheader.img.hash zerosbk
[   6.4618 ] 
[   6.4626 ] tegrahost_v2 --chip 0x18 --align blob_eks.img
[   6.4633 ] 
[   6.4639 ] tegrahost_v2 --appendsigheader blob_eks.img zerosbk
[   6.4645 ] 
[   6.4653 ] tegrasign_v2 --key None --list blob_eks_sigheader.img_list.xml
[   6.4661 ] Assuming zero filled SBK key
[   6.4663 ] 
[   6.4672 ] tegrahost_v2 --updatesigheader blob_eks_sigheader.img.encrypt blob_eks_sigheader.img.hash zerosbk
[   6.4678 ] 
[   6.4687 ] tegrahost_v2 --chip 0x18 --align blob_tegra186-quill-p3310-1000-c03-00-base.dtb
[   6.4693 ] 
[   6.4700 ] tegrahost_v2 --appendsigheader blob_tegra186-quill-p3310-1000-c03-00-base.dtb zerosbk
[   6.4711 ] 
[   6.4719 ] tegrasign_v2 --key None --list blob_tegra186-quill-p3310-1000-c03-00-base_sigheader.dtb_list.xml
[   6.4725 ] Assuming zero filled SBK key
[   6.4804 ] 
[   6.4813 ] 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
[   6.4823 ] 
[   6.4831 ] tegrahost_v2 --chip 0x18 --generateblob blob.xml blob.bin
[   6.4837 ] number of images in blob are 9
[   6.4839 ] blobsize is 4097256
[   6.4840 ] Added binary blob_nvtboot_recovery_cpu_sigheader.bin.encrypt of size 203312
[   6.4856 ] Added binary blob_nvtboot_recovery_sigheader.bin.encrypt of size 89360
[   6.4860 ] Added binary blob_preboot_d15_prod_cr_sigheader.bin.encrypt of size 63104
[   6.4864 ] Added binary blob_mce_mts_d15_prod_cr_sigheader.bin.encrypt of size 2082144
[   6.4868 ] Added binary blob_bpmp_sigheader.bin.encrypt of size 533904
[   6.4872 ] Added binary blob_tegra186-a02-bpmp-quill-p3310-1000-c04-00-te770d-ucm2_sigheader.dtb.encrypt of size 466240
[   6.4877 ] Added binary blob_tos-trusty_sigheader.img.encrypt of size 313152
[   6.4879 ] Added binary blob_eks_sigheader.img.encrypt of size 1440
[   6.4882 ] Added binary blob_tegra186-quill-p3310-1000-c03-00-base_sigheader.dtb.encrypt of size 344448
[   6.4897 ] 
[   6.4897 ] Sending bootloader and pre-requisite binaries
[   6.4906 ] tegrarcm_v2 --download blob blob.bin
[   6.4912 ] Applet version 01.00.0000
[   6.5073 ] Sending blob
[   6.5074 ] [................................................] 100%
[   7.0118 ] 
[   7.0149 ] tegrarcm_v2 --boot recovery
[   7.0173 ] Applet version 01.00.0000
[   7.0369 ] 
[   8.0402 ] tegrarcm_v2 --isapplet
[   8.0428 ] 
[   8.0448 ] tegradevflash_v2 --iscpubl
[   8.0460 ] CPU Bootloader is not running on device.
[   8.0620 ] 
[   9.0658 ] tegrarcm_v2 --isapplet
[   9.0702 ] 
[   9.0726 ] tegradevflash_v2 --iscpubl
[   9.0749 ] Bootloader version 01.00.0000
[   9.0915 ] Bootloader version 01.00.0000
[   9.0926 ] 
[   9.0927 ] Writing partition
[   9.0945 ] tegradevflash_v2 --write DTB /home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/tegra186-quill-p3310-1000-c03-00-base.dtb
[   9.0960 ] Bootloader version 01.00.0000
[   9.1111 ] Writing partition DTB with /home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/tegra186-quill-p3310-1000-c03-00-base.dtb
[   9.1119 ] 000000000d0d000d: o open partition %s.
[   9.1241 ] 
[   9.1241 ] 
Error: Return value 13
Command tegradevflash_v2 --write DTB /home/deepak/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/Linux_for_Tegra/bootloader/tegra186-quill-p3310-1000-c03-00-base.dtb
Failed to flash/read t186ref.

Can you please help me understand why is it not flashing ?

I used the command below. I wanted to flash only the u-boot

sudo ./flash.sh -k LNX jetson-tx2 mmcblk0p1

Could you also try “sudo ./flash -r -k kernel jetson-tx2 mmcblk0p1”?

Thank you, I tried using “sudo ./flash -r -k kernel jetson-tx2 mmcblk0p1” and it flashed the u-boot