Skip to main content
Visitor II
June 24, 2022
Question

STM32H457I Ethernet, LwIP and SNTP

  • June 24, 2022
  • 1 reply
  • 1216 views

Hello, I was wondering how to implement a SNTP Client.

I am using the STM32H745I board and I am able to ping through Ethernet, without OS. From what I have understood so far, I am supposed to redefine a macro called SNTP_SET_SERVER_TIME. Am I supposed to this in the file lwipopts.h or sntp.c ? . Then, the prototype is defined in the main.c for setting the time.

In the main.c, three functions are called :

- sntp_setoperatingmode(SNTP_OPMODE_POLL);

- sntp_setservername(0, "pool.ntp.org");

- sntp_init();

And in the main loop, there are two functions called :

- ethernetif_input(&gnetif);

- sys_check_timeouts();

It seems that the prototype of the function is never called, do you have any ideas or advice to give ?

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    September 16, 2022

    Hello @QRobe.1​ 

    1. SNTP_SET_SERVER_TIME should be in sntp.c file
    2. Which prototype function you think is not called. Please provide more details about your example so that we can help you
    QRobe.1Author
    Visitor II
    September 16, 2022

    Hello,

    T​hanks a lot for answering but I made it work by myself.