Jetson Nano : Error during flashing custom dtb

Hello !
I am currently doing a lot of tests concerning some parameters of the imx219 dtsi.
I am able to compile the whole kernel and then flashing it on the Jetson nano’s SD card using the recovery mode.
But when I try to flash only the dtb, using the command found here : V4L2 Sensor Driver Development (Advanced), I get an error…

Command : sudo ./flash.sh -r -k DTB jetson-nano-devkit mmcblk0p1

Error :

pi21@pi21-OptiPlex-7040:~/Téléchargements/Linux_for_Tegra$ sudo ./flash.sh -r -k DTB jetson-nano-devkit mmcblk0p1
###############################################################################
# L4T BSP Information:
# R32 , REVISION: 5.1
###############################################################################
# Target Board Information:
# Name: jetson-nano-devkit, Board Family: t210ref, SoC: Tegra 210,
# OpMode: production, Boot Authentication: ,
# Disk encryption: disabled ,
###############################################################################
./tegraflash.py --chip 0x21 --applet "/home/pi21/Téléchargements/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.0016 ] Generating RCM messages
[   0.0023 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm /home/pi21/Téléchargements/Linux_for_Tegra/bootloader/nvtboot_recovery.bin 0 0
[   0.0029 ] RCM 0 is saved as rcm_0.rcm
[   0.0033 ] RCM 1 is saved as rcm_1.rcm
[   0.0034 ] List of rcm files are saved in rcm_list.xml
[   0.0034 ]
[   0.0034 ] Signing RCM messages
[   0.0042 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0049 ] Assuming zero filled SBK key
[   0.0090 ]
[   0.0090 ] Copying signature to RCM mesages
[   0.0098 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   0.0109 ]
[   0.0109 ] Boot Rom communication
[   0.0117 ] tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml --skipuid
[   0.0124 ] RCM version 0X210001
[   0.0567 ] Boot Rom communication completed
[   1.0640 ]
[   1.0642 ] dump EEPROM info
[   1.0670 ] tegrarcm --oem platformdetails eeprom /home/pi21/Téléchargements/Linux_for_Tegra/bootloader/cvm.bin
[   1.0693 ] Applet version 00.01.0000
[   1.0863 ] Saved platform info in /home/pi21/Téléchargements/Linux_for_Tegra/bootloader/cvm.bin
[   1.1633 ]
[   1.1662 ] tegrarcm --reboot recovery
[   1.1684 ] Applet version 00.01.0000
[   1.1865 ]
Board ID(3448) version(200)
copying bctfile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/BCT/P3448_A00_lpddr4_204Mhz_P987.cfg)... done.
copying bootloader(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying initrd(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/l4t_initrd.img)... done.
Making Boot image... done.
Existing sosfile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/nvtboot.bin)... done.
copying cpu_bootloader(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
copying bpffile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/sc7entry-firmware.bin)... done.
Existing badpagefile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/badpage.bin) reused.
copying wb0boot(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/warmboot.bin)... done.
Existing tosfile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/eks.img) reused.
copying dtbfile(/home/pi21/Téléchargements/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)... done.
Copying nv_boot_control.conf to rootfs
Reusing existing system.img...
done.
Existing tbcfile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/pi21/Téléchargements/Linux_for_Tegra/kernel/dtb/tegra210-p3448-0000-p3449-0000-a02.dtb)... done.
copying cfgfile(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/cfg/flash_l4t_t210_max-spi_sd_p3448.xml) to flash.xml... done.
copying flasher(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/t210ref/cboot.bin)... done.
Existing flashapp(/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/tegraflash.py) reused.
*** Updating [DTB] with kernel_tegra210-p3448-0000-p3449-0000-a02.dtb ***
./tegraflash.py --bl cboot.bin --bldtb kernel_tegra210-p3448-0000-p3449-0000-a02.dtb  --chip 0x21 --applet nvtboot_recovery.bin --bct  P3448_A00_lpddr4_204Mhz_P987.cfg  --cfg  flash.xml   --odmdata 0xa4000  --cmd "erase DTB; sign; write DTB ./signed/kernel_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
 
