This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Time cannot be synchronized using the ptp4l tool

Part Number: TDA4VM

Hi, TI experts

I want to use the ptp4l tool to synchronize the time, but the synchronization failed.


I took a look at the file

Then refer to this link 3.2.2.12.3.1. PTP — Processor SDK Linux for J721e Documentation 

I used two TDAVM cards

For the first card set as primary, enter the command    ptp4l -E -2 -H -i eth1 -l 6 -m -q -f ptp.cfg

For the second card set to slave, enter the command  ptp4l -E -2 -H -i eth0 -s -l 6 -m -q -f ptp.cfg

The symptom is consistent with the document.

however, the slave computer fails to synchronize the host time

The test situation can be referred to the table below:

ptp4l tool test

testing environment

hardware

software

SAK-TC397AX

V7.3.3.16.20220418

single-board test

input cmd

Board output

problem

1. ptp4l -E -2 -H -i eth0 -l 7 -m -q -p /dev/ptp0 -f ptp.cfg

2. ptp4l -E -2 -H -i eth0 -l 7 -m -q -p /dev/ptp0

1. ptp4l[274.850]: port 1: master tx announce timeout
ptp4l[275.850]: port 1: master sync timeout

2. The wireshark fails to capture packets.

The ptp4l tool cannot output ptp packets when a single card is master

Double board card test

master:ptp4l -E -2 -H -i eth1 -l 6 -m -q -f ptp.cfg

slave:ptp4l -E -2 -H -i eth0 -s -l 6 -m -q -f ptp.cfg

The print is normal and consistent with the document description

Query the system time. The slave board is not synchronized with the master board time

ptp.cfg content 

[global]
tx_timestamp_timeout 400

  • Hi Sikai,

    ptp4l syncs the slave ptp hardware clock to with master ptp hardware clock. In CPSW, we have different ptp hardware clock and system clock. When you query the system time, the system clock is read which is not being synced with ptp master clock. To get the correct time, you will additionally need to synchronize the ptp hardware clock and system clock of TDA4. This can be done using phc2sys command.

    Usage : "phc2sys -c CLOCK_REALTIME -s eth0 -O 0 -m"

    Run both ptp4l and phc2sys simultaneously on slave and the system time will be synchronized to master.

    Regards,
    Tanmay