DTB flash not working

I’ve been trying to flash a modified DTB onto my Nano Development Kit but nothing I’ve tried seems to be working. First off, my host machine is running Ubuntu 18.04 on a VM on a Windows PC. I doubt there are any issues because of this. I can successfully boot my Nano into FRC and see it appear in lsusb output. When I run flash I’m told “The [DTB] has been updated successfully”.

What am I trying to do and how do I know it’s not working?

I want to free up an extra UART port - the one being used on the J44 header as a serial debug console. After everything I’ve tried, using an o-scope, I still see that the UART TX pin is being modulated on boot.

What have I tried?

First off, I’m using a 32 GB SD card with “jetson-nano-sd-r32.1-2019-03-18.img”. The device boots properly, everything is normal. From the nano, I take /boot/tegra210-p3448-0000-p3449-0000-a02.dtb and copy it onto my host machine. I use dtc to create my DTS file, then I modify the serial definition for that port to match the subsequent, regular serial node definitions.

From:

serial@70006000 {
                compatible = "nvidia,tegra210-uart", "nvidia,tegra114-hsuart", "nvidia,tegra20-uart";
                reg = <0x0 0x70006000 0x0 0x40>;
                reg-shift = <0x2>;
                interrupts = <0x0 0x24 0x4>;
                iommus = <0x2b 0xe>;
                dmas = <0x4c 0x8 0x4c 0x8>;
                dma-names = "rx", "tx";
                clocks = <0x21 0x6 0x21 0xf3>;
                clock-names = "serial", "parent";
                nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
                status = "okay";
                console-port;
                sqa-automation-port;
                enable-rx-poll-timer;
                linux,phandle = <0x107>;
                phandle = <0x107>;
        };

To:

serial@70006000 {
                compatible = "nvidia,tegra114-hsuart";
                reg = <0x0 0x70006000 0x0 0x40>;
                reg-shift = <0x2>;
                interrupts = <0x0 0x24 0x4>;
                iommus = <0x2b 0xe>;
                dmas = <0x4c 0x8 0x4c 0x8>;
                dma-names = "rx", "tx";
                clocks = <0x27 0x6 0x27 0xf3>;
                clock-names = "serial", "parent";
                resets = <0x27 0x7>;
                reset-names = "serial";
                nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
                status = "okay";
                linux,phandle = <0xeb>;
                phandle = <0xeb>;
        };

In the ‘chosen’ node, I remove “stdout-path = “/serial@70006000”;” and from the ‘bootargs’ property string I remove “earlycon=uart8250,mmio32,0x70006000”.

From ‘regra_fiq_debugger’ I remove “use-console-port;” Maybe this isn’t necessary, but I doubt this is causing the problem.

Using dtc again, I generate my updated tegra210-p3448-0000-p3449-0000-a02.dtb and replace it in “~/nvidia/nvidia_sdk/Jetpack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/kernel/dtb”. The previous dtb is also found in “…/Linux_for_Tegra/bootloader” so I replace that one for good measure.

In p3448-0000.conf.common I set an empty CMDLINE_ADD string - previously “console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.iframes=0”.

Finally, boot the Nano in FRC mode, lsusb to verify it’s present and run “sudo ./flash.sh --no-systemimg -k DTB jetson-nano-qspi-sd mmcblk0p1”

Output from flash is…

