Exception 0: illegal instruction after espalexa.loop()
GoTVm opened this issue · 0 comments
GoTVm commented
I have no idea what I'm doing wrong. I used Espalexa on its own already, now I'm trying to implement it alongside ESPNOW but I always get this crash:
Exception 0: Illegal instruction
PC: 0x40201046
EXCVADDR: 0x00000000
Decoding stack results
0x4020f6cd: std::_Function_handler ::_M_invoke(std::_Any_data const&, unsigned char&&) at c:\users\ricca\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\bits/std_function.h line 289
0x4020a2ac: EspalexaDevice::doCallback() at C:\Users\ricca\Documents\Arduino\libraries\Espalexa-master\src\EspalexaDevice.cpp line 340
0x4020b18d: String::invalidate() at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/WString.h line 295
0x40203723: Espalexa::handleAlexaApiCall(String, String) at C:\Users\ricca\Documents\Arduino\libraries\Espalexa-master\src/Espalexa.h line 532
0x401001a8: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_main.cpp line 181
0x40100cdf: malloc(size_t) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 821
0x40100cdc: malloc(size_t) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 821
0x4020fbb0: Adafruit_GFX::writeFillRect(short, short, short, short, unsigned short) at C:\Users\ricca\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp line 238
0x4020b691: String::concat(char const*, unsigned int) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\WString.cpp line 309
0x40100cdc: malloc(size_t) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 821
0x40100d14: realloc(void*, size_t) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 853
0x40100ad3: umm_free_core(umm_heap_context_t*, void*) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 549
0x40100cb2: free(void*) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 595
0x4010065c: vPortFree(void*, char const*, int) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\heap.cpp line 322
0x40100cdc: malloc(size_t) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 821
0x40100cdc: malloc(size_t) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 821
0x40100d14: realloc(void*, size_t) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 853
0x4020c510: __esp_yield() at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_main.cpp line 116
0x4020d59a: __delay(unsigned long) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_wiring.cpp line 54
0x4020b25d: String::changeBuffer(unsigned int) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\WString.cpp line 202
0x4020b2d3: String::reserve(unsigned int) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\WString.cpp line 153
0x4020b344: String::copy(char const*, unsigned int) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\WString.cpp line 225
0x4020b450: String::operator=(String const&) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/WString.h line 277
0x4020385c: Espalexa::serveNotFound() at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer-impl.h line 567
0x40203890: std::_Function_handler ::_M_invoke(std::_Any_data const&) at C:\Users\ricca\Documents\Arduino\libraries\Espalexa-master\src/Espalexa.h line 274
0x401000e9: std::function ::operator()() const at c:\users\ricca\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\bits/std_function.h line 617
0x402033aa: esp8266webserver::ESP8266WebServerTemplate ::_handleRequest() at c:\users\ricca\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\bits/std_function.h line 498
0x4010051d: millis() at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_wiring.cpp line 193
0x402040ea: esp8266webserver::ESP8266WebServerTemplate ::handleClient() at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WebServer\src/ESP8266WebServer-impl.h line 274
0x4020427f: Espalexa::loop() at C:\Users\ricca\Documents\Arduino\libraries\Espalexa-master\src/Espalexa.h line 363
0x4020b450: String::operator=(String const&) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/WString.h line 277
0x4020440a: loop() at C:\Users\ricca\AppData\Local\Temp\arduino_modified_sketch_847386/Control_panel.ino line 197
0x402055f9: setup() at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266/WString.h line 79
0x4020f6c0: std::_Function_handler ::_M_invoke(std::_Any_data const&, unsigned char&&) at c:\users\ricca\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\include\c++\10.3.0\bits/std_function.h line 289
0x401001a8: ets_post(uint8, ETSSignal, ETSParam) at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_main.cpp line 181
0x4020c630: loop_wrapper() at C:\Users\ricca\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\cores\esp8266\core_esp8266_main.cpp line 201
This is the code:
Espalexa espalexa;
EspalexaDevice* mobile;
EspalexaDevice* tavolo;
bool funcCB(EspalexaDevice* dev, bool devon, int id) {
if ((bool)dev->getValue() != devon) {
devon = (bool)dev->getValue();
switch (id) {
case 1:
memcpy(packet.request, "on", sizeof(packet.request));
esp_now_send(table, (uint8_t *)&packet, sizeof(packet));
break;
case 2:
memcpy(packet.request, "on", sizeof(packet.request));
esp_now_send(cabinet, (uint8_t *)&packet, sizeof(packet));
break;
}
}
}
bool tavoloOn;
bool mobileOn;
void mobileCB(uint8_t br){
funcCB(mobile, mobileOn, 2);
}
void tavoloCB(uint8_t br){
funcCB(tavolo, tavoloOn, 1);
}
void setup(){
....
mobile = new EspalexaDevice(MOBILE_NAME, mobileCB);
tavolo = new EspalexaDevice(TAVOLO_NAME, tavoloCB);
espalexa.addDevice(mobile);
espalexa.addDevice(tavolo);
espalexa.begin();
}
void loop(){
espalexa.loop();
...
}
The loop does a whole lot of stuff apart from handling alexa (tft screen control, espnow data sending..).