Context and references at the end of this post.
SUMMARY
I have the impression that the PPS out is not acting as expected. I would expect the PPS to be continuously synchronized with the system PHC. It should be a representation of how that specific clock in the system is experiencing time.
What I am observing in my setup is that the PPS out syncrhonizes to the PHC on startup, but then they operate independently, which is not ideal. Let me try to make this clearer by sharing the set of experiments I have run to reach this conclussion.
TEST SETUP
Let's start by describing the test setup:
I have a PC with an Intel i210 NIC acting as a PTP automotive master using linuxptp. The PC is outputing it's PPS out.
I have a SK-AM62 E3A board that is running for some of the tests the same linuxptp version the PC is, and is outputing it's PPS out.
PC acting as PTP master is connected to the EVK using the Intel i210 port on the PC and the eth1 port on the EVK.
I have a oscilloscope measuring both PPS out signals.
EXPERIMENT DESCRIPTION
These are the steps I have followed to conclude that the PPS out is not behaving as expected.
Boot the PC, and start linuxptp ptp4l with the automotive profile on the Intel i210 nic and use perpps userspace tool to activate the PPS out of the PC.
Power up the EVK and activate the PPS out, without trying to synchronize the EVK and the PC. Here's what that looked like in this instance of the experiment:
At this point, I start linuxptp ptp4l using the automotive slave profile, and the EVK is supposedly synchronized with the PC, but the PPS out of the EVK looks like this:
Then, I run the following commands to restart the PPS out on the EVK:
am62xx-evm:~# echo 0 > /sys/class/ptp/ptp0/pps_enable ; echo 1 > /sys/class/ptp/ptp0/pps_enable
After that, the PPS looks like I would be expecting it to look like:
Then, I stop the linuxptp ptp4l process on the EVK, and I manipulate the PHC manually:
am62xx-evm:~# phc_ctl eth1 get ; phc_ctl eth1 get ; phc_ctl eth1 set 1665913407.0 ; phc_ctl eth1 get phc_ctl[367.116]: clock time is 1665913411.422366340 or Sun Oct 16 09:43:31 2022 phc_ctl[367.122]: clock time is 1665913411.428201498 or Sun Oct 16 09:43:31 2022 phc_ctl[367.135]: set clock time to 1665913407.000000000 or Sun Oct 16 09:43:27 2022 phc_ctl[367.141]: clock time is 1665913407.005912040 or Sun Oct 16 09:43:27 2022
I would expect the PPS out to be upset by this clock manipulation, but this is what I was seeing in the oscilloscope:
If I repeat the command I used before to reset the PPS, then everything starts to look as I was expecting it to look like:
OBJECTIVE OF THIS THREAD
Can someone review my test? Am I doing something wrong? Is there something wrong with the implementation of the PPS out? How can we fix this?
CONTEXT AND REFERENCES
This thread is linked with these two specific threads, as well as any other thread related to the PHC of the system, ptp or the PPS out:
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1241766/sk-am62-how-to-find-ptp-pps-pin-on-the-evk
The behavior I'm describing has been observed on a SK-AM62 E3A board running a custom built linux-distro using Yocto meta-ti layers and ti kernel, with a modified device-tree to get the PPS out the way I need it in my specific use case.
Specific software references:
- meta-ti:
- repo: https://git.yoctoproject.org/meta-ti
- version: 38d91dd4f1341f908191fa8a854fd7a81bafb613 (tag: cicd.kirkstone.202307192152)
- ti-linux-kernel:
- repo: git.ti.com/.../ti-linux-kernel.git
- version: 26d37f12c83158b8e5333e6d5dd14b2fb9cdeab7 (tag: cicd.kirkstone.202307192152)
- linuxptp:
- repo: git://git.code.sf.net/p/linuxptp/code
- version: aa60db270be12e7144e7b0cef2f5dde4213b7057 (v4.0-3-gaa60db2)