High-precision clock synchronization is a key technology in the applications thatthe coordinated movement of the whole system, There are a variety of clocksynchronization methods for distributed systems, such as the IEEE1588, NTP, GPS andso on. At present, the implementations of IEEE1588can be divided into two types: puresoftware implementations and hardware-assisted implementations. They are different insynchronization accuracy and cost. Users can choose the suitable one according theirscenarios.In this paper,the basic principles of IEEE1588was analyzed,both puresoftware/hardware-assisted implementations being realized. And gives thecorresponding test results, test results were analyzed.The pure software implementation makes use of open source PTPd V2, with thesupport of Linux,to achieve the IEEE1588soft clock synchronization.According thefactors that may affect synchronization accuracy in pure software implementation,wepointed out the real-time performance had impact of clock synchronization accuracy.Linux/Xenomai hard real-time environment was built based on these. the real-timeperformance of Xenomai was Verified.Then Xenomai/RTnet was built,and theperformance of RTnet has been tested.STM32F107VC of STMicroelectronics was selected in the hardware-assistedimplementation.Its Hardware itself support the IEEE1588PTP. PTP hardware unit wasresponsible for PTP event messages to capture time tamps, LwIP supporting the upperapplication for UDP/IP, the program of PTPd v2realizing the IEEE1588precision timesynchronization function. The results indicated that it is able to achieve an accuracy ofless than260ns clock synchronization based on STM32F107VC PTP hardware unit. |