Closed JanB97 closed 3 months ago
Okay, I finally figured it out. I unconsciously updated the ESP32 Board Library to version 3, this seems to break nimble as some apis where changed.
Thanks to @JanB97 for posting this. I experienced this as well and downgrading the board to 2.x solved it for me.
@h2zero, just to add more data for this:
Using "esp32" board library version 3.0.0-rc1, the "ESP32S3 Dev Module" board, and the following test code in Arduino IDE version 2.3.2:
#include <NimBLEDevice.h>
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Begin setup...");
NimBLEDevice::init("");
// Delaying here just to allow time to reset/boot device during upload
delay(10000);
NimBLEScan* pScan = NimBLEDevice::getScan();
Serial.println("Going to start scanning...");
pScan->start(5, false); // crash happens here
Serial.println("esp32 3.0.0-rc will never get here.");
}
void loop() {
}
I see the following output:
13:58:40.995 -> Begin setup...
13:58:50.356 -> Going to start scanning...
13:58:50.356 -> Guru Meditation Error: Core 0 panic'ed (Unhandled debug exception).
13:58:50.356 -> Debug exception reason: Stack canary watchpoint triggered (ipc0)
13:58:50.356 -> Core 0 register dump:
13:58:50.356 -> PC : 0x40382a9e PS : 0x00060036 A0 : 0x80381068 A1 : 0x3fcf0bc0
13:58:50.356 -> A2 : 0x3fc97c04 A3 : 0xffffffff A4 : 0x00060023 A5 : 0x00060023
13:58:50.388 -> A6 : 0xb33fffff A7 : 0xb33fffff A8 : 0x80382c31 A9 : 0x3fc99420
13:58:50.388 -> A10 : 0x00060023 A11 : 0x00000001 A12 : 0x00060021 A13 : 0x00000001
13:58:50.388 -> A14 : 0x03c97b48 A15 : 0x3fc97b48 SAR : 0x00000004 EXCCAUSE: 0x00000001
13:58:50.388 -> EXCVADDR: 0x00000000 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0xffffffff
13:58:50.419 ->
13:58:50.419 ->
13:58:50.419 -> Backtrace: 0x40382a9b:0x3fcf0bc0 0x40381065:0x3fcf0bf0 0x40382e28:0x3fcf0c20 0x40382e1e:0xa5a5a5a5 |<-CORRUPTED
13:58:50.419 ->
13:58:50.419 ->
13:58:50.419 ->
13:58:50.419 ->
13:58:50.419 -> ELF file SHA256: 5f00d74f42bdbacf
13:58:50.419 ->
13:58:50.419 -> Rebooting...
13:58:50.419 -> ESP-ROM:esp32s3-20210327
13:58:50.419 -> Build:Mar 27 2021
13:58:50.419 -> rst:0xc (RTC_SW_CPU_RST),boot:0x2b (SPI_FAST_FLASH_BOOT)
13:58:50.419 -> Saved PC:0x403775a1
13:58:50.451 -> SPIWP:0xee
13:58:50.451 -> mode:DIO, clock div:1
13:58:50.451 -> load:0x3fce3818,len:0x508
13:58:50.451 -> load:0x403c9700,len:0x4
13:58:50.451 -> load:0x403c9704,len:0xad0
13:58:50.451 -> load:0x403cc700,len:0x29d8
13:58:50.451 -> entry 0x403c9880
Once I downgraded esp32 from 3.0.0-rc to 2.0.16 the test code worked fine.
Hello there, unfortunetely I need some help. I had a already somewhat working programm I made last year.
I decided to finally pick the programm up again, opened the INO, changed just the BLEDevice name aaaaand my programm crashed the esp32 after flashing. I then used a new (never flashed) esp32 and put the server example on it and it crashed again. I am not really sure whats happening here, the Nimble Version is 1.4.1, also tried older ones. Arduino IDE is version 2.3.2, I will post the log here if anyone would be so kind a help me figure this out. I also tried the older BLE implementation, that seems to work (Neil Kolban), but I would like to use nimble to use my existing work.
The crash seems to happen on BLEDevice::startAdvertising();