Hello all, I want to use linuxptp to synchronize multiple embedded real-time systems. So far, I managed to synchronize the CLOCK_REALTIME on two systems with high accuracy using ptp4l and phc2sys. For some applications running on those systems this is very useful. But we also have a scheduler that triggers cyclic tasks using nanosleep on CLOCK_MONOTONIC (to be safe in case of time jumps). Since the CLOCK_MONOTONICs on multiple systems are also syntonized with ptp4l and phc2sys, I can observe, that the schedulers do not drift against each, which is good. But I can also observe a random phase shift, which results from the “random” offset between CLOCK_MONOTONIC and CLOCK_REALTIME, depending on the current clock times at the start of phc2sys.
I understand, that an absolute synchronization of the CLOCK_MONOTONICs is not possible by design. I also found this thread to confirm this: https://sourceforge.net/p/linuxptp/mailman/linuxptp-users/thread/20140219151200.GB9211%40netboy/#msg31998563 But for synchronizing the phase of the schedulers, it would be sufficient to synchronize the CLOCK_MONOTONICs relative to the cycle time of our tasks. So if we could for example define, that the offset between CLOCK_MONOTONIC and CLOCK_REALTIME can only be a multiple of our cycle time (eg. 1ms), this would be sufficient. Is there an option to do something like this? If this is not the case, what would happen if we hard (re-)set the offset during runtime of phc2sys to the closest multiple of our cycle time? Would phc2sys overwrite this or would it just adjust the difference to the master clock that was introduced by this manipulation by adjusting the frequency of CLOCK_REALTIME/CLOCK_MONOTONIC? Do you have other recommendations to synchronize cyclic scheduling on linux systems with a monotonic time source? Kind regards Florian
_______________________________________________ Linuxptp-users mailing list Linuxptp-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-users