Skip to main content
Visitor II
August 8, 2023
Solved

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

  • August 8, 2023
  • 2 replies
  • 2117 views

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.

    This topic has been closed for replies.
    Best answer by LCE

    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.

    2 replies

    LCEAnswer
    Graduate II
    August 8, 2023

    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.

    Visitor II
    August 8, 2023

    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...

    Graduate II
    August 8, 2023