[已解决] 蓝牙连接错误

mryboy
Posts: 6
Joined: Thu May 21, 2020 9:56 am

[已解决] 蓝牙连接错误

Postby mryboy » Wed Jun 23, 2021 3:26 am

我在手机连接ESP32的蓝牙时出现以下错误,ESP32用的经典蓝牙,GAP+SPP, IDF版本为v4.3,试过V4.4-dev也是如此;请问是怎么产生的,如何修复?谢谢

Code: Select all

I (2201) APP_MAIN: memory:internal ram = 177403 B, spi ram: 3198871 B

abort() was called at PC 0x400850d3 on core 0
0x400850d3: lock_acquire_generic at /root/esp-idf/components/newlib/locks.c:138


Backtrace:0x400945d6:0x3ffd9bd0 0x40094de1:0x3ffd9bf0 0x4009abfe:0x3ffd9c10 0x400850d3:0x3ffd9c80 0x4008522d:0x3ffd9cb0 0x40132c49:0x3ffd9cd0 0x4012bb93:0x3ffd9f90 0x4012bae6:0x3ffd9fe0 0x40099d1f:0x3ffda010 0x4009a8db:0x3ffda030 0x40081e8d:0x3ffda050 0x40081ed0:0x3ffda070 0x4009ac09:0x3ffda090 0x4012b19d:0x3ffda0b0 0x4011dae7:0x3ffda0d0 0x4011e0b9:0x3ffda150 0x4011e5c1:0x3ffda1c0 0x4011d4d7:0x3ffda1e0 0x40104d49:0x3ffda210 0x400f9500:0x3ffda270 0x400deb61:0x3ffda290 0x400f97c7:0x3ffda2e0 0x400f9b06:0x3ffda430 0x400f50a3:0x3ffda450 0x400f6439:0x3ffda470 0x4009836d:0x3ffda490
0x400945d6: panic_abort at /root/esp-idf/components/esp_system/panic.c:356

0x40094de1: esp_system_abort at /root/esp-idf/components/esp_system/system_api.c:112

0x4009abfe: abort at /root/esp-idf/components/newlib/abort.c:46

0x400850d3: lock_acquire_generic at /root/esp-idf/components/newlib/locks.c:138

0x4008522d: _lock_acquire_recursive at /root/esp-idf/components/newlib/locks.c:166

0x40132c49: _vfiprintf_r at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/stdio/vfprintf.c:853 (discriminator 2)

0x4012bb93: fiprintf at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/stdio/fiprintf.c:48

0x4012bae6: __assert_func at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/stdlib/assert.c:58 (discriminator 8)

0x40099d1f: search_suitable_block at /root/esp-idf/components/heap/heap_tlsf.c:198
 (inlined by) block_locate_free at /root/esp-idf/components/heap/heap_tlsf.c:441
 (inlined by) tlsf_malloc at /root/esp-idf/components/heap/heap_tlsf.c:757

0x4009a8db: multi_heap_malloc_impl at /root/esp-idf/components/heap/multi_heap.c:197

0x40081e8d: heap_caps_malloc at /root/esp-idf/components/heap/heap_caps.c:145

0x40081ed0: heap_caps_malloc_default at /root/esp-idf/components/heap/heap_caps.c:181

0x4009ac09: malloc at /root/esp-idf/components/newlib/heap.c:31

0x4012b19d: operator new(unsigned int, std::nothrow_t const&) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/new_opnt.cc:43

0x4011dae7: nvs::Storage::writeMultiPageBlob(unsigned char, char const*, void const*, unsigned int, nvs::VerOffset) at /root/esp-idf/components/nvs_flash/src/nvs_storage.cpp:226

0x4011e0b9: nvs::Storage::writeItem(unsigned char, nvs::ItemType, char const*, void const*, unsigned int) at /root/esp-idf/components/nvs_flash/src/nvs_storage.cpp:316

0x4011e5c1: nvs::NVSHandleSimple::set_blob(char const*, void const*, unsigned int) at /root/esp-idf/components/nvs_flash/src/nvs_handle_simple.cpp:52

0x4011d4d7: nvs_set_blob at /root/esp-idf/components/nvs_flash/src/nvs_api.cpp:420

0x40104d49: config_save at /root/esp-idf/components/bt/common/osi/config.c:462

0x400f9500: btc_config_flush at /root/esp-idf/components/bt/host/bluedroid/btc/core/btc_config.c:314

0x400deb61: btc_storage_add_bonded_device at /root/esp-idf/components/bt/host/bluedroid/btc/core/btc_storage.c:54

0x400f97c7: btc_dm_auth_cmpl_evt at /root/esp-idf/components/bt/host/bluedroid/btc/core/btc_dm.c:348 (discriminator 3)

0x400f9b06: btc_dm_sec_cb_handler at /root/esp-idf/components/bt/host/bluedroid/btc/core/btc_dm.c:677

0x400f50a3: btc_thread_handler at /root/esp-idf/components/bt/common/btc/core/btc_task.c:184

0x400f6439: osi_thread_run at /root/esp-idf/components/bt/common/osi/thread.c:68

0x4009836d: vPortTaskWrapper at /root/esp-idf/components/freertos/port/xtensa/port.c:168

mryboy
Posts: 6
Joined: Thu May 21, 2020 9:56 am

Re: 蓝牙连接错误

Postby mryboy » Wed Jun 23, 2021 4:31 am

已解决。
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
这里的参数必须是ESP_BT_MODE_BLE,我之前把这里改成了ESP_BT_MODE_CLASS_BT,就发生了上面的错误

Who is online

Users browsing this forum: No registered users and 38 guests