BLE Advertising Crash

mlivingstone
Posts: 1
Joined: Tue Nov 26, 2019 4:16 pm

BLE Advertising Crash

Postby mlivingstone » Wed Nov 27, 2019 2:52 pm

Hello,

I am currently running into an issue with BLE advertising causing a core panic. This is 100% reproducible with minimal code.

It will always crash after attempting to start advertising after the controller has been disabled and re-enabled.

After setting up BLE, the following task can be run to cause a crash (Note, some code has not been included, but its the ble_adv example with some minor modifications).

Code: Select all

void bleAdvtTask(void *pvParameters)
{
    int cmd_cnt = 0;
    bool send_avail = false;
    esp_vhci_host_register_callback(&vhci_host_cb);
    printf("BLE advt task start\n");
    while (1) {
        vTaskDelay(1000 / portTICK_PERIOD_MS);
        send_avail = esp_vhci_host_check_send_available();
        if (send_avail) {
            switch (cmd_cnt) {
            case 0: bt_controller_enable(); ++cmd_cnt; break;
            case 1: hci_cmd_send_reset(); ++cmd_cnt; break;
            case 2: hci_cmd_send_ble_set_adv_param(); ++cmd_cnt; break;
            case 3: hci_cmd_send_ble_set_adv_data(); ++cmd_cnt; break;
            case 4: hci_cmd_send_ble_adv_start(); ++cmd_cnt; break;
            case 5: hci_cmd_send_ble_adv_stop(); ++cmd_cnt; break;
            case 6: bt_controller_disable(); ++cmd_cnt; break;
            }
        }
        printf("BLE Advertise, flag_send_avail: %d, cmd_sent: %d\n", send_avail, cmd_cnt);
        cmd_cnt %= 6 + 1;
    }
}
Here is the monitor output when it crashes

Code: Select all

ASSERT_PARAM(512 0), in rwble.c at line 235
Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0)
Core 0 register dump:
PC      : 0x40086a09  PS      : 0x00060034  A0      : 0x8008a8fc  A1      : 0x3ffbe260
0x40086a09: r_assert_param at ??:?

A2      : 0x00000001  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x60008054
A6      : 0x3ffbdbb4  A7      : 0x60008050  A8      : 0x80086a09  A9      : 0x3ffbe240
A10     : 0x00000004  A11     : 0x00000000  A12     : 0x6000804c  A13     : 0xffffffff
A14     : 0x00000000  A15     : 0xfffffffc  SAR     : 0x00000004  EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000  LBEG    : 0x40086941  LEND    : 0x40086948  LCOUNT  : 0x00000000
0x40086941: r_assert_param at ??:?

0x40086948: r_assert_param at ??:?

Core 0 was running in ISR context:
EPC1    : 0x400fd8b2  EPC2    : 0x00000000  EPC3    : 0x00000000  EPC4    : 0x40086a09
0x400fd8b2: esp_pm_impl_waiti at C:/Users/livingstonem/Downloads/esp-idf/components/esp32/pm_esp32.c:487

0x40086a09: r_assert_param at ??:?


ELF file SHA256: 7fa51598400cbe5f99bb6df66b77edec1e93f6a2ae016aecc22e1b3798268820

Backtrace: 0x40086a09:0x3ffbe260 0x4008a8f9:0x3ffbe280 0x4008b4e7:0x3ffbe2a0 0x40082c25:0x3ffbe2c0 0x400fd8af:0x3ffbbc80 0x400d2d17:0x3ffbbca0 0x4008ebe5:0x3ffbbcc0 0x4008d15d:0x3ffbbce0
0x40086a09: r_assert_param at ??:?

0x4008a8f9: r_rwble_isr at ??:?

0x4008b4e7: r_rwbtdm_isr_wrapper at intc.c:?

0x40082c25: _xt_lowint1 at C:/Users/livingstonem/Downloads/esp-idf/components/freertos/xtensa_vectors.S:1154

0x400fd8af: esp_pm_impl_waiti at C:/Users/livingstonem/Downloads/esp-idf/components/esp32/pm_esp32.c:487

0x400d2d17: esp_vApplicationIdleHook at C:/Users/livingstonem/Downloads/esp-idf/components/esp32/freertos_hooks.c:86

0x4008ebe5: prvIdleTask at C:/Users/livingstonem/Downloads/esp-idf/components/freertos/tasks.c:4560

0x4008d15d: vPortTaskWrapper at C:/Users/livingstonem/Downloads/esp-idf/components/freertos/port.c:403


Core 1 register dump:
PC      : 0x400fd8b2  PS      : 0x00060634  A0      : 0x800d2d1a  A1      : 0x3ffbc3f0
0x400fd8b2: esp_pm_impl_waiti at C:/Users/livingstonem/Downloads/esp-idf/components/esp32/pm_esp32.c:487

A2      : 0x00000000  A3      : 0x80000001  A4      : 0x00000000  A5      : 0x00000001
A6      : 0x00000003  A7      : 0x00060023  A8      : 0x800d29fa  A9      : 0x3ffbc3c0
A10     : 0x00000000  A11     : 0x00060623  A12     : 0x00060620  A13     : 0x00000001
A14     : 0x00060620  A15     : 0x3ffbd310  SAR     : 0x00000000  EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000

ELF file SHA256: 7fa51598400cbe5f99bb6df66b77edec1e93f6a2ae016aecc22e1b3798268820

Backtrace: 0x400fd8b2:0x3ffbc3f0 0x400d2d17:0x3ffbc410 0x4008ebe5:0x3ffbc430 0x4008d15d:0x3ffbc450
0x400fd8b2: esp_pm_impl_waiti at C:/Users/livingstonem/Downloads/esp-idf/components/esp32/pm_esp32.c:487

0x400d2d17: esp_vApplicationIdleHook at C:/Users/livingstonem/Downloads/esp-idf/components/esp32/freertos_hooks.c:86

0x4008ebe5: prvIdleTask at C:/Users/livingstonem/Downloads/esp-idf/components/freertos/tasks.c:4560

0x4008d15d: vPortTaskWrapper at C:/Users/livingstonem/Downloads/esp-idf/components/freertos/port.c:403


Rebooting...
There has been an open issue on GitHub since December of 2018 with this exact issue, but I'm wondering if anyone has worked around this before?

Thanks.

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: BLE Advertising Crash

Postby chegewara » Thu Nov 28, 2019 11:47 am

And how exactly you re-init BLE, full procedure?

msn444
Posts: 9
Joined: Mon Jun 25, 2018 11:22 pm

Re: BLE Advertising Crash

Postby msn444 » Fri Aug 21, 2020 4:48 pm

Has this been resolved? I am experiencing the same thing.

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot], snutw_ and 69 guests