Flash custom DTB onto NVME

Dear Community,

How to flash the custom device-tree (.dtsi included in the board’s dts) onto NVME, please ? Is there an example for Orin Nano similar to the following solution for Xavier NX : Flash DTB only on Xavier NX with NVME boot (Jetpack 5.0.2) - #4 by kayccc ?

Thanks in advance,
Khang

Hi again,

To update, I followed the instructions here for the compilation of custom BSP (which is only the device-tree in my case) and here for the flashing.

My modification :

  1. I added <kernel_src>/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-vps.dtsi :

/ {

    pps {
            gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(AC, 6) GPIO_ACTIVE_HIGH>;

            compatible = "pps-gpio";
            status = "okay";
    };

};

  1. Included the above .dtsi in <kernel_src>/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi
git diff hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi
diff --git a/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi b/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi
index 95d737541..39cd731b3 100644
--- a/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi
+++ b/hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3768-0000-a0.dtsi
@@ -18,6 +18,7 @@
 #include "tegra234-p3768-audio.dtsi"
 #include "tegra234-p3768-camera-rbpcv3-imx477.dtsi"
 #include "tegra234-p3768-camera-rbpcv2-imx219.dtsi"
+#include "tegra234-p3768-vps.dtsi"
 
 / {
        gpio-keys {

which is in turn included in <kernel_src>/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-0000-p3768-0000-a0.dts

24:#include "cvb/tegra234-p3768-0000-a0.dtsi"

And eventually tegra234-p3767-0000-p3768-0000-a0.dts is included in the following Orin Development Kit’s device-trees :

<kernel_src>/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-0001-p3768-0000-a0.dts
18:#include "tegra234-p3767-0000-p3768-0000-a0.dts"

<kernel_src>/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-0004-p3768-0000-a0.dts
18:#include "tegra234-p3767-0000-p3768-0000-a0.dts"

<kernel_src>/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-0003-p3768-0000-a0.dts
18:#include "tegra234-p3767-0000-p3768-0000-a0.dts"
  1. Verify the <kernel_src>/kernel/kernel-5.10/arch/arm64/configs/tegra_defconfig, which is a symbolic link to <kernel_src>/kernel/kernel-5.10/arch/arm64/configs/defconfig :
CONFIG_PPS_DEBUG=y
CONFIG_PPS_CLIENT_GPIO=y

After re-compiling and flashing into the NVME on the board, I would expect some registration of the assigned GPIO for the PPS, even with the failure like below :

[    1.513054] pps_core: LinuxPPS API ver. 1 registered
[    1.518017] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    4.404332] pps-gpio pps: failed to request PPS GPIO
[    4.409427] pps-gpio: probe of pps failed with error -22

But what I observed was only the first 2 lines :

[    1.513054] pps_core: LinuxPPS API ver. 1 registered
[    1.518017] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

as in the default Jetpack(-5.1.2) release, and no /dev/pps-* device found.

I wonder if my modification was not taken into account or the modified dtb was not flashed. In the other hand, my Orin Nano 8GB Devkit is recognized as P3767-0005 module on the P3768-000 carrier board, which does not match any of above tegra234-p3767-000*-p3768-0000-a0.dts.

Could this be a problem ?

Best Regards,
Khang

If you want to check whether your dtb is in use or not, you can grep dts in your dmesg.

You don’t need to guess thing by reading some screenshot or board name. Just check your dmesg first.

1 Like

Hi @WayneWWW,

Thanks for your advice, I was able to get the following info from dmesg :

[ 0.002572] DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-5.10/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t23x/p3768/kernel-dts/tegra234-p3767-0003-p3768-0000-a0.dts

Thus, the above tegra234-p3767-0003-p3768-0000-a0.dts should have included my modification, but unfortunately it was not the case. There must be something missing during the compilation or flashing.

Best Regards,
Khang

Where did you put your new dtb after you built it out?

Hi @WayneWWW,

It is in the following location :

/backup/Nvidia/SDK/Images/JetPack_5.1.2_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/sources/kernel_out/arch/arm64/boot/dts/nvidia/tegra234-p3767-0003-p3768-0000-a0.dtb

Knowing that /backup/Nvidia/SDK/Images/JetPack_5.1.2_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/ was initially generated by the SDKManager during the flashing of default Jetpack image, then the sources/kernel_out folder in created by following the instruction of Ridgerun.

Best Regards,
Khang

Hi,

Actually, no application cares about your path /backup/Nvidia/SDK/Images/JetPack_5.1.2_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra/sources/kernel_out/arch/arm64/boot/dts/nvidia/tegra234-p3767-0003-p3768-0000-a0.dtb.

sources/kernel_out is just a directory that created by you.

Sdkmanager reads the dtb from Linux_for_Tegra/kernel/dtb.

Hi @WayneWWW,

Sdkmanager reads the dtb from Linux_for_Tegra/kernel/dtb.

Does it mean that I would need to manually copy /Linux_for_Tegra/sources/kernel_out/arch/arm64/boot/dts/nvidia/tegra234-p3767-0003-p3768-0000-a0.dtb to /Linux_for_Tegra/kernel/dtb to override the original one?

How about the dtb with the same name found in /Linux_for_Tegra/rootfs/boot/?

Best Regards,
Khang

Does it mean that I would need to manually copy /Linux_for_Tegra/sources/kernel_out/arch/arm64/boot/dts/nvidia/tegra234-p3767-0003-p3768-0000-a0.dtb to /Linux_for_Tegra/kernel/dtb to override the original one?

Yes, you could build a device tree in any place but sdkmaanger won’t take it until you put it in the right location.

How about the dtb with the same name found in /Linux_for_Tegra/rootfs/boot/?

It would be replaced during the flash process.

Hi @WayneWWW,

Thanks for confirmation. It works now. The problem was that I ran the below commands after overriding the original device-tree with the modified one :

cp /Linux_for_Tegra/sources/kernel_out/arch/arm64/boot/dts/nvidia/tegra234-p3767-0003-p3768-0000-a0.dtb Linux_for_Tegra/kernel/dtb

sudo ./tools/l4t_flash_prerequisites.sh
sudo ./apply_binaries.sh

The correct order should be :

sudo ./tools/l4t_flash_prerequisites.sh
sudo ./apply_binaries.sh

cp /Linux_for_Tegra/sources/kernel_out/arch/arm64/boot/dts/nvidia/tegra234-p3767-0003-p3768-0000-a0.dtb Linux_for_Tegra/kernel/dtb

Best Regards,
Khang

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