检测pwm的时间戳

请问我有一个场景需要使用jp6.2.3的hte或者tsc功能去检测pwm的一个上升沿的时间戳

这个是pinmux中有关AA0引脚的设计,将AA0设计为输入模式

        can0_dout_paa0 {

            nvidia,pins = "can0_dout_paa0";

            nvidia,function = "rsvd1";

            nvidia,pull = <TEGRA_PIN_PULL_UP>;

            nvidia,tristate = <TEGRA_PIN_ENABLE>;

            nvidia,enable-input = <TEGRA_PIN_ENABLE>;

        };

这个是gpio相关的将AA0设计为输入模式

gpio_aon_default: default {

        gpio-input = <

            TEGRA234_AON_GPIO(EE, 5)

            TEGRA234_AON_GPIO(EE, 6)

            TEGRA234_AON_GPIO(EE, 4)

            TEGRA234_AON_GPIO(CC, 0)

            TEGRA234_AON_GPIO(CC, 1)

            TEGRA234_AON_GPIO(CC, 2)

            TEGRA234_AON_GPIO(CC, 3)

            TEGRA234_AON_GPIO(BB, 0)

            TEGRA234_AON_GPIO(BB, 1)

            TEGRA234_AON_GPIO(AA, 0)

            >;

在tegra234-p3737-0000+p3701-xxxx-nv-common.dtsi的设备树中将can功能暂时关闭并且增加 tegra_hte_test节点

    mttcan@c310000 {

        status = "disabled";

    };



    mttcan@c320000 {

        status = "disabled";

    };

    tegra_hte_test {

        status = "okay";

        compatible = "nvidia,tegra194-hte-test";

        in-ggpios = <&gpio_aon TEGRA234_AON_GPIO(AA,0) GPIO_ACTIVE_LOW>;

        timestamps = <&hte_aon TEGRA234_AON_GPIO(AA,0)>;

        timestamp-names = "hte-gpio";

    };      

请问我这样将pwm的输出引脚和PAA0进行跳线连接的话能否使用hte检测到pwm的上升沿时间戳

*** Please note that this reply is generated by LLM automatically ***

The provided information appears to be related to the Jetson AGX Orin series, specifically the pinmux configuration for the jp623htetscpwm pin.

The Jetson AGX Orin series is a high-performance embedded system-on-module (SOM) developed by NVIDIA. It is designed for various applications, including robotics, autonomous vehicles, and edge AI.

The pinmux configuration is used to define the functionality of each pin on the SOM. In this case, the jp623htetscpwm pin is configured as a PWM (Pulse Width Modulation) output.

Here’s a breakdown of the provided configuration:

  • jp623htetscpwm: This is the pin name.
  • pinmuxAA0AA0: This is the pinmux configuration for the pin. The AA0AA0 value indicates that the pin is configured as a PWM output.
  • gpioAA0: This is the GPIO (General Purpose Input/Output) configuration for the pin. The AA0 value indicates that the pin is configured as a GPIO output.
  • gpioaondefault: This is the default GPIO configuration for the pin. The default value indicates that the pin is configured to its default state.
  • default tegra234p37370000p3701xxxxnvcommondtsican tegrahtetest pwmPAA0htepwm: This is the default configuration for the PWM output.

In comparison to other Jetson modules, the Jetson AGX Orin series has a similar pinmux configuration. However, the specific pin names and configurations may vary depending on the module.

For example, the Jetson Xavier NX series has a similar pinmux configuration, but with different pin names and configurations. The Jetson Xavier NX series uses a different SOM, the Tegra X1, which has a different pin layout and configuration.

In summary, the provided configuration is specific to the Jetson AGX Orin series and defines the functionality of the jp623htetscpwm pin as a PWM output. The configuration is similar to other Jetson modules, but with different pin names and configurations.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

另外这个pwm是作为相机的触发引脚使用的

请问有人能给我一个答复吗?非常感谢

请问有没有人能够给我一些建议,非常感谢

Is it the same topic as 时间戳引擎 - Jetson Systems / Jetson AGX Orin - NVIDIA Developer Forums?
If so, let us just discuss there, thanks.

是的,这些是我新做的一些更改,希望你们能给一些建议或者指出一些问题,非常感谢

image我在检测时间戳的时候发现仅有这一个有关hte的日志,请问我是那里出现错误了吗?

It seems the expected message to me.
Could you share the full dmesg for further check?

我们做了一些底板的更改,AON里面删除了PAA0,当我将这个PAA0添加进去的时候,使用这个引脚似乎对其他的功能会造成影响 因此我准备将PAA0更改为PEE5但是pinmux里面的内容跟PAA0的有些差别请问我这样更改可以吗?

        soc_gpio26_pee5 {

            nvidia,pins = "soc_gpio26_pee5";

            nvidia,function = "rsvd1";

            nvidia,pull = <TEGRA_PIN_PULL_UP>;

            nvidia,tristate = <TEGRA_PIN_ENABLE>;

            nvidia,enable-input = <TEGRA_PIN_ENABLE>;

            nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;

            nvidia,lpdr = <TEGRA_PIN_DISABLE>;

        };

Okay, it should be fine to use PEE.05 instead as it is also from AON controller.

我这个pinmux的修改内容有问题吗?我看他比PAA0多了

        nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;

        nvidia,lpdr = <TEGRA_PIN_DISABLE>;

这两部分功能,我应该删除它?或许做什么更改呢

你好,我目前能看到时间戳了,但是我有一个疑问,我是把pwm和我的PEE05使用飞线连接在一起,为什么当我把他断开的时候时间戳依然能捕捉时间呢

或许我的方向一开始就是错的?我们的使用场景是希望能够使用硬件时间戳捕捉相机的触发时间戳

Have you tried using CAM_FRSYNC1(i.e. TSC_EDGE_OUT0) instead for this use case?

没有,请问有相关的教程可以告诉我怎么去使用吗?

hello,请问有tsc相关的文档参考吗?比如设备树的节点和gpio以及pinmux的选择,或者驱动代码相关的内容

Could you create another topic to discuss about the use case for Camera?
This topic is specific to get the HW timestamp for PWM.

好的,我已经实现了能够捕捉pwm的时间戳了,但是我计算会有几微妙到几十微妙的误差这是正常的现象吗?并且我发现似乎只能通过dmesg去检测这个时间戳,这样的话会对我的日志造成很多的资源浪费,有没有案例能够使用用户空间去查看这个时间戳呢

Since you’re already using HW timestamps, a few–tens of microseconds spread usually comes from the capture timer resolution and how it’s synchronized to the PWM (plus input signal quality), not from Linux scheduling. Check the HW timer frequency and convert your error to “number of ticks” – if the jitter is only a few ticks, that’s generally expected. For user-space access, avoid using printk/dmesg; instead expose the HW timestamps via a small char device (or sysfs/debugfs entry) and read/poll them from user space.