How to use GPIO PPS as out signal for agx orin/jp5.1.1

I am trying to enable GPIO pps as out signal for agx orin.
in order to verify peripheral equitment’s time sync, GPIO pps is one method.

on our developed board with agx orin, I have already done:
1、download the source code of pps-gen-gpio for GitHub - damon-kwok/pps-gen-gpio: Linux kernel PPS generator using GPIO pins;
2、modify the config file of tegra_defconfig;
3、modify the dts of tegra234-p3701-0004-p3737-0000.dts;
the gpio pin is GPIO35_PWM1;
4、during device boot, dmesg is include the error log:
Cannot get PPS GPIO [-517: 0xfffffdfb].
It’s an error to request GPIO pin.

how to debug this issue,
can you provide some attempt directions for it?

1、the config file about pps:

2、dts content:

3、dmesg log:

I add to attach some key source code:

Have you modified the pinmux spreadsheet so PH.00 is now an output pin?

there is one difference between the conf file and device sysfs.
PH.00 is configured as gpio-output-low, but the device sysfs is shown as out hi.
I don’t know why yet.

PH.00 is already configured as outpin,
It should not make this mistake of dmesg log.

1、the conf file

2、device sysfs

How did you flash the device? Maybe the device tree is not updated correctly.
Please decompile the device tree located at /boot/dtb/ and make sure the change is there.
You should also make sure PH.00 is set as Drive 0, low voltage by default, so it matches the device tree setting.

for the change to take effect, I have tried two methods, but no use.
1、replace two files of device directly
copy the new Image to /boot
copy the new dtb file tegra234-p3701-0004-p3737-0000.dtb to /boot/dtb/kernel_tegra234-p3701-0004-p3737-0000.dtb
2、flash device by sdkmanager
the flash cmd is:sudo ./ jetson-agx-orin-devkit mmcblk0p1

by decompile dts file of device, the pps-gen change is already there.
but how can check that PH.00 is set as Drive 0,I don’t know the way.

the decompile dts file of device:

Modify the pinmux spreadsheet.
Have you also tried other GPIO pins in addition to PH.00?

as a general gpio pin, PH.00 should be set drive 0.

by the way, I have already check the other gpio pin PN.01,
It is the same thing about dmesg error log.

Then is PPS client instead of generator working?

it should not be affected by pps client.
because disable the pps client conf, there is still error.

I mean turn on only client but not generator.

at first, I turned on pps client, and the device system had no /dev/pps0, pps1.
refer to the forum, pps client depend on GPS’pps input signal.

as for the same purpose, so I mainly refer this topic:
PTP synchronization and PPS output from Nvidia NX - Jetson & Embedded Systems / Jetson Xavier NX - NVIDIA Developer Forums

on this topic, It is relevant to nvpps.ko because pps is configed input in GPIO mode.
but in the default defconfig, CONFIG_NVPPS=m, nvpps.ko is not loaded for device system.

so far, I don’t know how to debug gpio pps for output signal.

另外你要改kernel config的話應該是用menuconfig的選單改,這樣才能確保不同config之間的dependency有被滿足

PTP synchronization and PPS output from Nvidia NX - Jetson & Embedded Systems / Jetson Xavier NX - NVIDIA Developer Forums


我知道defconfig 的修改,有一定的约束条件,只能简单修改。
但使用完整的make menuconfig编译出来的.config文件,压根编译不过。而且,新生成的 .config 的文件很大,达到249k bytes 大小,而默认的defconfig只有33K bytes。

那你應該先解決build kernel的問題接下來的討論才有意義

這是正常的 defconfig只會紀錄跟Kbuild裡的預設值不一樣的部份

使用了menuconfig 出来的.config,拷贝,替换到文件defconfig,还是同样的内核dmesg 错误。
初步看起来,可能是内核的GPIO 函数调用,依赖引起的。

上面說他只有在5.4 kernel上測試過 可能新的kernel哪裡有API有改所以不能用

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