###############################################################################
# L4T BSP Information:
# R32 , REVISION: 2.1
###############################################################################
# Target Board Information:
# Name: jetson-nano-qspi-sd, Board Family: t210ref, SoC: Tegra 210, 
# OpMode: production, Boot Authentication: , 
###############################################################################
./tegraflash.py --chip 0x21 --applet "/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/nvtboot_recovery.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.0066 ] Generating RCM messages
[   0.0086 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm /home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/nvtboot_recovery.bin 0 0
[   0.0097 ] RCM 0 is saved as rcm_0.rcm
[   0.0105 ] RCM 1 is saved as rcm_1.rcm
[   0.0108 ] List of rcm files are saved in rcm_list.xml
[   0.0165 ] 
[   0.0166 ] Signing RCM messages
[   0.0178 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0187 ] Assuming zero filled SBK key
[   0.0285 ] 
[   0.0285 ] Copying signature to RCM mesages
[   0.0294 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   0.0362 ] 
[   0.0363 ] Boot Rom communication
[   0.0370 ] tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml --skipuid
[   0.0380 ] RCM version 0X210001
[   0.1052 ] Boot Rom communication completed
[   1.1709 ] 
[   1.1711 ] dump EEPROM info
[   1.1754 ] tegrarcm --oem platformdetails eeprom /home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/cvm.bin
[   1.1797 ] Applet version 00.01.0000
[   1.3596 ] Saved platform info in /home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/cvm.bin
[   1.6209 ] 
copying bctfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg)... done.
copying bootloader(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying initrd(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
	populating kernel to rootfs... done.
	populating initrd to rootfs... done.
	populating /home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb to rootfs... done.
Making Boot image... done.
Existing sosfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)... done.
copying cpu_bootloader(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying bpffile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)... done.
Existing badpagefile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/badpage.bin) reused.
copying wb0boot(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)... done.
Existing tosfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)... done.
Copying nv_boot_control.conf to rootfs
Skip generating system.img
Existing tbcfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)... done.
copying cfgfile(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_spi_sd_p3448.xml) to flash.xml... done.
copying flasher(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
Existing flashapp(/home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/tegraflash.py) reused.
*** Updating [DTB] with tegra210-p3448-0000-p3449-0000-a02.dtb ***
./tegraflash.py --bl cboot.bin --bldtb tegra210-p3448-0000-p3449-0000-a02.dtb  --chip 0x21 --applet nvtboot_recovery.bin --bct  P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg  --cfg  flash.xml   --cmd "sign; write DTB ./signed/tegra210-p3448-0000-p3449-0000-a02.dtb.encrypt; 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
 
1
2
3
[   0.0094 ] tegrasign --key None --getmode mode.txt
[   0.0104 ] Assuming zero filled SBK key
[   0.0161 ] 
[   0.0161 ] Generating RCM messages
[   0.0169 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   0.0179 ] RCM 0 is saved as rcm_0.rcm
[   0.0184 ] RCM 1 is saved as rcm_1.rcm
[   0.0187 ] List of rcm files are saved in rcm_list.xml
[   0.0245 ] 
[   0.0246 ] Signing RCM messages
[   0.0254 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0263 ] Assuming zero filled SBK key
[   0.0366 ] 
[   0.0366 ] Copying signature to RCM mesages
[   0.0375 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   0.0444 ] 
[   0.0444 ] Parsing partition layout
[   0.0452 ] tegraparser --pt flash.xml.tmp
[   0.0522 ] 
[   0.0522 ] Creating list of images to be signed
[   0.0529 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   0.0600 ] 
[   0.0600 ] Generating signatures
[   0.0608 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.key
[   0.0618 ] Assuming zero filled SBK key
[   0.1084 ] 
[   0.1084 ] Generating br-bct
[   0.1094 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   0.1103 ] Copying Sdram info from 0 to 1 set
[   0.1119 ] Copying Sdram info from 1 to 2 set
[   0.1122 ] Copying Sdram info from 2 to 3 set
[   0.1162 ] 
[   0.1162 ] Updating boot device parameters
[   0.1169 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   0.1178 ] Warning: No sdram params
[   0.1240 ] 
[   0.1240 ] Updating bl info
[   0.1249 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   0.1322 ] 
[   0.1322 ] Updating secondary storage information into bct
[   0.1330 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct
[   0.1401 ] 
[   0.1401 ] Get Signed section of bct
[   0.1409 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   0.1483 ] 
[   0.1484 ] Signing BCT
[   0.1500 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.key
[   0.1509 ] Assuming zero filled SBK key
[   0.1563 ] 
[   0.1563 ] Updating BCT with signature
[   0.1571 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml
[   0.1640 ] 
[   0.1640 ] Copying signatures
[   0.1648 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --updatesig images_list_signed.xml
[   0.1723 ] 
[   0.1724 ] Copying signed file in /home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/signed
4
[   0.1816 ] Generating RCM messages
[   0.1826 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   0.1836 ] RCM 0 is saved as rcm_0.rcm
[   0.1842 ] RCM 1 is saved as rcm_1.rcm
[   0.1847 ] List of rcm files are saved in rcm_list.xml
[   0.1884 ] 
[   0.1884 ] Signing RCM messages
[   0.1893 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.1902 ] Assuming zero filled SBK key
[   0.2001 ] 
[   0.2001 ] Copying signature to RCM mesages
[   0.2010 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   0.2084 ] 
[   0.2084 ] Boot Rom communication
[   0.2092 ] tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml
[   0.2103 ] BootRom is not running
[   0.2762 ] 
[   0.2763 ] Parsing partition layout
[   0.2798 ] tegraparser --pt flash.xml.tmp
[   0.2884 ] 
[   0.2885 ] Creating list of images to be signed
[   0.2899 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   0.3001 ] 
[   0.3002 ] Generating signatures
[   0.3016 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.key
[   0.3031 ] Assuming zero filled SBK key
[   0.3562 ] 
[   0.3562 ] Send BCT from Host
[   0.3562 ] Generating br-bct
[   0.3574 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   0.3584 ] Copying Sdram info from 0 to 1 set
[   0.3600 ] Copying Sdram info from 1 to 2 set
[   0.3603 ] Copying Sdram info from 2 to 3 set
[   0.3645 ] 
[   0.3646 ] Updating boot device parameters
[   0.3657 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   0.3666 ] Warning: No sdram params
[   0.3723 ] 
[   0.3723 ] Updating bl info
[   0.3731 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   0.3799 ] 
[   0.3799 ] Updating secondary storage information into bct
[   0.3808 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct
[   0.3884 ] 
[   0.3884 ] Get Signed section of bct
[   0.3892 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   0.3967 ] 
[   0.3967 ] Signing BCT
[   0.3988 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.key
[   0.3998 ] Assuming zero filled SBK key
[   0.4041 ] 
[   0.4041 ] Updating BCT with signature
[   0.4051 ] tegrabct --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml
[   0.4119 ] 
[   0.4120 ] Sending BCTs
[   0.4128 ] tegrarcm --download bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.bct
[   0.4138 ] Applet version 00.01.0000
[   0.5919 ] Sending bct
[   0.5927 ] [................................................] 100%
[   0.8653 ] 
[   0.8654 ] Sending bootloader and pre-requisite binaries
[   0.8695 ] tegrarcm --download ebt cboot.bin 0 0 --download rp1 tegra210-p3448-0000-p3449-0000-a02.dtb 0
[   0.8741 ] Applet version 00.01.0000
[   1.0512 ] Sending ebt
[   1.0530 ] [................................................] 100%
[   1.3934 ] Sending rp1
[   1.4589 ] [................................................] 100%
[   1.7252 ] 
[   1.7290 ] tegrarcm --boot recovery
[   1.7330 ] Applet version 00.01.0000
[   2.0541 ] 
[   2.0544 ] Writing partition
[   2.0581 ] tegradevflash --write DTB /home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/signed/tegra210-p3448-0000-p3449-0000-a02.dtb.encrypt
[   2.0623 ] Cboot version 00.01.0000
[   2.8878 ] Writing partition DTB with /home/filippo/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/Linux_for_Tegra/bootloader/signed/tegra210-p3448-0000-p3449-0000-a02.dtb.encrypt
[   2.8954 ] [................................................] 100%
[   3.2477 ] 
[   3.2480 ] Coldbooting the device
[   3.2648 ] tegradevflash --reboot coldboot
[   3.2690 ] Cboot version 00.01.0000
[   3.5216 ] 
*** The [DTB] has been updated successfully. ***

Unfortunately, after reboot I can still see that the TX pin is active.

My next option based on what I’ve been reading is to take the dtb.encrypt file and copy it into the DTB partition directly from within the nano. I copy the encrypt file from my host to the nano, then run “sudo dd if={my encrypted dtb}.encrypt of=/dev/disk/by-partlabel/DTB”. I reboot and still, TX is active.

What could I be doing wrong when the official flash script claims DTB is being updated successfully? Is it possible that the DTB file baked into “jetson-nano-sd-r32.1-2019-03-18.img” continues to be utilized even though I am flashing my own? Why would that be the case and then is my only option to recompile the kernel image using my DTB?

Many thanks.

The first things I’d do (if you haven’t done it already) is to look at /proc/cmdline and make sure your kernel command line changes took. Then check the appropriate device tree node in /sys/firmware/devicetree/base to make sure your dts changes took.

If they did, then bear in mind that tboot, cboot and u-boot all dump out to that serial port before the kernel loads. I’m not sure what to do about tboot but you can flash the EBT partition (which is cboot) which will use the new dtb and you should also flash the RP1 partition. u-boot you’ll have to recompile to get it to not use the serial port. Start with EBT and RP1 though and see how far that gets you.

interesting