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.
2025-06-23 2:47 AM
@Zainulabedeen You could compare your configuration with the one posted in this thread. It might be as simple as an incorrect MPU configuration or insufficient heap memory size. Ensure you review the adjustments made by the user that enabled the example to work on the NUCLEO-H755ZI-Q:
2025-06-23 11:17 AM
I just cloned the git, changed the IP from lwip.c file and it started to work. It appears i was configuring the MPU a bit wrong too. However, when i tried to configure everything the same as in the example without RTOS, ethernet, MPU and lwip. It still didn't work.
Do you have any idea about it? and Thanks for the help.
A question: Why it worked even though the SoC was stm32h745 but mine is stm32h755, is it because both of these SoC shares almost the architecture ?
2025-06-23 11:21 AM
I tried to clone the example you are suggesting, changed the IP and Disable DCHP but it didn't work for me. However, as the @Pavel A. suggested me an example repo, i changed its ip and it start pinging but the example use RTOS. I changed the configuration of my board just like in the example given by @Pavel A. without RTOS and it didn't work then. What should i look at ?
Thanks for the help.
2025-06-24 2:44 AM
@Zainulabedeen wrote:
I just cloned the git, changed the IP from lwip.c file and it started to work. It appears i was configuring the MPU a bit wrong too. However, when i tried to configure everything the same as in the example without RTOS, ethernet, MPU and lwip. It still didn't work.
Do you have any idea about it? and Thanks for the help.
You can use a feature in STM32CubeMX that allows you to compare two projects by providing their .ioc
files. This tool gives you a side-by-side comparative view of the configurations, which can help identify differences between the project provided in STM32_Hotspot and your project. It might help you spot any configuration mismatches causing the issue.
A question: Why it worked even though the SoC was stm32h745 but mine is stm32h755, is it because both of these SoC shares almost the architecture ?
Yes, both the STM32H745 and STM32H755 microcontrollers share a highly similar architecture, allowing code written for one to often work on the other. However, the STM32H755 offers enhanced performance and additional features, including improved cryptographic capabilities, more advanced peripherals, and expanded memory configurations. It is designed for applications that require higher security and performance, while the STM32H745 is better suited for general-purpose use.
2025-06-24 2:55 AM - edited 2025-06-24 2:56 AM
@STackPointer64 wrote:You can use a feature in STM32CubeMX that allows you to compare two projects by providing their .ioc files. .
Ooh - a new feature!
Appears to have been added in 6.13.0 ?
#CubeMXCompareProjects #CompareIOC
2025-06-24 11:35 AM
Once STM32H7 ETH examples without RTOS were available, but these are no longer provided for all boards.
Getting ETH working is still harder than it could be.