esp_eth_disable() crash

thethinker
Posts: 39
Joined: Thu Mar 01, 2018 1:26 am

esp_eth_disable() crash

Postby thethinker » Sun Jan 06, 2019 9:08 am

HI guys,
So I have came across an issue with lan8720 and pico-d4. I noticed there is no IP lost timer for ETH interface, so If my link is up and I lost IP I won't know about it (ex: if router gets disconnected from a switch that esp is connected to).
My attempt to fix the issue:
--Ping the gateway address and if I get too many timeouts then disable and re-enable the eth interface that way I know when I get my IP back again.

However the issue is that calling either esp_eth_disable() or esp_eth_deinit() results in a weird situation which looks like a halt.
After the call I get:
D (28658) emac: emac stop
D (28659) emac: eth link_down
after these two lines, everything stops and the watchdog doesn't even reset the esp.

Can someone please test and confirm this? I haven't been able to pinpoint the issue yet.

Thanks! :geek:

thethinker
Posts: 39
Joined: Thu Mar 01, 2018 1:26 am

Re: esp_eth_disable() crash

Postby thethinker » Sun Jan 06, 2019 8:22 pm

Okay, so turns out the issue was an open UDP socket which is used by "esp_log_set_vprintf()" function (I'm sending logs to a server using udp socket).

I believe this is a bug?

stopping dhcp client for that socket does the same crash.

I solved it by closing the socket first but this should be handled properly in the API.

thethinker
Posts: 39
Joined: Thu Mar 01, 2018 1:26 am

Re: esp_eth_disable() crash

Postby thethinker » Sun Jan 06, 2019 10:02 pm

Okay,
I believe here is the bug that no one really ever fixed:
https://github.com/espressif/esp-idf/issues/1246

thethinker
Posts: 39
Joined: Thu Mar 01, 2018 1:26 am

Re: esp_eth_disable() crash

Postby thethinker » Sat Jan 12, 2019 11:48 pm

Hmm,
Really ? None of the ESP guys are willing to help?

Return to “ESP32 IDF”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], tiradedepirate and 22 guests