Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE assert rwble.c 445 -- ESP32-S3 BLE server while advertising with a client already connected #761

Open
benjie-git opened this issue Nov 26, 2024 · 1 comment

Comments

@benjie-git
Copy link

benjie-git commented Nov 26, 2024

I'm setting up an ESP32-S3 as a server that allows multiple clients to connect. It works well, but seemingly randomly, after 10min-2hours, the ESP32 resets with a BLE assert rwble.c 445, param 00400100 00000000 error.

I'm developing in Arduino IDE 2.3.3, with esp32 3.0.7, and NimBLE-Arduino 1.4.2.

I set up advertising like this:

    NimBLEServer *pServer = NimBLEDevice::createServer();
    ...
    NimBLEAdvertising *pAdvertising = pServer->getAdvertising();
    pAdvertising->setAppearance(GENERIC_HID);
    pAdvertising->addServiceUUID(serviceUUID);
    pAdvertising->start();

when I add the following lines before start(), the resets take longer to occur (which makes me think this could be a collision/timing issue between advertising packets and notifications?):

    pAdvertising->setMinInterval(1500);
    pAdvertising->setMaxInterval(2000);

in my callbacks, I re-enable advertising on connect and disconnect, so that more than one client can connect:

void BleConnectionStatus::onConnect(NimBLEServer *pServer, ble_gap_conn_desc* desc)
{
    pServer->updateConnParams(desc->conn_handle, 6, 15, 0, 300);
    this->connected++;
    if (!pServer->getAdvertising()->isAdvertising()) {
        pServer->startAdvertising(); // restart advertising
    }
}

void BleConnectionStatus::onDisconnect(NimBLEServer *pServer)
{
    this->connected--;
    if (!pServer->getAdvertising()->isAdvertising()) {
        pServer->startAdvertising(); // restart advertising
    }
}

If I don't re-enable advertising after connecting, then only one client can connect, but I do not get these resets.

When a reset occurs, this is what I'm seeing:

DIAG0~1:1000cea0,10000000
BB DIAG0~5:000b4605,d4001802,00000000,8e89bed6,00000000,00000000
FSMERR:00000010
BLE assert rwble.c 445, param 00400100 00000000
Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0). 

Core  0 register dump:
PC      : 0x40006fcb  PS      : 0x00060734  A0      : 0x8037c98c  A1      : 0x3fc9acf0  
A2      : 0x00400100  A3      : 0x00000000  A4      : 0x3c10839c  A5      : 0x000001bd  
A6      : 0x8e89bed6  A7      : 0x00000000  A8      : 0x00000001  A9      : 0x3fcef9e4  
A10     : 0x3fcef9e4  A11     : 0x00000001  A12     : 0x00400100  A13     : 0x00000000  
A14     : 0x00000001  A15     : 0xffffffff  SAR     : 0x00000005  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x40006fc4  LEND    : 0x40006fcb  LCOUNT  : 0x00000000  
Core  0 was running in ISR context:
EPC1    : 0x420dabb3  EPC2    : 0x00000000  EPC3    : 0x4037ef86  EPC4    : 0x40006fcb


Backtrace: 0x40006fc8:0x3fc9acf0 0x4037c989:0x3fc9ad10 0x4000ce63:0x3fc9ad40 0x40379e4f:0x3fc9ad60 0x40378f11:0x3fc9ad80 0x4037ef83:0x3fcf4b10 0x42024f05:0x3fcf4b30 0x40381eef:0x3fcf4b50 0x40383b76:0x3fcf4b70

Decoding stack results
0x4037ef83: esp_cpu_wait_for_intr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/xtensa/include/xt_utils.h:81
0x42024f05: esp_vApplicationIdleHook at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/freertos_hooks.c:46
0x40381eef: prvIdleTask at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4439
0x40383b76: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162


Core  1 register dump:
PC      : 0x4037ef86  PS      : 0x00060334  A0      : 0x82024f08  A1      : 0x3fcf50c0  
A2      : 0x00000000  A3      : 0xb33fffff  A4      : 0x80383e0d  A5      : 0x3fcebc50  
A6      : 0x00060023  A7      : 0x00000003  A8      : 0x00000014  A9      : 0x3fcf4ce8  
A10     : 0x80000001  A11     : 0xb33fffff  A12     : 0x80383e0d  A13     : 0x3fceba40  
A14     : 0x00060023  A15     : 0x00000003  SAR     : 0x00000000  EXCCAUSE: 0x00000005  
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000  


Backtrace: 0x4037ef83:0x3fcf50c0 0x42024f05:0x3fcf50e0 0x40381eef:0x3fcf5100 0x40383b76:0x3fcf5120

PC: 0x4037ef86: esp_cpu_wait_for_intr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/cpu.c:121

Decoding stack results
0x4037ef83: esp_cpu_wait_for_intr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/xtensa/include/xt_utils.h:81
0x42024f05: esp_vApplicationIdleHook at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/freertos_hooks.c:46
0x40381eef: prvIdleTask at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4439
0x40383b76: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162

Thanks for any help you can give me! Please let me know if you need any other info.

@h2zero
Copy link
Owner

h2zero commented Nov 26, 2024

Not sure what the issue could be, the error message is occurring in the controller binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants