cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H457I Ethernet, LwIP and SNTP

QRobe.1
Associate II

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 ?

2 REPLIES 2
FBL
ST Employee

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello,

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