[   0.0028 ] Generating RCM messages
[   0.0035 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   0.0042 ] RCM 0 is saved as rcm_0.rcm
[   0.0046 ] RCM 1 is saved as rcm_1.rcm
[   0.0046 ] List of rcm files are saved in rcm_list.xml
[   0.0046 ]
[   0.0046 ] Signing RCM messages
[   0.0053 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   0.0060 ] Assuming zero filled SBK key
[   0.0101 ]
[   0.0101 ] Copying signature to RCM mesages
[   0.0108 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   0.0125 ]
[   0.0126 ] Boot Rom communication
[   0.0135 ] tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml
[   0.0142 ] BR_CID: 0x3210100164449508140000000bfe81c0
[   0.0149 ] RCM version 0X210001
[   0.0283 ] Boot Rom communication completed
[   1.0365 ]
[   1.0366 ] Parsing partition layout
[   1.0392 ] tegraparser --pt flash.xml.tmp
[   1.0426 ]
[   1.0428 ] Creating list of images to be signed
[   1.0452 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   1.0543 ]
[   1.0544 ] Generating signatures
[   1.0555 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.key
[   1.0564 ] Assuming zero filled SBK key
[   1.1054 ]
[   1.1054 ] Send BCT from Host
[   1.1054 ] Generating br-bct
[   1.1064 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   1.1072 ] Copying Sdram info from 2 to 3 set
[   1.1094 ]
[   1.1094 ] Updating boot device parameters
[   1.1101 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   1.1108 ] Warning: No sdram params
[   1.1109 ]
[   1.1110 ] Updating bl info
[   1.1116 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   1.1126 ]
[   1.1127 ] Updating secondary storage information into bct
[   1.1134 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_lpddr4_204Mhz_P987.bct
[   1.1142 ]
[   1.1142 ] Updating Odmdata
[   1.1148 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatefields Odmdata =0xa4000
[   1.1155 ] Warning: No sdram params
[   1.1157 ]
[   1.1157 ] Get Signed section of bct
[   1.1170 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   1.1179 ]
[   1.1179 ] Signing BCT
[   1.1192 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.key
[   1.1200 ] Assuming zero filled SBK key
[   1.1204 ]
[   1.1205 ] Updating BCT with signature
[   1.1212 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml
[   1.1220 ]
[   1.1220 ] Updating BFS information on BCT
[   1.1227 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatebfsinfo flash.xml.bin
[   1.1235 ]
[   1.1236 ] Sending BCTs
[   1.1242 ] tegrarcm --download bct P3448_A00_lpddr4_204Mhz_P987.bct
[   1.1248 ] Applet version 00.01.0000
[   1.1419 ] Sending bct
[   1.1419 ] [................................................] 100%
[   1.3662 ]
[   1.3664 ] Sending bootloader and pre-requisite binaries
[   1.3690 ] tegrarcm --download ebt cboot.bin 0 0 --download rp1 kernel_tegra210-p3448-0000-p3449-0000-a02.dtb 0
[   1.3713 ] Applet version 00.01.0000
[   1.3909 ] Sending ebt
[   1.3911 ] [................................................] 100%
[   1.4967 ] Sending rp1
[   1.5009 ] [................................................] 100%
[   1.5559 ]
[   1.5589 ] tegrarcm --boot recovery
[   1.5612 ] Applet version 00.01.0000
[   1.5794 ]
[   1.5796 ] Writing partition
[   1.5822 ] tegradevflash --erase DTB
[   1.5849 ] Cboot version 00.01.0000
[   2.2906 ] Erasing partition DTB ..Done
[   5.9389 ]
[   5.9422 ] tegrasign --key None --getmode mode.txt
[   5.9448 ] Assuming zero filled SBK key
[   5.9452 ]
[   5.9482 ] Generating RCM messages
[   5.9506 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   5.9530 ] RCM 0 is saved as rcm_0.rcm
[   5.9546 ] RCM 1 is saved as rcm_1.rcm
[   5.9546 ] List of rcm files are saved in rcm_list.xml
[   5.9546 ]
[   5.9546 ] Signing RCM messages
[   5.9556 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   5.9566 ] Assuming zero filled SBK key
[   5.9626 ]
[   5.9626 ] Copying signature to RCM mesages
[   5.9637 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   5.9652 ]
[   5.9652 ] Parsing partition layout
[   5.9664 ] tegraparser --pt flash.xml.tmp
[   5.9679 ]
[   5.9679 ] Creating list of images to be signed
[   5.9689 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   5.9730 ]
[   5.9731 ] Generating signatures
[   5.9742 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.key
[   5.9751 ] Assuming zero filled SBK key
[   6.0279 ]
[   6.0279 ] Generating br-bct
[   6.0287 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   6.0294 ] Copying Sdram info from 2 to 3 set
[   6.0317 ]
[   6.0317 ] Updating boot device parameters
[   6.0324 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   6.0330 ] Warning: No sdram params
[   6.0332 ]
[   6.0333 ] Updating bl info
[   6.0339 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   6.0349 ]
[   6.0350 ] Updating secondary storage information into bct
[   6.0357 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_lpddr4_204Mhz_P987.bct
[   6.0365 ]
[   6.0365 ] Updating Odmdata
[   6.0372 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatefields Odmdata =0xa4000
[   6.0378 ] Warning: No sdram params
[   6.0380 ]
[   6.0380 ] Get Signed section of bct
[   6.0388 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   6.0398 ]
[   6.0398 ] Signing BCT
[   6.0411 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.key
[   6.0418 ] Assuming zero filled SBK key
[   6.0422 ]
[   6.0423 ] Updating BCT with signature
[   6.0430 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml
[   6.0438 ]
[   6.0439 ] Copying signatures
[   6.0445 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --updatesig images_list_signed.xml
[   6.0490 ]
[   6.0490 ] Updating BFS information on BCT
[   6.0499 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatebfsinfo flash.xml.bin
[   6.0507 ]
[   6.0507 ] Copying signed file in /home/pi21/Téléchargements/Linux_for_Tegra/bootloader/signed
[   6.0544 ] Generating RCM messages
[   6.0553 ] tegrarcm --listrcm rcm_list.xml --chip 0x21 0 --download rcm nvtboot_recovery.bin 0 0
[   6.0560 ] RCM 0 is saved as rcm_0.rcm
[   6.0565 ] RCM 1 is saved as rcm_1.rcm
[   6.0565 ] List of rcm files are saved in rcm_list.xml
[   6.0565 ]
[   6.0565 ] Signing RCM messages
[   6.0573 ] tegrasign --key None --list rcm_list.xml --pubkeyhash pub_key.key
[   6.0579 ] Assuming zero filled SBK key
[   6.0622 ]
[   6.0622 ] Copying signature to RCM mesages
[   6.0629 ] tegrarcm --chip 0x21 0 --updatesig rcm_list_signed.xml
[   6.0640 ]
[   6.0641 ] Boot Rom communication
[   6.0649 ] tegrarcm --chip 0x21 0 --rcm rcm_list_signed.xml
[   6.0656 ] BootRom is not running
[   6.1082 ]
[   6.1083 ] Parsing partition layout
[   6.1096 ] tegraparser --pt flash.xml.tmp
[   6.1114 ]
[   6.1115 ] Creating list of images to be signed
[   6.1127 ] tegrahost --chip 0x21 0 --partitionlayout flash.xml.bin --list images_list.xml
[   6.1190 ]
[   6.1191 ] Generating signatures
[   6.1211 ] tegrasign --key None --list images_list.xml --pubkeyhash pub_key.key
[   6.1229 ] Assuming zero filled SBK key
[   6.1711 ]
[   6.1711 ] Send BCT from Host
[   6.1711 ] Generating br-bct
[   6.1720 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.cfg --chip 0x21 0
[   6.1727 ] Copying Sdram info from 2 to 3 set
[   6.1748 ]
[   6.1749 ] Updating boot device parameters
[   6.1755 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatedevparam flash.xml.bin
[   6.1762 ] Warning: No sdram params
[   6.1764 ]
[   6.1764 ] Updating bl info
[   6.1773 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updateblinfo flash.xml.bin --updatesig images_list_signed.xml
[   6.1787 ]
[   6.1787 ] Updating secondary storage information into bct
[   6.1795 ] tegraparser --pt flash.xml.bin --chip 0x21 0 --updatecustinfo P3448_A00_lpddr4_204Mhz_P987.bct
[   6.1807 ]
[   6.1809 ] Updating Odmdata
[   6.1818 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatefields Odmdata =0xa4000
[   6.1825 ] Warning: No sdram params
[   6.1827 ]
[   6.1828 ] Get Signed section of bct
[   6.1836 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --listbct bct_list.xml
[   6.1844 ]
[   6.1844 ] Signing BCT
[   6.1857 ] tegrasign --key None --list bct_list.xml --pubkeyhash pub_key.key
[   6.1863 ] Assuming zero filled SBK key
[   6.1869 ]
[   6.1869 ] Updating BCT with signature
[   6.1877 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatesig bct_list_signed.xml
[   6.1885 ]
[   6.1885 ] Updating BFS information on BCT
[   6.1892 ] tegrabct --bct P3448_A00_lpddr4_204Mhz_P987.bct --chip 0x21 0 --updatebfsinfo flash.xml.bin
[   6.1900 ]
[   6.1900 ] Sending BCTs
[   6.1906 ] tegrarcm --download bct P3448_A00_lpddr4_204Mhz_P987.bct
[   6.1912 ] Applet is not running on device. Continue with Bootloader
[   6.2057 ]
[   6.2057 ] Sending bootloader and pre-requisite binaries
[   6.2065 ] tegrarcm --download ebt cboot.bin 0 0 --download rp1 kernel_tegra210-p3448-0000-p3449-0000-a02.dtb 0
[   6.2072 ] Applet is not running on device. Continue with Bootloader
[   6.2375 ]
[   6.2385 ] tegrarcm --boot recovery
[   6.2393 ] Applet is not running on device. Continue with Bootloader
[   6.2701 ]
[   6.2702 ] Writing partition
[   6.2728 ] tegradevflash --write DTB /home/pi21/Téléchargements/Linux_for_Tegra/bootloader/signed/kernel_tegra210-p3448-0000-p3449-0000-a02.dtb.encrypt
[   6.2751 ] Cboot version 00.01.0000
[   6.2915 ] Writing partition DTB with /home/pi21/TTraceback (most recent call last):
  File "./tegraflash.py", line 1296, in <module>
    tegraflash_run_commands()
  File "./tegraflash.py", line 1155, in tegraflash_run_commands
    interpreter.onecmd(command)
  File "/usr/lib/python3.6/cmd.py", line 217, in onecmd
    return func(arg)
  File "./tegraflash.py", line 392, in do_write
    tegraflash_write(exports, args[0], file_path)
  File "/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 522, in tegraflash_write
    tegraflash_write_partition('tegradevflash', partition_name, filename)
  File "/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 2227, in tegraflash_write_partition
    run_command(command)
  File "/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 198, in run_command
    log = print_process(process, enable_print)
  File "/home/pi21/Téléchargements/Linux_for_Tegra/bootloader/tegraflash_internal.py", line 160, in print_process
    outputchar = output.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
Failed to flash/read t210ref.

I searched about such error message but without any success.
Is someone know the solution of this problem ?

Concerning the release used, I am under : Ubuntu 18.04, L4T 32.5.1

Thanks by advance,

Sincerelly,

Adrien.
I

Just a thought on the above…the normal install location is:
${HOME}/nvidia/nvidia_sdk/JetPack...version.../Linux_for_Tegra/
(which would then contain the “bootloader/” subdirectory)

It is possible to manually install the driver package plus sample rootfs and manually run the apply_binaries.sh script for setup such that the location is non-standard. What I am wondering is unrelated to the actual error, but did you install via JetPack/SDK Manager’s “.deb” file? Or was this installed on your host PC by alternate means? It just seems that the flash software itself is looking for the wrong location.

As a further detail, I remember that a long time ago there were some similar errors when people had a language other than “en_US” due to odd (well, odd compared to en_US even if not otherwise odd). The software was not handling the characters correctly. Perhaps (if this was a standard install without anything special) the accent marks in “Téléchargements” are confusing the software.

FYI, language and character set (really it is the character set which matters) can be viewed with “echo $LANG”. Assuming you had a “standard” install and did nothing special, then you might consider creating a second admin account on your PC which is otherwise the same, but without accent marks, e.g., create account “Telechargements” (no accent aigu). Test flashing again from the new account (make sure you have enough disk space).

Hello, I switched the host language to US (I was in french), that translated the folder “Téléchargements” to “Downloads”.
And now it is working properly, I updated the dtb !

So thank you !
Adrien