I am evaluating linuxptp for use in an embedded system.
The basic architecture is as follows:
+-------------+     +-------------+    +-------------+
|             |     |             |    |             |
|             |     |             |    |             |
| GRANDMASTER |<--->| Embedded PC |<-->| Custom board|
|  (PC)       |     |   (Intel)   |    |             |
|             |     |             |    |             |
+-------------+     +-------------+    +-------------+

The Embedded system is constituted by an embedded PC (Intel based) and a
custom board
both running Linux and it is intended to be connected to an external PC
(also Linux)
Both the Embedded PC is running kernel 4.14.30 and the Custom board, kernel
4.14.0,
both 32-bits. I compiled linuxptp 3.1.1 for both.

As the custom board does not support hardware timestamp, I am experimenting
with the
software timestamp.

I forced the custom board to client mode:
sudo ptp4l -i eth0 -S -s -m -q step_threshold=0.00001

And the Embedded PC works as grandmaster for the Custom board:
sudo ptp4l -i eth_am -S -m -q step_threshold=0.00001

I noticed that sometimes the master offset starts increasing as if the
clock was no
longer being updated. Unfortunately I did not save an instance of the log
when this
anomaly happened.

I saved a sample of the log after running similar commands on two
Fitlet PCs running Ubuntu Mate 20.04LTS (kernel 5.4.0, 64-bits OS), also
running
linuxptp 3.1.1 compiled in.

I noticed what looks like an important difference between both
configurations.

This is the log of the custom board:

custom_board:~$ sudo ptp4l -i eth0 -S -s -m -q step_threshold=0.00001
ptp4l[23715.187]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[23715.187]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
ptp4l[23721.896]: selected local clock 000a35.fffe.000122 as best master
ptp4l[23728.111]: selected local clock 000a35.fffe.000122 as best master
ptp4l[23735.085]: selected local clock 000a35.fffe.000122 as best master
ptp4l[23742.999]: selected local clock 000a35.fffe.000122 as best master
ptp4l[23749.230]: selected local clock 000a35.fffe.000122 as best master
ptp4l[23755.780]: selected local clock 000a35.fffe.000122 as best master
ptp4l[23761.675]: port 1: new foreign master aabbcc.fffe.ddee66-1
ptp4l[23762.677]: selected local clock 000a35.fffe.000122 as best master
ptp4l[23765.675]: selected best master clock aabbcc.fffe.ddee66
ptp4l[23765.675]: foreign master not using PTP timescale
ptp4l[23765.675]: port 1: LISTENING to UNCALIBRATED on RS_SLAVE
ptp4l[23767.674]: master offset    -519361 s0 freq +100000000 path delay
  64850
ptp4l[23768.674]: master offset    -519678 s0 freq +100000000 path delay
  64850
ptp4l[23769.674]: master offset    -523460 s0 freq +100000000 path delay
  65099
ptp4l[23770.674]: master offset    -521308 s0 freq +100000000 path delay
  65275
ptp4l[23771.674]: master offset    -525323 s0 freq +100000000 path delay
  65275
ptp4l[23772.674]: master offset    -528631 s0 freq +100000000 path delay
  65318
ptp4l[23773.675]: master offset    -527435 s0 freq +100000000 path delay
  65318
ptp4l[23774.675]: master offset    -528132 s0 freq +100000000 path delay
  65451
ptp4l[23775.675]: master offset    -533678 s0 freq +100000000 path delay
  65972
ptp4l[23776.675]: master offset    -531624 s0 freq +100000000 path delay
  65972
ptp4l[23777.675]: master offset    -534432 s0 freq +100000000 path delay
  66493
ptp4l[23778.675]: master offset    -534855 s0 freq +100000000 path delay
  65988
ptp4l[23779.675]: master offset    -537967 s0 freq +100000000 path delay
  66572
ptp4l[23780.675]: master offset    -539110 s0 freq +100000000 path delay
  66572
ptp4l[23781.675]: master offset    -538102 s0 freq +100000000 path delay
  65988
ptp4l[23782.675]: master offset    -540316 s0 freq +100000000 path delay
  66572
ptp4l[23783.675]: master offset    -542282 s1 freq +99998711 path delay
66680
ptp4l[23784.675]: master offset       3549 s2 freq +99999069 path delay
66680
ptp4l[23784.675]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED
ptp4l[23785.675]: master offset       2215 s2 freq +99998938 path delay
66680
ptp4l[23786.675]: master offset       1182 s2 freq +99998836 path delay
66749
ptp4l[23787.676]: master offset       3788 s2 freq +99999100 path delay
66749
ptp4l[23788.676]: master offset       2412 s2 freq +99998965 path delay
66749
ptp4l[23789.676]: master offset       1775 s2 freq +99998903 path delay
66749
ptp4l[23790.676]: master offset       4067 s2 freq +99999136 path delay
66680
ptp4l[23791.676]: master offset        824 s2 freq +99998813 path delay
66749
ptp4l[23792.676]: master offset       3687 s2 freq +99999103 path delay
66749
ptp4l[23793.676]: master offset       3373 s2 freq +99999075 path delay
66749
ptp4l[23794.676]: master offset       6239 s2 freq +99999368 path delay
66749
ptp4l[23795.676]: master offset       9323 s2 freq +99999686 path delay
66838
ptp4l[23796.676]: master offset       8212 s2 freq +99999583 path delay
66838
ptp4l[23797.676]: master offset       6440 s2 freq +99999412 path delay
67000
ptp4l[23798.676]: master offset      10252 s2 freq +99999803 path delay
67602
ptp4l[23799.676]: master offset       6070 s2 freq +99999391 path delay
67602
ptp4l[23800.676]: master offset       5183 s2 freq +99999308 path delay
67602
ptp4l[23801.676]: master offset       6810 s2 freq +99999477 path delay
67602
ptp4l[23802.676]: master offset       7300 s2 freq +99999533 path delay
68151
ptp4l[23803.676]: master offset       7303 s2 freq +99999541 path delay
68151
ptp4l[23804.676]: master offset       8433 s2 freq +99999663 path delay
68151
ptp4l[23805.677]: master offset       8715 s2 freq +99999699 path delay
68151
ptp4l[23806.677]: master offset       6014 s2 freq +99999435 path delay
68151


The important difference between the above and the test with the Fitlets is
on the clock column, all values are +100000000 or close to it, all positive
values, whereas on the Fitlets, the values are much lower and alternate
between positive and negative values as well as the offsets.

So it occurred there could be some software issue in this fairly old kernel
version that may have been fixed in more recent kernels. Or maybe it is
has to do with 32-bits vs 64-bits OS. Or I am simply doing something very
wrong.

Any help to help me to identify and fix this problem is welcome.

TIA.
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to