esp_event_loop & ethernet events
Posted: Wed Apr 15, 2020 11:42 am
Using v4.1-dev-2079-g5dbabae9d (SHA-1: 5dbabae9dc32da3e639a0531b5337848a9e3317a)
When Ethernet is disconnected it appears that the mDNS component will work itself into a blocked state (runs out of TX buffer) a few minutes after disconnection.
The obvious answer seemed to be to call mdns_free() from ETHERNET_EVENT_DISCONNECTED and mdns_init() from ETHERNET_EVENT_CONNECTED
Calling mdns_free() from the event loop causes an exception (always corrupted) however:
I have increased 'sys_evt' stack to same size as main (8K) but no help.
I can call mdns_free() from main though.
What am I missing? What else do I need to increase? Why cannot I call from sys_evt?
PS
It may also help to clarify how an application is supposed to behave with CONNECTED and DISCONNECTED events.
When Ethernet is disconnected it appears that the mDNS component will work itself into a blocked state (runs out of TX buffer) a few minutes after disconnection.
The obvious answer seemed to be to call mdns_free() from ETHERNET_EVENT_DISCONNECTED and mdns_init() from ETHERNET_EVENT_CONNECTED
Calling mdns_free() from the event loop causes an exception (always corrupted) however:
Code: Select all
Guru Meditation Error: Core 0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x3ffe358c PS : 0x00060530 A0 : 0x801a0bf9 A1 : 0x3ffbdff0
A2 : 0x3ffbd18c A3 : 0x3ffe31f4 A4 : 0x00000001 A5 : 0x3f41b998
A6 : 0x00000003 A7 : 0x3ffc38d8 A8 : 0x801a1049 A9 : 0x3ffbdfd0
A10 : 0x00000000 A11 : 0x3f41b998 A12 : 0x00000003 A13 : 0x3ffc38d8
A14 : 0x00000000 A15 : 0x3ffbd468 SAR : 0x00000004 EXCCAUSE: 0x00000014
EXCVADDR: 0x3ffe358c LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff
ELF file SHA256: 6254e987019a6ff52206d792cafb78006f208acc7612c41c605c4e29a692b1b7
Backtrace: 0x3ffe3589:0x3ffbdff0 |<-CORRUPTED
I can call mdns_free() from main though.
What am I missing? What else do I need to increase? Why cannot I call from sys_evt?
PS
It may also help to clarify how an application is supposed to behave with CONNECTED and DISCONNECTED events.