Dtc compile failure on Jetpack 5.1.5

/dts-v1/;
/plugin/;
   
/ {
    compatible = "nvidia,p3768-0000+p3767-0000\0nvidia,p3767-0000\0nvidia,tegra234\0nvidia,tegra23x";

    fragment@0 {
        target-path = "/";
        __overlay__ {
            pps {
                compatible = "pps-gpio";
                gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Q, 6) GPIO_ACTIVE_HIGH>;
                status = "okay";
            };
        };
    };
};

I’m plan to use GPIO 31 to receive GNNS PPS signal.

but compile this dts failure

wpkj@ubuntu:~/test$ pwd
/home/wpkj/test
wpkj@ubuntu:~/test$ dtc -O dtb -o ppsv2.dtbo ppsv2.dts
Error: ppsv2.dts:12.43-44 syntax error
FATAL ERROR: Unable to parse input tree

Why this goes wrong, IS there any instruct I missed?

You didn’t name the input format. The “-O dtb” is an output format, the “ppsv2.dts” is input content, but lacks a way to see its format (the .dts might seem to specify that, but it is not set up to allow this). Try:
dtc -I dts -O dtb -o ppsv2.dtbo ppsv2.dts

Seems not the input format problem.

I added the -I dts but it also report syntax error.

I have two dts file as following:

wpkj@ubuntu:~/test$ cat ppsv1.dts
/dts-v1/;
/plugin/;
   
/ {
    compatible = "nvidia,p3768-0000+p3767-0000\0nvidia,p3767-0000\0nvidia,tegra234\0nvidia,tegra23x";

    fragment@0 {
        target-path = "/";
        __overlay__ {
            pps {
                compatible = "pps-gpio";
                gpios = <&tegra_main_gpio 33 1>;
                status = "okay";
            };
        };
    };
};


wpkj@ubuntu:~/test$ cat ppsv2.dts
/dts-v1/;
/plugin/;
   
/ {
    compatible = "nvidia,p3768-0000+p3767-0000\0nvidia,p3767-0000\0nvidia,tegra234\0nvidia,tegra23x";

    fragment@0 {
        target-path = "/";
        __overlay__ {
            pps {
                compatible = "pps-gpio";
                gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Q, 6) GPIO_ACTIVE_HIGH>;
                status = "okay";
            };
        };
    };
};


Only the ppsv1.dts can compile

wpkj@ubuntu:~/test$ dtc -I dts -O dtb -o ppsv1.dtbo ppsv1.dts
wpkj@ubuntu:~/test$ dtc -I dts -O dtb -o ppsv2.dtbo ppsv2.dts
Error: ppsv2.dts:12.43-44 syntax error
FATAL ERROR: Unable to parse input tree
wpkj@ubuntu:~/test$ ls -l *.dtbo
-rw-rw-r-- 1 wpkj wpkj 420 9月  15 20:57 ppsv1.dtbo
wpkj@ubuntu:~/test$ pwd
/home/wpkj/test
wpkj@ubuntu:~/test$ cat /etc/nv_tegra_release 
# R35 (release), REVISION: 6.1, GCID: 39721438, BOARD: t186ref, EABI: aarch64, DATE: Tue Mar  4 10:13:09 UTC 2025
wpkj@ubuntu:~/test$

So, what I exactly missed? Placed the dts at wrong place ?

Im using Jetson Orin nx 16GB mode(CLB develop kit Carrier Board), with Jetpack 5.1.5 enviorment.

A question needs to be confirmed first: You’ve shown snippets of device tree code. Those snippets are set up in what looks like the C-compatible kernel code. If building kernel code, then the kernel first assembles fragments and removes the C-compatibility before it truly becomes device tree source. Are you using this on actual device tree source, or is this C-escaped kernel snippets? If this is actually source, then you could rename “ppsv2.dts” to “ppsv2.txt” and upload it to the thread, and someone else could then try to compile it into binary. If this is actually kernel escaped, then there is no need to upload since the procedure for kernel escaped requires the kernel to build this.

Don’t know what it exactly is. Im newbie for device tree code.

I’m following the Enabling PPS on Nvidia Jetson Orin Nano Dev Board paper to do this, and skipped step 3 Enable Required Kernel Modules. (Don’t know what exactly mean)

I just need to enable pps time synchronization by my GNNS modlue’s output pps pulse. And use Orin nx 16GB dev board, with Jetpack 5.1.5 installed. Do I need to recompile linux kernel?

If I need, Is there any tutorials for doing this?

The only difference in my 2 dts code is ppsv2.dts used macro defined PIN

gpios = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Q, 6) GPIO_ACTIVE_HIGH>;

while ppsv1.dts used digital PIN

gpios = <&tegra_main_gpio 33 1>;

and the macro PIN can’t compile to dtbo.

So, I guess Does I need to put ppsv2.dts under special direcotry? Or, specialfy Include directory for this macro?

On other hand, If I know what exactrly gpio number on board PIN 31 is, I can skip to use TEGRA234_MAIN_GPIO macro. I have tried gpio454 which /sys/kernel/debug/gpio told me

$ sudo cat /sys/kernel/debug/gpio | grep -i 'PQ.06\|GP66\|GPIO11' || true [sudo] password for wpkj: gpio-454 (PQ.06 )

But It don’t work(Added a FDT node in /boot/extlinux/extlinux.conf point to compiled dtbo),Orin nx can’t boot anymore, and I need to reburn jetpack with nvidia SDK.