cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-H755ZI-Q Ethernet ping not working

Zainulabedeen
Associate II

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

---

 

Zainulabedeen_0-1750504442703.pngZainulabedeen_1-1750504469903.pngZainulabedeen_2-1750504552112.png

 

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.

12 REPLIES 12

Ok, i got it working without RTOS. I removed the RTOS part from the example and started comparing it my own code. 

What got it working was i changed the timebase of M7 core to timer 6 from systick and then i set the priority of systick interrupt to 15 from 0.

Before that i was getting mem of pbuf failed to allocate 60 byte but after changing just the timebase to Timer 6 and setting priority of systick from 15 to 0 on M7 everything started working. Any idea how are they even linked?

 

@Andrew Neil @Pavel A. @STackPointer64 

after changing just the timebase to Timer 6 and setting priority of systick from 15 to 0 on M7 everything started working. 

So, without a RTOS you use TIM6 as the HAL timer, and what is its priority?  What is systick used for?

 

Yes, used TIM6 as HAL timer, its priority can either from 0 to 15 it don't matter. It is working very good with that. I think I'm not using systick anywhere else. It is still the HAL timer for M4 core tho. But i don't think so its being used in M7 anymore.

Any clue what that is the case?