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

Hi,
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?

PS:
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 flash.sh
the flash cmd is:sudo ./flash.sh 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.

PS:
the decompile dts file of device:

Modify the pinmux spreadsheet.
https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html#pinmux-changes
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有被滿足
你直接改defconfig,很有可能你以為某個選項開起來了、但是實際上它的dependency還是關著的,所以build完kernel發現根本沒生效

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

就是在这个帖子中,说是与nvpps.ko有关。
但现在,nvpps.ko默认没有加载,内核符号中也找不到相关的驱动符号。

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

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

這是正常的 defconfig只會紀錄跟Kbuild裡的預設值不一樣的部份
.config就是把defconfig跟Kbuild裡的值在確認滿足相依關係之後組合起來
你的kernel會build不過也不會是因為.config的檔案大小

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

你要不要問一下這個repo的作者
上面說他只有在5.4 kernel上測試過 可能新的kernel哪裡有API有改所以不能用

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