When using the flash script to flash the device tree in Jetson Linux version 32.6.1, I receive the following error:

sudo ./flash.sh -r -k jetson-xavier-nx-devkit mmcblk0p1

Hi,

You cannot use only -r -k, and you also have to specify the partition name you want to flash.
For example, -r -k APP, -r -k kernel-dtb.

Indeed, I missed the kernel-dtb option, but even after adding it, the same error still occurs, indicating that the file cannot be found.

Then would it succeed without those options and just sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1?

sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1



After executing ‘sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1’, I encountered the aforementioned error. However, upon running ‘sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit mmcblk0p1’, the file not found error no longer appears. Can this new prompt be ignored, and considered as the successful flashing of the device tree?

So your Linux_for_Tegra/rootfs is empty?
Did you extract the sample rootfs package into the folder?

After extracting the root file system to the rootfs directory, when I run sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1, it shows the following error message:

Hi,

Are you using the SD card module or the eMMC module?
If it’s the SD card module, then maybe try swapping for a new SD card.
If it’s the eMMC module, then you need to use jetson-xavier-nx-devkit-emmc for flashing.

Either way, please also attach the serial console log during flash, and don’t put any log as screen shots; put them as text files instead.

I’m using an eMMC module, and after flashing with jetson-xavier-nx-devkit-emmc, both the system and device tree were successfully flashed.
There is one more question.
Can I directly update the device tree by replacing the DTB file in the /boot directory without using the flash.sh script?

YES, and if the kernel dtb specified by the FDT entry in extlinux.conf fails, bootloader will fall back to read it from the dedicated kernel-dtb partition.

Okay, I understand. Thank you.

I have encountered a new problem. After making changes to the device tree and compiling, the device tree file doesn’t update, regardless of using sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit-emmc mmcblk0p1 or copying the tegra194-p3668-all-p3509-0000.dtb to the /boot directory. I am confirming this by checking the compilation date of the device tree through dmesg | grep DTB.
When using the flash.sh script to flash the device tree, it shows a prompt indicating a successful flashing.

  20.6505 ] tegrahost_v2 --chip 0x19 --generateblob blob.xml blob.bin
[  20.6527 ] number of images in blob are 11
[  20.6533 ] blobsize is 5900552
[  20.6535 ] Added binary blob_nvtboot_recovery_cpu_t194_sigheader.bin.encrypt of size 263840
[  20.6586 ] Added binary blob_nvtboot_recovery_t194_sigheader.bin.encrypt of size 181152
[  20.6590 ] Added binary blob_preboot_c10_prod_cr_sigheader.bin.encrypt of size 24016
[  20.6593 ] Added binary blob_mce_c10_prod_cr_sigheader.bin.encrypt of size 143200
[  20.6598 ] Added binary blob_mts_c10_prod_cr_sigheader.bin.encrypt of size 3430416
[  20.6647 ] Added binary blob_bpmp_t194_sigheader.bin.encrypt of size 856352
[  20.6683 ] Added binary blob_tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt of size 281984
[  20.6687 ] Added binary blob_spe_t194_sigheader.bin.encrypt of size 94960
[  20.6690 ] Added binary blob_tos-trusty_t194_sigheader.img.encrypt of size 410560
[  20.6693 ] Added binary blob_eks_sigheader.img.encrypt of size 5136
[  20.6696 ] Added binary blob_tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt of size 208752
[  20.6780 ] 
[  20.6781 ] Sending bootloader and pre-requisite binaries
[  20.6793 ] tegrarcm_v2 --download blob blob.bin
[  20.6800 ] Applet is not running on device. Continue with Bootloader
[  20.9391 ] 
[  20.9424 ] tegrarcm_v2 --boot recovery
[  20.9432 ] Applet is not running on device. Continue with Bootloader
[  21.0737 ] 
[  22.0832 ] tegrarcm_v2 --isapplet
[  22.2183 ] 
[  22.2257 ] tegrarcm_v2 --ismb2
[  22.4932 ] 
[  22.5010 ] tegradevflash_v2 --iscpubl
[  22.5069 ] Bootloader version 01.00.0000
[  22.6636 ] Bootloader version 01.00.0000
[  22.7185 ] 
[  22.7186 ] Writing partition
[  22.7247 ] tegradevflash_v2 --write kernel-dtb 1_kernel_tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
[  22.7283 ] Bootloader version 01.00.0000
[  22.8598 ] Writing partition kernel-dtb with 1_kernel_tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
[  22.8607 ] [................................................] 100%
[  22.9500 ] 
[  22.9501 ] Coldbooting the device
[  22.9530 ] tegrarcm_v2 --ismb2
[  23.0860 ] 
[  23.0926 ] tegradevflash_v2 --reboot coldboot
[  23.0969 ] Bootloader version 01.00.0000
[  23.2727 ] 
*** The [kernel-dtb] has been updated successfully. ***

Hi,

Sorry for not making it clear.
For flashing the kernel-dtb partition, it’s expected that it won’t take effect because dtb in rootfs takes precedence over the dedicated partition.
For directly replacing the file, it should be done in /boot/dtb/ instead of /boot/.

After using sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1 to flash the device, the /boot/extlinux/extlinux.conf file doesn’t contain the FDT line. I manually added it, but after restarting and using dmesg | grep DTB to check the device tree compilation date, it still shows the old version’s date.

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      FDT /boot/dtb/tegra194-p3668-all-p3509-0000.dtb
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0
nx@nvidia:/boot/dtb$ ls
kernel_tegra194-p3668-all-p3509-0000.dtb  kernel_tegra194-p3668-all-p3509-0000.dtb.sig  tegra194-p3668-all-p3509-0000.dtb
nx@nvidia:/boot/dtb$

What modification did you make to the device tree?
Did you disassemble it back to dts and assemble to dtb again?
Would it take effect if you manually replace it in the BSP folder before flashing?

I added a camera driver following a tutorial by directly adding and modifying the DTS file, then compiling it using make ARCH=arm64 O=$TEGRA_KERNEL_OUT dtbs. I haven’t tried replacing the DTB file before flashing yet. I’ll give it a try now.

Here, the BSP folder refers to which path?

I mean Linux_for_Tegra/kernel/dtb on your host.

I followed your instructions and copied the compiled DTB to the Linux_for_Tegra/kernel/dtb directory. After running sudo ./flash.sh jetson-xavier-nx-devkit-emmc mmcblk0p1 for rewriting, the compilation date of the device tree still shows the old version’s date upon checking.

Is the flashing config file pointing to the kernel dtb you just make?
What do you get with sudo dmesg | grep dts?