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.

MSP432E401Y: PTP IEEE 1588 support

Part Number: MSP432E401Y

Hello,

I've come across several threads on the forum inquiring about the support for IEEE1588 PTP functionality in the MSP432 SDK. In these threads, it's mentioned that this functionality is on the development roadmap, but these threads are several years old.

Can you please confirm whether the PTP protocol is currently supported in the MSP432E401Y SDK or if it's planned for a future release?

In case there is no support, could you kindly suggest the best approach for tackling the development of this functionality?

Thanks in advance!

  • Hi,

    In these threads, it's mentioned that this functionality is on the development roadmap, but these threads are several years old.

    Can you please confirm whether the PTP protocol is currently supported in the MSP432E401Y SDK or if it's planned for a future release?

      Unfortunately, it is not supported on the MSP432E SDK and there is currently no plan for a future release of the SDK. 

    In case there is no support, could you kindly suggest the best approach for tackling the development of this functionality?

    I find this post which maybe helpful. The poster share some code snippet that seems to have the PTP working. 

    https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1128906/msp432e401y-ptp-timestamping

  • Thanks for the hint! 

  • Hi,

    FYI, I did get a PTP system working with a Launchpad MSP432E401 syncing with a Trimble PTP server and generating a pulse per second output locked to the Trimble within about 100ns (with not much other Ethernet traffic).

    The first challenge is accessing the timestamp of incoming messages and instructing the HW to add timestamps to outgoing messages - TI-TROS, the TI drivers, and the IP stack sit between your user task code and the PTP hardware registers. The changes to the TI drivers shown in the linked thread take care of that, so you need to rebuild the TI drivers. Its a bit of a hack but the incoming timestamps are put into global variables that your task can grab.

    After that, the actual task is quite simple - wait for a once per second broadcast, reply, get a reply to your reply (collect timestamps for these as you go), do some sums, adjust your clock. If you want, adjust your local clock frequency to reduce your drift.

    A managed switch is useful so you can monitor the comms between the PTP devices, and Wireshark is your friend!

  • Hi Jim,

    Thank you very much for your insights! We are still in the early stages of understanding the synchronization mechanisms outlined in IEEE 1588, so we are at an early point in our development process.
    However, your comments and suggestions will be tremendously valuable to us in the coming weeks! Once again, thank you very much!

    Best regards,

  • Hi again Jim,

    I was wondering if you might have some example code that we could use as a reference for our project. It would be greatly appreciated if you could share it with us here or via email, and please understand that we completely respect your decision if you are unable or unwilling to do so.

    Thank you once again for all your assistance!

  • Hi,

    Unfortunately, I can't share the full code base as the copyright belongs to the company where I'm contracting. I can give you some tips and generic code snippets.

    I used a TI RTOS project with C++ code, but anything providing Posix or some standard network calls should be OK.


    I suggest you set up a development rig with a PTP server (e.g. Trimble Thunderbolt) and a managed switch (e.g. GS108Ev3 - 8-Port Gigabit Ethernet Smart Managed Plus Switch). Perhaps a DHCP server if required. Make sure you can build an Ethernet IP project that you can ping. Get Wireshark on a PC so it can see the PTP broadcasts.
    I would suggest PTP-V2 PTP, Profile - 1588, Sync Mode - One Step, Transport Protocol IPV4, IP Mode - Multicast, Delay Mechanism - E2E.

    You don't need a GPS input to the server to get it running - select System Mode - Freerun (you will sync accurately to an inaccurate clock but it proves the principle).

    Set your switch to IGMP Snooping Status - Disable otherwise the broadcasts don't get through for a few minutes after something changes.

    Set your switch so the PC/Wireshark port monitors the PTP device ports.

    Make sure you can build the modified TI device library.

    You need to enable some PTP registers - it seems fine to do this from main() before starting the task scheduler:-

    const uint32_t INITIAL_ADDEND = 0xCCCCCCD0;

    const uint32_t SUB_SEC_INC = 50;

    uint32_t config;

    config = EMAC_TS_PTP_VERSION_2 | EMAC_TS_DIGITAL_ROLLOVER | EMAC_TS_MAC_FILTER_DISABLE | EMAC_TS_UPDATE_FINE | EMAC_TS_ALL | EMAC_TS_PROCESS_IPV4_UDP;

    EMACTimestampConfigSet(EMAC0_BASE, config, SUB_SEC_INC);
    EMACTimestampAddendSet(EMAC0_BASE, INITIAL_ADDEND);

    EMACTimestampPPSSimpleModeSet(EMAC0_BASE, EMAC_PPS_1HZ);

    EMACTimestampEnable(EMAC0_BASE);

    // Assuming GPIO G0 has already been set at an output (via the sys config utility), this hack
    // sets it to output alternate function 5 - EN0PPS.

    *(uint32_t *)(GPIO_Port_G_Base + GPIOAFSEL_Offset) |= 0x00000001;
    *(uint32_t *)(GPIO_Port_G_Base + GPIOPCTL_Offset) |= 0x00000005;

    You should then be able to set a task to wait for the 1 second PTP broadcasts.

    Let me know if you get stuck Slight smile

  • Any luck so far?

  • Not yet, we haven't had much time to make progress on this, too many things on the development timeline....

    Currently, we've acquired a managed switch fron Perle, with PTP hardware capabilities, and we expect to receive it in the next few days (university purchases tend to be slow). Once it arrives, we hope to set up the infrastructure and prioritize the development task.

    Thanks for your interest; we'll keep you informed through this thread!