AM3354: Time stamp questions

Part Number: AM3354

We design a device based on AM3354 (TIRTOS). One of possibilities of the device is synchronizing by PTP.
Time source in the device is CPTS which bind with CPSW. CPTS works wich frequency 250MHz. PTP works on the Ethernet level (raw-sockets) with P2P
mechanism.


It makes three time stamps per second (with using events Ethernet_Receive_Event and Ethernet_Transmit_Event).
Simultaneously with PTP we make and send 4000 ethernet frames per second (with time between frames 250 microsecond). We have to keep the time
interval with precision about one microsecond. To achieve it we once in 2.5 millisecond get the time stamp upon TIMER4 and ajust it. It makes 400 time
stamps in CPTS per second (event Hardware_Tim_Stamp_Push_Event).


Simultaneously once in millisecond we get time from CPTS for our system time. It makes 1000 time stamps from CPTS per second (event Time_Stamp_Push_Event).
Events like Time_Stamp_Rollover_Event and Time_Stamp_Half_Rollover_Event we don't handle.


Some times when system is working happens bad event, when PTP loose synchronization cause PTP daemon doesn't get the time stamp from CPTS. We have
supposition than CPTS doesn't make the time stamp or the time stamp was made but on the moment of request it wasn't in the FIFO.
Also some times happens a delay, when the timer made an event, the Software got an interruption but on the moment to get the time stamp there was not in the FIFO.
But after some time the time stamp appears in the FIFO.


Consequently we have a couple questions:
1. How many a time stamps can make CPTS per second?
2. Which is the maximum delay can be between make time stamp and put it into FIFO of CPTS?

  • Hello,

    1. How many a time stamps can make CPTS per second?
    A. Events are put into the EVENT FIFO when a timesync packet arrives. You need to service the EVENT FIFO
    such that it does not overflow or new timestamps will be lost (dropped in the case of a full FIFO). This servicing depends on the software and not the CPTS hardware itself.

    2. Which is the maximum delay can be between make time stamp and put it into FIFO of CPTS?
    A. When a packet arrives at the GMII boundary, the timestamp is taken. If the packet is determined to be a timesync packet
    then and only then is the EVENT with the timestamp loaded into the EVENT FIFO. The time for that to occur is insignificant
    compared to the time that it takes software to service the CPTS interrupt.

    Because the EVENT FIFO is limited to 16 entries for this device, it seems that in your case you would need to service the interrupts faster, service more than one at a time, or perform some combination of both.

  • Hello

    We have got event from CPTS without a timestamp

    Here we get event:

    Here is the buffer with sync packet:

    Here the CPTS register:

    After got an event from CPTS (about receiving an ethernet packet) we don not find the timestamp in the CPTS queue.

  • Hello,

    It appears that the CPTS Event FIFO was full and the new timestamp was discarded. It's imperative that the FIFO be serviced in a timely manner.

  • So why it appears a little bit later?

    We are sure the timestamp which appears after some time, is that which we were waiting. Or we receive two identical ptp packets, but it is highly unlikely.

  • Not sure I understand. Earlier you said that you didn't find the TS in the CPTS queue. That would be evidence of the TS being discarded due to the FIFO being full.

    Are you saying that the TS does eventually appear? If so, how long after the event do you see the TS?

  • I've attached the screenshots, but some time I see them, some time not. Have your seen the screenshots?

    When ptp packet arrived we try to get time stamp. Usually we get time stamp and all right. But after approximately 2 hour of working we couldn't find the time stamp in the FIFO. We put a breackpoint on this event and when we have a look in a debug mode, we see the timestamp in FIFO buffer, a little bit later. We do not measure the time between event and appearing the TS.

    I've tried a different servers, but result the same. After two or two and half hours it lost the timestamp.