2025-06-21 4:16 AM
I'm encountering a networking issue where my STM32 device that is NUCLEO-H755ZI-Q, configured with the LwIP stack over Ethernet without FreeRTOS and assigned a static IP address (192.168.100.123), is unable to be discovered or pinged from a PC connected via Wi-Fi to the same router. The Ethernet link is physically active and UP, and the router indicates that data is being transmitted to the STM32, yet it shows almost No receiving packets from STM32 (onto the router). The router don't show the the static IP i assigned to the STM32 as well. I opened my router page to look inside these data. Debug logs from the STM32 reveal that ARP requests are being sent repeatedly and that the IP configuration is correctly set on the interface. Occasionally, the STM32 receives and parses ARP frames, but they are not directed to it, indicating that the receive path is at least partially functional. When using DHCP, the STM32 successfully constructs and broadcasts DHCP discovery packets, yet no DHCP offers are received, resulting in timeouts and retransmissions. Throughout this process, the device does not appear in the router’s device list or ARP table.
Here are the debug logs from Lwip:
---
etharp_request: sending ARP request.
pbuf_alloc(length=28)
pbuf_alloc(length=28) == 0x30004008
etharp_raw: sending raw ARP packet.
pbuf_add_header: old 0x30004028 new 0x3000401a (14)
ethernet_output: sending packet 0x30004008
pbuf_free: deallocating 0x30004008
etharp_timer
etharp_timer
---
---
ethernet_input: dest:0hx:0hx:0hx:0hx:0hx:0hx, src:0hx:0hx:0hx:0hx:0hx:0hx, type:ff
pbuf_remove_header: old 0x30004480 new 0x3000448e (14)
etharp_update_arp_entry: XXX.XXX.XXX.XXX - XX:XX:XX:XX:XX:XX
etharp_input: incoming ARP request
etharp_input: ARP request was not for us.
pbuf_free: deallocating 0x30004460
---
---
netif: added interface st IP addr 0.0.0.0 netmask 0.0.0.0 gw 0.0.0.0
netif: setting default interface st
dhcp_start(): mallocing new DHCP client
dhcp_start(): starting DHCP configuration
udp_bind: bound to 0.0.0.0, port 68
udp_connect: connected to 0.0.0.0, port 67
dhcp_discover()
pbuf_alloc(length=308) == 0x30004044
transaction id xid(4bb5f646)
dhcp_discover: making request
dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, LWIP_IANA_PORT_DHCP_SERVER)
pbuf_add_header: old 0x3000408c new 0x30004084 (8)
udp_send: sending datagram of length 316
ip4_output_if: st0
IP header:
| 0 | 0 | 0 | 0 | (src)
| 255 | 255 | 255 | 255 | (dest)
pbuf_free: deallocating 0x30004044
dhcp_discover(): set request timeout 2000 msecs
---
---
dhcp_fine_tmr(): request timeout
dhcp_timeout()
dhcp_timeout(): restarting discovery
...
dhcp_discover(): set request timeout 4000 msecs
...
dhcp_discover(): set request timeout 8000 msecs
---
Since DHCP was not working. I had to apply a static IP.
I have also tried to follow the example provided but to no avail. I'm frustrated as it is not working for a long time.
I have enabled the MPU and also edited the flash linker script.
Kindly help me out to debug this issue.
2025-06-21 5:56 AM
@Zainulabedeen wrote:Kindly help me out to debug this issue.
You could start by reviewing previous threads on this topic:
and knowledge base articles:
LwIP debugging options:
2025-06-21 10:25 AM
Thanks @Andrew Neil for suggesting these all. However, i have already gone through these all. I think I'm facing something else as i have made sure to check the problems others have pointed out already. I have already enabled the debug log as some i have already attached above.
One thing to note is stm32 do recieve an arp request and that happens only once once i re-debug the stm32. However that request doesn't come for stm32. That means the router is never making a request for arp with ip of stm32 that i statically assigned, right? Which is making the problem with router itself?
However, only one arp request comes and stm32 never receive another arp request from that point on. Is there something to make stm32 receive arp regularly? Cuz i try to ping my IP from PC and that should generate a arp request for the IP i assigned but no logs come not even like the one that if the arp requested was for me or not.
2025-06-21 11:16 AM
Please begin from a ready example for this nucleo: (choose M7 or M4 processor)
https://github.com/stm32-hotspot/STM32H7-LwIP-Examples/tree/main/STM32H745_Nucleo_M7_ETH
Get it running in your environment before making any change.