Ethernet does not work if uC starts with the cable disconnected
When starting uC (or performing a reset) with the cable connected to the router, ping.exe receives a response normally. If the cable is removed, ping.exe does not receive a response, but after reconnecting, ping.exe receives a response.
The problem is that if the cable is disconnected, and the uC is initialized, then ping.exe does not receive a response, obviously due to the disconnected cable. But after connecting the cable, ping.exe still doesn't get a response.
I tried to force the execution of MX_LWIP_Init () but it didn't work, even if the Ethernet is already responding to ping.exe, it will stop responding if I call MX_LWIP_Init () again.
I noticed that MX_LWIP_Init () has a long timeout, 5000ms, but even so, I can't get it to work without restarting uC.
Note: DHCP: off. External PHY: LAN8720. uC: STM32F407VG.
I tested a code made with Arduino IDE, and it happens the same way it happens in STM32CubeIDE.
How to reset the Ethernet, without having to restart the uC?
