cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP stack on STM32H723 Nucleo with DHCP - IP is not assigned

Attila Szabo
Associate II

Hi,

I'm playing with the LwIP stack on an STM32H723 Nucleo. I did everything regarding the variable placement, MPU config in the ram that needed to set up LwIP. With static IP it works just fine. I could ping it and I could implement an UDP server example. After it I thought I try the DHCP. The problem I do not get an IP from the DHCP server. The port on PC is set to have DHCP (tried on multiple PC) and what I see in WireShark is that the nucleo boradcasts DHCP Discover packets, but never gets DHCP Offer packets. And it is the same on multiple PCs, so I suspect something is wrong on the nulceo side. Is there any idea how to track the issue? In the "gnetif" main variable the IP, gateway, subnet is set to zero, no IP assigned to the device.

1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal

Do you connect the Nucleo directly to the PC's ethernet?

If yes: your PC is usually not a DHCP server, in my home setup DHCP only works if I connect the Nucleo to the network via a switch so my DSL router acts as a DHCP server.
But there's some software that let's your PC work as a DHCP server.

You could also try lwIP's AUTOIP functions for a local address assignment.

View solution in original post

3 REPLIES 3
LCE
Principal

Do you connect the Nucleo directly to the PC's ethernet?

If yes: your PC is usually not a DHCP server, in my home setup DHCP only works if I connect the Nucleo to the network via a switch so my DSL router acts as a DHCP server.
But there's some software that let's your PC work as a DHCP server.

You could also try lwIP's AUTOIP functions for a local address assignment.

Yes, I do connect to the PC's ethernet port. Thank you! You have opened my eyes:) I will try it with a router or I will look for tools to create a DHCP server on local host or something...

Piranha
Chief II