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.

AM263X-MCAL-SDK: SNTP Server Implementation on AM2634 using its CPSW over Ethernet

Part Number: AM263X-MCAL-SDK
Other Parts Discussed in Thread: AM2634

Hi Team,

I am using the AM2634 via the LP-263 board and would like to know if it is possible to run an SNTP server on this platform.

Currently, I have connected a GPS module (MAXF10S) to the AM2634 via UART, which provides time, date, and location information.

My requirement is to implement an SNTP server that can provide accurate time information to requesting SNTP clients.

Could you please confirm if this is possible on the AM2634? If so, is it feasible in both RTOS and no-RTOS configurations? I would also appreciate suggestions on the best approach to implement this.

Thanks & regards,
Sai Kiran

  • Hi Sai, 

    I have one design related question here. Please help me in understanding the scenario.

    When a device in the network requests for time to AM263 via ethernet, are you planning to provide the response which will be the current time and date after obtaining it from the GPS module at that point of time? 

    Or are you planning a design implementation where time is always readily available in AM263 and when request comes, response is immediate without asking the GPS module at that point of time?

    Thanks & Regards,

    Aswin

  • Hi Aswin,

    Thanks for your question.

    We are planning to implement the second approach. The AM2634 will continuously obtain time and date information from the GPS module (MAXF10S) via UART and maintain it locally.

    This ensures that the current time is always readily available within the AM2634. So, whenever a device in the network requests time over Ethernet (SNTP request), the response can be sent immediately without querying the GPS module at that moment.

    This approach helps in reducing response latency and ensures timely replies to the SNTP clients.

    Please let me know if you have any further suggestions or if we should consider the alternate approach.

    Thanks & Regards,
    Sai Kiran

  • Hi Sai,

    MCU + SDK offers LWIP stack. LWIP stack has options for SNTP client, but I do not see any flags to enable SNTP server in LWIP stack. The SDK does not offer any specific software to enable SNTP.

    But in your case, I think, it would be enough to create a UDP listener on AM263 that listens to NTP clients. The UDP Listener would listen to the requests, when a request comes, AM263 would need to respond to it using the data. I have mentioned UDP here because I saw that NTP requests go on UDP to a specific port.

    Also are you planning to use MCU + SDK or MCAL ?

    Thanks & Regards,

    Aswin

  • Hi Aswin,


    I came to know that MCU+ SDK provides the lwIP stack. However, I could not find any SNTP-related examples or functions. Does MCAL provide any drivers or support for SNTP?


    I am familiar with MCU+ SDK drivers. Could you briefly explain what APIs MCAL provides? Does it include everything that MCU+ SDK has, or is it different? From my understanding, MCAL mainly contains drivers related to AUTOSAR and industrial protocol stacks—please correct me if I am wrong.


    Also, as you mentioned, if SNTP support is not directly available, we may need to implement it using UDP (port 123).

    In that case, I believe we need to:


    1.Listen for SNTP requests over UDP
    2.Parse the incoming SNTP client packet format
    3.Construct and send a proper SNTP server response packet
    Please confirm if my understanding is correct.

    If that manual parsing is the case, can we use any GitHub SNTP available libraries, suggest one if you know one.


    Regards,
    Sai Kiran

  • Hi Aswin,

    Could we please get a response on this?

    Regards,
    Sai Kiran

  • Hi Sai Kiran,

    Apologies for the delay in response as I was OOO.

    Please confirm if my understanding is correct.

    Yes, this understanding is correct. This was what I was explaining as a sample implementation in the earlier reply.

    g, MCAL mainly contains drivers related to AUTOSAR and industrial protocol stacks—please correct me if I am wrong.

    Yes, this is correct. MCAL does not have lwiP support like MCU + SDK. What MCAL has are the device drivers.

    AUTOSAR defines their own standard for TCP/IP services.

    If that manual parsing is the case, can we use any GitHub SNTP available libraries, suggest one if you know one.

    I did a quick search and found an example that implements sntp server. Just listing it here

    github.com/.../server.go

    But I think the main goal here is to fix the packet format. I found the packet format explained here

    https://www.ietf.org/rfc/rfc2030.txt

    Thanks & Regards,

    Aswin

  • Hi Aswin,

    Yes, this understanding is correct. This was what I was explaining as a sample implementation in the earlier reply.

    understood.

    I did a quick search and found an example that implements sntp server. Just listing it here

    github.com/.../server.go

    But I think the main goal here is to fix the packet format. I found the packet format explained here

    https://www.ietf.org/rfc/rfc2030.txt

    From the references I have reviewed, I understand that:

    The current SNTP server code is implemented in Go.
    RFC 2030 corresponds to an older version of SNTP.
    RFC 4330 and RFC 2030 are largely the same, so I think the GitHub code you shared should work for both.
    Our current requirement is to comply with the latest SNTP version 4 (RFC 4330).

    Could you please advise if any changes are required to ensure the implementation fully complies with RFC 4330?

    Thanks & regards,
    Sai Kiran

  • Hi Sai Kiran,

    Thank you for the detailed follow-up question about RFC 4330 compliance. The code I shared earlier was actually an example I found on GitHub to help illustrate SNTP concepts.

    Since you're looking for specific compliance with RFC 4330, I'd really recommend getting input from someone with specialized knowledge in SNTP/NTP protocols.

    I should also mention that TI doesn't currently offer SNTP server implementations as part of our software offering, so this would likely need to be handled as a custom solution.

    Thanks & Regards,

    Aswin

  • Hi Aswin,

    Thank you for your valuable suggestions regarding the SNTP topic. I really appreciate your guidance.

    Regards,
    Sai Kiran