Skip to main content
Associate II
Nov 10, 2026 10:18 AM UTC
Question

HTTP Server issue

Hello everyone,

I am using an STM32H755ZI-Q Nucleo board and I am trying to run a small test project using an Ethernet connection between my board and my computer.

The goal is to set up a simple HTTP server with two buttons (ON/OFF) that allow me to turn LED3 on and off remotely through a web browser.

However, I am experiencing an inconsistent connection issue. The project only works approximately 1 out of 5 times. Whenever I disconnect the board from my computer and run the code again, the Ethernet connection seems to take too long to establish, preventing the HTTP server from starting properly.

The strange thing is that the exact same code can work perfectly one moment, and then fail a few minutes later after simply disconnecting and reconnecting the board. No changes are made to the code.

Has anyone experienced a similar issue or have any idea what could be causing this behavior?

Any help or suggestions would be greatly appreciated!

Thank you in advance!

6 replies

MGogr.1
Senior
Nov 10, 2026 11:33 AM UTC

I hope you must have verified hardware connection(ethernet cable, ip address, adapter settings). Are you able to ping the board every time??

Lin_MeAuthor
Associate II
Nov 10, 2026 12:32 PM UTC

No, I can’t always ping it, when i try it says that the delay time is over

Andrew Neil
Super User
Nov 10, 2026 12:42 PM UTC

Some more details about your setup would help: 

 

In particular, what IP stack are you using?

Is it an ST provided example? 

If not, have you tried an ST-provided example?

 

What testing/investigation/debugging have you done to find out what’s going on?

eg, code instrumentation; Wireshark traces; etc ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Lin_MeAuthor
Associate II
Nov 10, 2026 1:02 PM UTC
  • IP stack : LWIP
  • No it’s not an ST provided example
  • I haven’t 
  • I have 2 other leds that i use to signal that the code is runinng and to confirm that the ethernet link is established and both of them work properly

It works when i keep running the code over and over again

Andrew Neil
Super User
Nov 10, 2026 3:07 PM UTC
  • IP stack : LWIP

Enable the LwIP diagnostics:

 

  • No it’s not an ST provided example

So try an ST example

 

I have 2 other leds

That gives minimal information - in addition to the LwIP diagnostics (above) add logging/tracing to your own code to see what’s going on

 

It works when i keep running the code over and over again

Not sure what you mean by that?

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
ST Employee
Nov 10, 2026 2:12 PM UTC

Hello,

Since ping also fails intermittently, please troubleshoot Ethernet/IP startup separately from the HTTP server. The PHY link LED confirms a physical connection, but it does not confirm that the Ethernet MAC/DMA and LwIP network interface are ready.

As a reference, please review the STM32CubeH7 LwIP examples. In the example’s ethernetif.c, a task periodically polls the PHY link state. When the link comes up, it configures the MAC speed and duplex mode, starts Ethernet, and marks the LwIP interface up. The network-interface setup and link-monitor task creation are in main.c.

If your application checks the PHY only once during startup, it may check before auto-negotiation completes and fail to bring the interface up. Please compare your initialization with these reference files. Once ping is reliable, test the HTTP server again.

 

With Regards,

If your question is answered, please close this topic by clicking ""Accept as Solution"".