nkolban / esp32-snippets

Sample ESP32 snippets and code fragments
https://leanpub.com/kolban-ESP32
Apache License 2.0
2.33k stars 709 forks source link

BLE abort in getCharacteristics #736

Open yuyi1005 opened 5 years ago

yuyi1005 commented 5 years ago

My program is similar to the BLE_client example, collecting data from a BLE server which supports only "notify" characteristic, but it crashes on finding characteristic.

I am using the latest code in esp32-snippets updated 2 days ago (commit 45fcc07).

My code works almost well before updating the BLE module, and I didn't change anything in my own code (just update the BLE module and recompile).

Here is the log:

Core Debug Level: "Error" Found our device! Forming a connection to 5a:40:00:01:8a:8a Connected to server Found our service

Stack smashing protect failure!

abort() was called at PC 0x4015974f on core 1

Core Debug Level: "Debug" [D][BLEClient.cpp:433] getServices(): << getServices [D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown [D][BLEClient.cpp:393] getService(): << getService: found the service with uuid: 49535343-fe7d-4ae5-8fa9-9fafd205e455 [D][BLEClient.cpp:162] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown Found our service [D][BLERemoteService.cpp:165] retrieveCharacteristics(): >> getCharacteristics() for service: 49535343-fe7d-4ae5-8fa9-9fafd205e455 Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled. Core 1 register dump: PC : 0x40081308 PS : 0x00060c30 A0 : 0x800d93d5 A1 : 0x3ffceea0
A2 : 0xa3481c91 A3 : 0x00000000 A4 : 0x00000028 A5 : 0x00000032
A6 : 0x3ffcef12 A7 : 0x3ffceefc A8 : 0xa3481c91 A9 : 0x3ffcee60
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x00000001 A13 : 0x00000000
A14 : 0x3ffceefc A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x0000001c
EXCVADDR: 0xa3481c91 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0xffffffff

Backtrace: 0x40081308:0x3ffceea0 0x400d93d2:0x3ffceec0 0x400d9776:0x3ffcef80 0x400d215e:0x3ffcefe0 0x400d354b:0x3ffcf030 0x401bb1c0:0x3ffcf050 0x4009492d:0x3ffcf070

chegewara commented 5 years ago

https://github.com/espressif/arduino-esp32#decoding-exceptions

There is a lot Stack smashing problems, but i didnt have any so i cant find the reason without proper backtrace decode. Sorry for inconvenience.