Page 1 of 1

esp_eth_disable / deinit causes freeze of system

Posted: Tue May 14, 2019 8:34 am
by bewatermyfriendxd
Hello,

Im currently having a problem with the Ethernet interface of my ESP32.
In my webserver code I have an event handler, which logs the current state of the ethernet interface.

Normally it should be like this:

Code: Select all

I (5948) webserver: SYSTEM_EVENT_AP_START
I (10258) webserver: a station connected to ESP32 soft-AP
I (25688) Ethernet: Eth enable retval : 0
I (25688) webserver: SYSTEM_EVENT_ETH_START : ESP32 ethernet start
I (29688) webserver: SYSTEM_EVENT_ETH_CONNECTED  : ESP32 ethernet phy link up
In some cases when I boot up my device something strange happens to the ethernet device.
Then I get a log output like this.

Code: Select all

I (5948) webserver: SYSTEM_EVENT_AP_START
I (10258) webserver: a station connected to ESP32 soft-AP
I (25688) Ethernet: Eth enable retval : 0
I (25688) webserver: SYSTEM_EVENT_ETH_START : ESP32 ethernet start
--> At this point the whole system is freezing 
I get the event that the ethernet interface has been initialized, however it is not able to create the link to the connected LAN device. Something must have gone wrong at the initialization stage (still got return value ESP_OK). At this point the system completely freezes when calling esp_eth_disable() or esp_eth_deinit. A reboot is necessary.

What might be the cause for this issue ?

I'll appreciate any help. Thanks for the support.

Re: esp_eth_disable / deinit causes freeze of system

Posted: Fri May 17, 2019 9:32 am
by bewatermyfriendxd
Stupid but working:

Call esp_eth_init in a for loop several times. Never had any crash again.