yubox-node-org / AsyncTCPSock

Reimplementation of the API of me-no-dev/AsyncTCP using high-level BSD sockets
GNU Lesser General Public License v3.0
20 stars 10 forks source link

InstrFetchProhibited crash on WiFi functions when using this library. #16

Open zekageri opened 1 year ago

zekageri commented 1 year ago

Board crashes on wifi instruction calls.

I have tried with WiFi.softAPConfig(apIP, apIP, netMsk); And WiFi.mode(WIFI_STA); Even on ethernet cb setup.

Crash:

[  2246][D][WiFiGeneric.cpp:929] _eventCallback(): Arduino Event: 0 - WIFI_READY
Guru Meditation Error: Core  1 panic'ed (InstrFetchProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x0c004136  PS      : 0x00060930  A0      : 0x800e1d78  A1      : 0x3ffb2360  
A2      : 0x00000000  A3      : 0x401a41e8  A4      : 0x3ffb2470  A5      : 0x00000000  
A6      : 0x3ffb8a28  A7      : 0x00000000  A8      : 0x800e1d3e  A9      : 0x3ffb2300  
A10     : 0x3ffb2470  A11     : 0x401a41e8  A12     : 0x00000002  A13     : 0x00000001  
A14     : 0x00060b20  A15     : 0x00000001  SAR     : 0x00000020  EXCCAUSE: 0x00000014
EXCVADDR: 0x0c004134  LBEG    : 0x4008bd2d  LEND    : 0x4008bd3d  LCOUNT  : 0xfffffffd

Backtrace:0x0c004133:0x3ffb23600x400e1d75:0x3ffb2380 0x400e1e2d:0x3ffb23a0 0x400e232c:0x3ffb2530 

  #0  0x0c004133:0x3ffb2360 in ?? ??:0
  #1  0x400e1d75:0x3ffb2380 in WiFiEventCbList::WiFiEventCbList(WiFiEventCbList const&) at C:/Users/zekag/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.cpp:740
  #2  0x400e1e2d:0x3ffb23a0 in WiFiGenericClass::_eventCallback(arduino_event_t*) at C:/Users/zekag/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.cpp:1050
  #3  0x400e232c:0x3ffb2530 in _arduino_event_task(void*) at C:/Users/zekag/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src/WiFiGeneric.cpp:303

ELF file SHA256: 0000000000000000

Rebooting...

Crash does not happen with https://github.com/khoih-prog/AsyncTCP_SSL nor with the official Async tcp library.

Sketch is the same in every case.

I'm using PIO with the following config:

PLATFORM: Espressif 32 (5.2.0) > Espressif ESP-WROVER-KIT
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
- framework-arduinoespressif32 @ 3.20005.220925 (2.0.5) 
 - tool-esptoolpy @ 1.40201.0 (4.2.1) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3

Libraries used are:

https://github.com/yubox-node-org/AsyncTCPSock https://github.com/yubox-node-org/ESPAsyncWebServer

avillacis commented 1 year ago

Do you have a minimal sketch that will reproduce this crash?

Could you please specify the branches and commit tips at which you downloaded snapshots of the libraries?

Does your crashing sketch require SSL support?

Does the crash occur on sketch startup? Or does it occur when handling an incoming http request?

At which point in the lifetime of the sketch does it attempt to call begin() on the AsyncWebServer instance? Right in the body of the setup() function? Inside one of the wifi callbacks? Or some other way?

zekageri commented 1 year ago

Sorry for not including a sketch. I will make one today.

The sketch does not reach server begin, it crashes as soon as I touch any built in WiFi method and crashes with the same error no matter what method I call.

It does not require SSL and I do not initialize any SSL related stuff.

Both of the libraries are from the main brach.