How to Update customized DTBs Directly in the Jetson Orin Nano Dev. Kit

Hi there,

This is a follow-up question about updating out-of-tree modules.

When building the DTBs, we copy the compiled DTBs into Linux_for_Tegra/kernel/dtb/ to prepare for flashing.

cp kernel-devicetree/generic-dts/dtbs/* <install-path>/Linux_for_Tegra/kernel/dtb/

I then examined the Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs directory, and its contents are shown below:

tegra234-audio-overlay.dtbo                                          tegra234-p3737-camera-e3331-overlay.dtbo                            tegra234-p3767-0000+p3509-a02-m2ke.dtbo
tegra234-carveouts.dtbo                                              tegra234-p3737-camera-e3333-overlay.dtbo                            tegra234-p3767-0000+p3768-0000-csi.dtbo
tegra234-dcb-p3767-0000-hdmi.dtbo                                    tegra234-p3737-camera-eCAM130A-overlay.dtbo                         tegra234-p3767-camera-p3768-imx219-A.dtbo
tegra234-p3737-0000+p3701-0000-as-p3701-0004.dtbo                    tegra234-p3737-camera-imx185-overlay.dtbo                           tegra234-p3767-camera-p3768-imx219-C.dtbo
tegra234-p3737-0000+p3701-0000-as-p3767-0000.dtbo                    tegra234-p3737-camera-imx390-addr-0x21-overlay.dtbo                 tegra234-p3767-camera-p3768-imx219-dual.dtbo
tegra234-p3737-0000+p3701-0000-as-p3767-0001.dtbo                    tegra234-p3737-camera-imx390-overlay.dtbo                           tegra234-p3767-camera-p3768-imx219-imx477.dtbo
tegra234-p3737-0000+p3701-0000-as-p3767-0003.dtbo                    tegra234-p3737-camera-p3762-a00-1Hawk-overlay.dtbo                  tegra234-p3767-camera-p3768-imx477-A.dtbo
tegra234-p3737-0000+p3701-0000-as-p3767-0004.dtbo                    tegra234-p3737-camera-p3762-a00-2Hawk-overlay.dtbo                  tegra234-p3767-camera-p3768-imx477-C.dtbo
tegra234-p3737-0000+p3701-0000-audio-adafruit-sph0645lm4h.dtbo       tegra234-p3737-camera-p3762-a00-3Hawk-3Owl-overlay.dtbo             tegra234-p3767-camera-p3768-imx477-dual-4lane.dtbo
tegra234-p3737-0000+p3701-0000-audio-adafruit-uda1334a.dtbo          tegra234-p3737-camera-p3762-a00-4Hawk-overlay.dtbo                  tegra234-p3767-camera-p3768-imx477-dual.dtbo
tegra234-p3737-0000+p3701-0000-audio-fe-pi.dtbo                      tegra234-p3737-camera-p3762-a00-4Owl-overlay.dtbo                   tegra234-p3767-camera-p3768-imx477-imx219.dtbo
tegra234-p3737-0000+p3701-0000-audio-respeaker-4-mic-array.dtbo      tegra234-p3737-camera-p3762-a00-overlay.dtbo                        tegra234-p3768-0000+p3767-0000.dtb
tegra234-p3737-0000+p3701-0000-audio-respeaker-4-mic-lin-array.dtbo  tegra234-p3740-0002-p3701-0008-csi.dtbo                             tegra234-p3768-0000+p3767-0000-dynamic.dtbo
tegra234-p3737-0000+p3701-0000-csi.dtbo                              tegra234-p3740-0002+p3701-0008.dtb                                  tegra234-p3768-0000+p3767-0000-nv.dtb
tegra234-p3737-0000+p3701-0000.dtb                                   tegra234-p3740-0002+p3701-0008-hdr20.dtbo                           tegra234-p3768-0000+p3767-0000-nv-px1.dtb
tegra234-p3737-0000+p3701-0000-dynamic.dtbo                          tegra234-p3740-0002+p3701-0008-m2kb.dtbo                            tegra234-p3768-0000+p3767-0000-nv-taylor-high.dtb
tegra234-p3737-0000+p3701-0000-hdr40.dtbo                            tegra234-p3740-0002+p3701-0008-m2ke.dtbo                            tegra234-p3768-0000+p3767-0000-nv-taylor-low.dtb
tegra234-p3737-0000+p3701-0000-m2ke.dtbo                             tegra234-p3740-0002+p3701-0008-nv.dtb                               tegra234-p3768-0000+p3767-0001.dtb
tegra234-p3737-0000+p3701-0000-nv.dtb                                tegra234-p3740-0002+p3701-0008-nv-safety.dtb                        tegra234-p3768-0000+p3767-0001-nv.dtb
tegra234-p3737-0000+p3701-0004.dtb                                   tegra234-p3740-camera-p3783-a00-overlay.dtbo                        tegra234-p3768-0000+p3767-0003.dtb
tegra234-p3737-0000+p3701-0004-nv.dtb                                tegra234-p3767-0000+p3509-a02-audio-adafruit-sph0645lm4h.dtbo       tegra234-p3768-0000+p3767-0003-nv.dtb
tegra234-p3737-0000+p3701-0005.dtb                                   tegra234-p3767-0000+p3509-a02-audio-adafruit-uda1334a.dtbo          tegra234-p3768-0000+p3767-0004.dtb
tegra234-p3737-0000+p3701-0005-nv.dtb                                tegra234-p3767-0000+p3509-a02-audio-fe-pi.dtbo                      tegra234-p3768-0000+p3767-0004-nv.dtb
tegra234-p3737-0000+p3701-0008.dtb                                   tegra234-p3767-0000+p3509-a02-audio-respeaker-4-mic-array.dtbo      tegra234-p3768-0000+p3767-0005.dtb
tegra234-p3737-0000+p3701-0008-nv.dtb                                tegra234-p3767-0000+p3509-a02-audio-respeaker-4-mic-lin-array.dtbo  tegra234-p3768-0000+p3767-0005-nv.dtb
tegra234-p3737-camera-dual-hawk-ar0234-e3653-overlay.dtbo            tegra234-p3767-0000+p3509-a02-csi.dtbo                              tegra-optee.dtbo
tegra234-p3737-camera-dual-imx274-overlay.dtbo                       tegra234-p3767-0000+p3509-a02-hdr40.dtbo

Next, I compared the contents of Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs with Linux_for_Tegra/kernel/dtb and /boot. Here are the results:

❯ diff -rq Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs Linux_for_Tegra/kernel/dtb

Only in Linux_for_Tegra/kernel/dtb: AcpiBoot.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderEmmc.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderHttp.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderNvme.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderPxe.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderSata.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderSD.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderUfs.dtbo
Only in Linux_for_Tegra/kernel/dtb: BootOrderUsb.dtbo
Only in Linux_for_Tegra/kernel/dtb: L4TConfiguration.dtbo
Only in Linux_for_Tegra/kernel/dtb: LICENSE.kernel
Only in Linux_for_Tegra/kernel/dtb: NOTICE.uefi
❯ diff -rq Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs /boot

Only in /boot: dtb
Only in /boot: efi
Only in /boot: extlinux
Only in /boot: Image
Only in /boot: initrd
Only in /boot: initrd.img
Only in /boot: initrd.img-5.15.148-tegra
Only in /boot: kernel_tegra234-p3768-0000+p3767-0005-nv.dtb
Only in /boot: oot-stub
Only in Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs: tegra234-audio-overlay.dtbo
Only in Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs: tegra234-dcb-p3767-0000-hdmi.dtbo
Only in Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs: tegra234-p3740-0002-p3701-0008-csi.dtbo
Only in Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs: tegra234-p3740-0002+p3701-0008-nv-safety.dtb
Only in Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs: tegra234-p3768-0000+p3767-0000-nv-px1.dtb
Only in Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs: tegra234-p3768-0000+p3767-0000-nv-taylor-high.dtb
Only in Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs: tegra234-p3768-0000+p3767-0000-nv-taylor-low.dtb

Is it correct to copy the entire Linux_for_Tegra/source/kernel-devicetree/generic-dts/dtbs to /boot on the Jetson Orin Nano directly, and then reboot the device?

Thanks in advance!

Hi otischung0321,

No, please just refer to the steps in Kernel Customization — NVIDIA Jetson Linux Developer Guide 1 documentation to run cp commmand to copy dtb under kernel-devicetree/generic-dts/dtbs/ to Linux_for_Tegra/kernel/dtb/.

The dtb in use is depending on the board config. (you can check the board config or flash log to know what’s the final dtb loaded for your board). It may load lots of dtbs and combine to one dtb (dtbfile).

The DTB may also not be loaded from the /boot. You can refer to DTB Support for details.
As a result, you can not just copy them from your BSP package to the board directly.
Please refer to the developer guide to copy the generated dtb to correct path and reflash the board to apply the change.

Hi KevinFFF,

First, I really appreciate your quick reply.

Now, I’d like to summarize the details of kernel customization with a focus on updating the customized kernel, out-of-tree modules, and DTBs directly on the Jetson Orin Nano Dev. Kit, without relying on flashing from the host OS.

  1. Building and updating the Jetson Linux Kernel: According to WayneWWW in this post, we can simply copy the kernel image to the /boot directory.
    export INSTALL_MOD_PATH=/
    cd Linux_for_Tegra/source
    ./generic_rt_build.sh "disable"
    make -C kernel
    sudo -E make install -C kernel
    cp kernel/kernel-jammy-src/arch/arm64/boot/Image ../kernel/Image
    sudo cp kernel/kernel-jammy-src/arch/arm64/boot/Image /boot/Image
    sudo chmod 755 /boot/Image
    sudo chown root:root /boot/Image
    
  2. Building and updating the NVIDIA Out-of-Tree Modules: By setting INSTALL_MOD_PATH=/, we can install the modules directly into the Jetson root filesystem, rather than into rootfs. This is also my previous attempt in this post.
    export INSTALL_MOD_PATH=/
    export KERNEL_HEADERS=Linux_for_Tegra/source/kernel/kernel-jammy-src
    make modules
    sudo -E make modules_install
    sudo nv-update-initrd
    
  3. Building and flashing the DTBs: The only step that requires flashing from the host OS is for the DTBs. The detailed process has been provided by WayneWWW in this post.
    # In Host OS
    sudo ./flash.sh -r -k kernel-dtb jetson-orin-nano-devkit mmcblk0p1
    

I’m wondering if this summary is correct. Thanks!

Most of your concepts look good to me, but I want to mention something as following in case you missed them.

  1. please refer to DTB Support for the flow about how do we load kernel image and dtb.

We’ve enabled redundant bootloader/kernel by default so that it should be A_kernel, B_kernel, A_kernel-dtb, B_kernel-dtb rather than kernel-dtb. You can find more details from the partition layout file.

Hi KevinFFF,

Thank you for your reply. I believe that after understanding the Device Tree Blob (DTB) selection order, the partition configuration files, and UEFI secure boot, I’ll gain a comprehensive understanding of the system architecture of Jetson devices.

For now, I need to focus on another project, but I’ll add this reading to my to-do list. I truly appreciate your help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.