Hi,

i have a small number (3-10) of beagle bone blacks observing sensor
events, and measuring the relative timing between these events.

They observe the sensor events on a GPIO and take a ptp timestamp by
means of clock_gettime().

int fd = open(phc, O_RDWR);
... stop if  error ...
clkid = FD_TO_CLOCKID(fd);
struct timespec ts;
if (clock_gettime(m_clkid, &ts))
{
        ... stop if error ...
}


They run linuxptp in a 'standalone' mode - this means that the ptp clock
is not synchronized to the system clock, only ptp4l is runnning not
phc2sys.

There is no master defined - the ptp4l system chooses it automatically.
Basically the default config file is used for the ptp4l daemon.

This works most of the time with reported offsetFromMaster below 1us,
but occasionally the ptp system goes wild and the measured timestamp
values do not fit together.

In this situation pmc reports the following:


pmc -u -b 1 'GET CURRENT_DATA_SET'

sending: GET CURRENT_DATA_SET
        689e19.fffe.57a4d4-0 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     1
                offsetFromMaster 240.0
                meanPathDelay    10854.0
        04a316.fffe.b548bd-1 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     0
                offsetFromMaster 0.0
                meanPathDelay    0.0
        88c255.fffe.4c15c9-1 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     1
                offsetFromMaster 1681694.0
                meanPathDelay    16849.0
        84eb18.fffe.ebef79-1 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     1
                offsetFromMaster 1675968.0
                meanPathDelay    15389.0
        8030dc.fffe.592a4f-1 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     1
                offsetFromMaster 3669.0
                meanPathDelay    22930.0
        88c255.fffe.837103-1 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     1
                offsetFromMaster 20164034374729.0
                meanPathDelay    -194758.0
        8030dc.fffe.865c4e-1 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     1
                offsetFromMaster 20164034051597.0
                meanPathDelay    -224802.0
        8030dc.fffe.8653ef-1 seq 0 RESPONSE MANAGEMENT CURRENT_DATA_SET
                stepsRemoved     1
                offsetFromMaster 20164033040234.0
                meanPathDelay    -303364.0



The situation is somewhat sticky, meaning that the ptp offsetFromMaster
values reported do not converge again or they do this very very slowly.

So my question is, what am I doing wrong? Is it ok to use
clock_gettime() on /dev/ptp from multiple processes simultanionusly?

kind regards
  Frank





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to