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.

DP83640 Tx Event packet timestamp

Other Parts Discussed in Thread: DP83640

Hi,

I am unable to use Timestamping feature for Tx event packet. I have enabled Timestamping for
1PPS event on GPIO and PTP event message.
I am able to get 1PPS event timestamp but not the latter. I have taken this part of the code from
EPL C code reference library. Please take a look at this code.

// Enable Transmit Timestamp operation
    flags = TXOPT_IP1588_EN | TXOPT_IPV4_EN | TXOPT_TS_EN;

PTPSetTransmitConfig( portHandle, flags, 1, 0xFF, 0x00);

//Every 50ms polling PHY_PG4_PTP_STS to check if there are any events:

if(i_timer_msec%50 == 0)
{
events = PTPCheckForEvents( portHandle);
        if ( events & PTPEVT_EVENT_TIMESTAMP_BIT)
        {
             PTPGetEvent( portHandle, &eventNum, &riseFlag, &seconds_ts, &nanoseconds_ts, &eventsMissed);
        }
        if ( events & PTPEVT_TRANSMIT_TIMESTAMP_BIT)
        {
               PTPGetTransmitTimestamp( portHandle, &seconds_ts_sync, &nanoseconds_ts_sync, &overflowCount);
        }
}









  • Hi,

    The Tx timestamp issue is fixed. Can someone please tell me how to configure the device to timestamp the received packet.

  • Hi Swathi,

    I moved your question to this forum so that the proper people can help you with it. Please post your future Ethernet questions in the forum.

    Thanks!

    John

  • What is your target for timestamping receive packets?  Are you trying to timestamp IPv4 packets? 

    Are you operating in 1-step mode or 2-step mode?  In other words, are you using Follow_Up messages?

    What is your method for getting timestamps from the DP83640 - register access, timestamp insertion,  or Phy Status Frames?

    Patrick

  • Thank you John, for posting my question here.

    Hi Patrick,

    I am trying to timestamp PTPv1 delay request packet (IPv4 packet).

    I am operating it in 2-step mode.

    This is the current configuration made:

    // Enable Receive Timestamp operation
        rxCfgItems.ptpVersion = 0x01;
        rxCfgItems.ptpFirstByteMask = 0xFF;
        rxCfgItems.ptpFirstByteData = 0x00;
        rxCfgItems.ipAddrData = 0;
        rxCfgItems.tsMinIFG = 0x0C;
        rxCfgItems.srcIdHash = 0;
        rxCfgItems.ptpDomain = 0;
        rxCfgItems.tsSecLen = 3; //0; // DRs option
        rxCfgItems.rxTsNanoSecOffset = 0; //0x24; // DRs option
        rxCfgItems.rxTsSecondsOffset = 0; //0x21; // DRs option

    rxCfgOpts = RXOPT_IP1588_EN0|RXOPT_IP1588_EN1|RXOPT_IP1588_EN2|
                    RXOPT_RX_IPV4_EN|RXOPT_RX_TS_EN|RXOPT_ACC_UDP;

    PTPSetReceiveConfig( portHandle, rxCfgOpts, &rxCfgItems);

        // Make sure TX timestamp PSFs are off before we go through the Phase
        // alignment process.  This will allow TIMESTAMP events to be presented
        // properly.  This will be undone below.
        PTPSetPhyStatusFrameConfig( portHandle,
                                    (portHandle->psfConfigOptions & ~STSOPT_TXTS_EN),
                                    STS_SRC_ADDR_2,
                                    7, 0x00, VERSION_PTP, 0x0F, 0x0F,
                                    (NS_UINT32)(ptpStackCfg->srcIPAddress[0] |
                                                ptpStackCfg->srcIPAddress[1]<<8 |
                                                ptpStackCfg->srcIPAddress[2]<<16 |
                                                ptpStackCfg->srcIPAddress[1]<<24) );

    Thanks,

    Swathi

  • Hi patrick,

    I have used register access and disabled phy status frame method:

    PTPSetPhyStatusFrameConfig( portHandle,
                                    (portHandle->psfConfigOptions & (~STSOPT_TXTS_EN) & (~STSOPT_RXTS_EN)),
                                    STS_SRC_ADDR_2,
                                    7, 0x00, VERSION_PTP, 0x0F, 0x0F,
                                    (Integer32)(ptpStackCfg->srcIPAddress[0] |
                                                ptpStackCfg->srcIPAddress[1]<<8 |
                                                ptpStackCfg->srcIPAddress[2]<<16 |
                                                ptpStackCfg->srcIPAddress[1]<<24) );

    Is this configuration correct?

  • Hi patrick,

    We have a project deadline closer by. At least the proto type has to be done soon.

    I would really appreciate if you could suggest me something on this.

    Thanks in advance.

    Swathi

  • Swathi,

    I am not sure that I followed the thread of your posts.  Are you now using register polling to read the timestamp or are you still trying to use Phy Status Frames for the received Delay_Req message?

    Backing up a bit further, I would like to understand your application a bit better and understand what you have working. 

    I believe in this case, we are discussing functionality on the PTP Master and that you have been successful in getting the transmit timestamp of the Sync message.  Is that correct?  If so, could you confirm that you are using register polling to read the transmit timestamp? 

    Do you have the ability to capture the received Delay_Req packets?  Is that something that you could provide for review so that I could confirm the contents?

    Are you also handling the configuration of the PTP Slave?  If so, how are you handling the transmit and receive timestamps on that side? 

    Patrick

  • Hi Patrick,

    I am using register polling as given below for the received Delay_Req message:

    events = PTPCheckForEvents( portHandle);
    if(events & PTPEVT_RECEIVE_TIMESTAMP_BIT)
    {
         PTPGetReceiveTimestamp( portHandle, &seconds_ts_delayrequest, &nanoseconds_ts_delayrequest, &overflowCount, &seqId_rx_dr, &msgType_rx_dr,     &hashValue_rx_dr);
    }

    The system is configured as PTPv1 master. And yes i have been successful in getting the transmit timestamp of the sync message. I m using register polling to read the transmit timestamp:

    events = PTPCheckForEvents( portHandle);
    if ( events & PTPEVT_TRANSMIT_TIMESTAMP_BIT)
    {
           PTPGetTransmitTimestamp( portHandle, &seconds_ts_sync, &nanoseconds_ts_sync, &overflowCount);
           asm(" NOP ");
           asm(" NOP ");
    }

    I have attached the wireshark file in which all the packets are captured.

    I am not handling the configuration of the PTP Slave.4657.PTPv1.txt7608.PTPv1.txt

  • Hi Patrick,

    The issue is resolved. There was a small mistake in the configuration. Now i am able to capture receive timestamp.

    Regards,

    Swathi

  • Swathi,

    Glad to hear that you resolved the issue.  Well done!  For the sake of others who might benefit from your experience, could you post the details of the small mistake in the configuration and the adjustment that you made?

    Thanks,

    Patrick

  • Swathi,

    I'm currently having a similar problem: I'm an unable to read a correct value TimeStamp by calling function  PTPGetReceiveTimestamp() from EPL C library. Could you provide more information on your solution?