I.MX6ul PTP support: Difference between revisions

From embeddedTS Manuals
(Created page with "The i.MX6ul FEC controller supports 1588 PTP (V1 & V2). This is supported in Linux with the [http://linuxptp.sourceforge.net/ linuxptp] project. This will synchronize the Li...")
 
(Update with cleaned info)
 
Line 1: Line 1:
The i.MX6ul FEC controller supports 1588 PTP (V1 & V2).  This is supported in Linux with the [http://linuxptp.sourceforge.net/ linuxptp] project.  This will synchronize the Linux system clock to within +-1us.
The i.MX6UL CPU Ethernet supports 1588 PTP (PTPv1 & PTPv2).


This requires using an image based on the Linux 4.9+ kernel.
PTP is supported in Linux via the [http://linuxptp.sourceforge.net/ linuxptp] project. This allows synchronizing the system clock to within ±1 us.
 
Note that Linux kernel version 4.9 or greater is required for PTP support with the i.MX6UL CPU. An example of setting up an ethernet interface with PTP and adjusting the clock based on that is below.


<source lang=bash>
<source lang=bash>
apt-get install linuxptp -y
apt-get install linuxptp -y


# For PTP on eth0
phc2sys -s /dev/ptp0 -w &
phc2sys -s /dev/ptp0 -w &
ptp4l -2 -H -i eth0 -m -p /dev/ptp0 &
ptp4l -2 -H -i eth0 -m -p /dev/ptp0 &
# For PTP on eth1
phc2sys -s /dev/ptp1 -w &
ptp4l -2 -H -i eth1 -m -p /dev/ptp1 &
</source>
</source>


If the clocks are significantly off this may take time for the clocks to converge.
If the clocks are significantly off this may take time for the clocks to converge.

Latest revision as of 14:45, 7 July 2021

The i.MX6UL CPU Ethernet supports 1588 PTP (PTPv1 & PTPv2).

PTP is supported in Linux via the linuxptp project. This allows synchronizing the system clock to within ±1 us.

Note that Linux kernel version 4.9 or greater is required for PTP support with the i.MX6UL CPU. An example of setting up an ethernet interface with PTP and adjusting the clock based on that is below.

apt-get install linuxptp -y

# For PTP on eth0
phc2sys -s /dev/ptp0 -w &
ptp4l -2 -H -i eth0 -m -p /dev/ptp0 &

# For PTP on eth1
phc2sys -s /dev/ptp1 -w &
ptp4l -2 -H -i eth1 -m -p /dev/ptp1 &

If the clocks are significantly off this may take time for the clocks to converge.