cancel
Showing results for 
Search instead for 
Did you mean: 

How to use SNTP over LwIP and RTC with an STM32

BFlin.1
Associate II

Hello:
I have followed this exactly...
https://community.st.com/t5/stm32-mcus/how-to-use-sntp-over-lwip-and-rtc-with-an-stm32/ta-p/736706
I am using STM32CubeIDE V1.16.1 with a NUCLEO-H723ZG board.
There are no errors or warnings.
The code runns and I get...

SNTP Client
NUCLEO-H723ZG board
State: Ethernet Initialization ...
State: Looking for DHCP server ...
DHCP Timeout !!
Static IP address: 192.168.0.192

There is no red error light etc..
Can anyone help or perhaps B.Montanari ST Employee, (the author) etc. ?\
Thanks.

8 REPLIES 8
Andrew Neil
Evangelist III

@BFlin.1 wrote:

State: Looking for DHCP server ...
DHCP Timeout !!


So do you have a DHCP server on the network?

Imen.D
ST Employee

Hello @BFlin.1 ,

Check your static IP address configurations. Make sure to enable the CPU DCache.

You can try this Nx_SNTP_Client example available in GitHub page and get inspired from this example to use it with Nucleo-H723ZG by following the instructions in the readme file.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

C:\Windows\SysWOW64>ipconfig /all | find /i "DHCP Server"
DHCP Server . . . . . . . . . . . : 10.0.0.1

BFlin.1
Associate II

Maybe please take a look at my set up for issues etc.

Thanks

 

That's the DHCP server that your PC is using.

What about your STM32 ?

LCE
Principal

So what's your setup, direct connection STM32 ETH to PC ethernet port?

As Andrew says, your STM32 cannot simply connect to some DHCP server via your PC.

Maybe you can find a PC app, or maybe your switch has a DHCP server function?

<So what's your setup, direct connection STM32 ETH to PC ethernet port?>

No, I am using straight cable to switch that goes to internet router.

Then check if your router has a DHCP server that can be activated.