Hi All,
I configure my device as a PTP master, and I expect to receive PTP timestamps when I send a Sync.
ENET->MAC_TIMESTAMP_CTRL is configured like this:
ENET->MAC_TIMESTAMP_CTRL |= ENET_MAC_TIMESTAMP_CTRL_TSENA_MASK;
ENET->MAC_TIMESTAMP_CTRL |= ENET_MAC_TIMESTAMP_CTRL_TSCFUPDT_MASK;
ENET->MAC_TIMESTAMP_CTRL |= ENET_MAC_TIMESTAMP_CTRL_TSIPV4ENA_MASK;
ENET->MAC_TIMESTAMP_CTRL |= ENET_MAC_TIMESTAMP_CTRL_TSVER2ENA_MASK;
ENET->MAC_TIMESTAMP_CTRL &= ~ENET_MAC_TIMESTAMP_CTRL_SNAPTYPSEL_MASK; // 00
ENET->MAC_TIMESTAMP_CTRL &= ~ENET_MAC_TIMESTAMP_CTRL_TSENALL_MASK;// not all timestamps, i want only sync
ENET->MAC_TIMESTAMP_CTRL |= ENET_MAC_TIMESTAMP_CTRL_TSMSTRENA_MASK;// ptp master
After digging a lot, I see that I need to add
txFrame.txConfig.tsEnable=1;
in err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p)
But, when I add this tsenable, all the packets are timestamped !
i can receive the timestamp in static void ethernet_callback(...)
when ther's a kENET_TxIntEvent,.
Here're my questions:
* why is there many settings in ENET->MAC_TIMESTAMP_CTRL, but it seems that there's just the .tsEnable that's is used to activate timestamp for a packet.
* if there's no other better way to do the job, how can I discriminate sent packets in ethernet_callback(...) to reclaim (or not) the timestamps.
Is there somewhere an updated documentation about this lpc554s018 (and family) ?
regards
Hi,
Have you seen the following section which give the procedure for the system time generation in UM11155.pdf?
37.7.11.8 Programming guidelines for IEEE 1588 timestamping
37.7.11.8.1 Initialization guideline for system time generation
BR
XiangJu8n Rong
Yes,
I think I've read all these chapters,
But find no way to:
* generates a PPS synchronized with ptp time (the only way I've found to simulate this, is to use some hidden registers, and use the TSIS of MAC_INTR_STAT)
* use MAC_TIMESTAMP_CTRL to select which TX packet must be timestamped (the only way I've found is to add txFrame.txConfig.tsEnable = true;), but it's not a reliable way if I've many packets to timestamps.
and what's is the use of MAC_TIMESTAMP_CTRL if I've have to manually select TX packets that I want to timestamp.
Regards
* and so on...
Hi,
I have not seen the IEEE 1588 example code in SDK package, can you post the project so that we can have a review?
Anyway, I think the application note AN12149.pdf is helpful, pls refer to it.
https://www.nxp.com.cn/docs/en/nxp/application-notes/AN12149.pdf
BR
XiangJun Rong
Hi,thanks for documentation,
the base example is lpcxpresso54s018m_enet_txrx_ptp1588_transfer in lpc54s018 SDK.
I'll look at the AN you've send, bt I'm not sure it's directly related to the lpc.
Regards
Hi,
Thank you for the response, I have got the example lpcxpresso54s018m_enet_txrx_ptp1588_transfer in lpc54s018 SDK.
But the example does not use LWIP, it creates a packet and send it without UDP.
Now, do you use LWIP UDP to transfer PTP packet?
BR
XiangJun Rong