The IEEE 1588 standard is known as the Precision Clock Synchronization Protocol for Networked Measurement Control Systems, also known as Precision Time Protocol (PTP). The IEEE 1588 PTP enables the clocks to be distributed across an Ethernet network and accurately synchronized using a process where the distributed nodes exchange timestamped messages.
PTP system configuration
Linux PTP provides some tools to carry out time synchronization:
-
ptp4l: daemon that synchronizes the PTP Hardware Clock (PHC) from the NIC
-
phc2sys: daemon that synchronizes the PHC and the System clock
-
pmc: utility tool to configure ptp4l in run-time
Include these tools in your project with the following change to your conf/local.conf
file:
IMAGE_INSTALL:append = " linuxptp"
Note the required white space when appending a value to an array variable using the :append override syntax.
|
Rebuild the project and install the new rootfs on the target.
Kernel configuration
You can enable PTP support through the following kernel configuration.
-
PTP 1588 Clock
(CONFIG_PTP_1588_CLOCK)
-
Support for driver to use 1588 PTP framework
(CONFIG_PTP_1588_CLOCK_OPTIONAL)
-
PPS (pulse per second) high-precision time reference
(CONFIG_PPS)
These options are enabled as built-in on the default ConnectCore 93 kernel configuration file.
PTP testing
Once the target has been updated with the changes and booted successfully, test the local signal.
Use the following commands on the target to verify the PTP:
-
Test the time synchronization between devices on a local network:
# ptp4l -i eth0 -p /dev/ptp0 -m -2 &
The command must be executed on each device on the network. For more configuration options, type the application name with no parameter.