问题描述:在使用蓝牙的gatt_server_service_table例程,当创建的GATT Server数超过6个之后(menuconfig中设定了CONFIG_BT_GATT_MAX_SR_PROFILES为11),ble就没有启动服务,也没有启动广播,接着就发生了任务看门狗超时。
当GATT Server的数量小于等于6时,程序正常运行。
问题:
1.上述的问题,我在使用IDF-4.4.4的时候,没有出现这个问题。更新到IDF-5.1后,出现了该问题,本来是在自己工程发现的,后来为了验证,跑了示例工程,然后添加了多个server。
2.从日志看,是否是蓝牙中BTU_TASK任务死掉了,导致触发了任务看门狗。如果是,那是什么原因导致他死掉了呢?
3.我已经修改了CONFIG_BT_GATT_MAX_SR_PROFILES,是否底层没有将这个作为判断依据。依然默认只能创建6个+2个BLE预先使用的server呢?
4.附件是我测试的demo例程,可以下载进行测试。因为是测试demo,所以里面有些乱,但能进行测试,请包涵。
发生错误的日志如下:
Code: Select all
I (506) GATTS_TABLE_DEMO: create dev attribute table successfully, the number handle = 32
I (506) GATTS_TABLE_DEMO: create vol attribute table successfully, the number handle = 13
I (516) GATTS_TABLE_DEMO: create 01 attribute table successfully, the number handle = 175
I (536) GATTS_TABLE_DEMO: create 02 attribute table successfully, the number handle = 175
I (546) GATTS_TABLE_DEMO: create 03 attribute table successfully, the number handle = 175
I (556) GATTS_TABLE_DEMO: create 04 attribute table successfully, the number handle = 175
I (566) GATTS_TABLE_DEMO: create 05 attribute table successfully, the number handle = 175
E (5416) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (5416) task_wdt: - IDLE (CPU 0)
E (5416) task_wdt: Tasks currently running:
E (5416) task_wdt: CPU 0: BTU_TASK
E (5416) task_wdt: CPU 1: IDLE
E (5416) task_wdt: Print CPU 0 (current core) backtrace
Backtrace: 0x42054AE2:0x3FC98280 0x42054C8E:0x3FC982A0 0x40376FA9:0x3FC982C0 0x4037619E:0x3FCB11F0 0x4037623D:0x3FCB1210 0x40376272:0x3FCB1230 0x40384BF1:0x3FCB1250 0x4202D7FF:0x3FCB1270 0x4202D29A:0x3FCB1390 0x4202D36A:0x3FCB13B0 0x4202D4D7:0x3FCB1400 0x42024E31:0x3FCB1430 0x4201D4C6:0x3FCB1470 0x4201D978:0x3FCB1490 0x42047421:0x3FCB14B0 0x4203472D:0x3FCB14F0 0x42034B05:0x3FCB1510 0x42031F4E:0x3FCB1530 0x4038181D:0x3FCB1560
0x42054ae2: task_wdt_timeout_handling at C:/Espressif/frameworks/esp-idf-v5.1/components/esp_system/task_wdt/task_wdt.c:461 (discriminator 3)
0x42054c8e: task_wdt_isr at C:/Espressif/frameworks/esp-idf-v5.1/components/esp_system/task_wdt/task_wdt.c:585
0x40376fa9: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v5.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S:1226
0x4037619e: heap_caps_malloc_base at C:/Espressif/frameworks/esp-idf-v5.1/components/heap/heap_caps.c:156
0x4037623d: heap_caps_malloc at C:/Espressif/frameworks/esp-idf-v5.1/components/heap/heap_caps.c:197
0x40376272: heap_caps_malloc_default at C:/Espressif/frameworks/esp-idf-v5.1/components/heap/heap_caps.c:223
0x40384bf1: malloc at C:/Espressif/frameworks/esp-idf-v5.1/components/newlib/heap.c:24
0x4202d7ff: smp_encrypt_data at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/stack/smp/smp_keys.c:175
0x4202d29a: SMP_Encrypt at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/stack/smp/smp_api.c:542
0x4202d36a: cmac_aes_k_calculate at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/stack/smp/smp_cmac.c:145
0x4202d4d7: aes_cipher_msg_auth_code at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/stack/smp/smp_cmac.c:312
0x42024e31: gatts_calculate_datebase_hash at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/stack/gatt/gatt_sr_hash.c:161
0x4201d4c6: gatt_update_for_database_change at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/stack/gatt/gatt_api.c:129
0x4201d978: GATTS_StartService at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/stack/gatt/gatt_api.c:530
0x42047421: bta_gatts_start_service at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/bta/gatt/bta_gatts_act.c:583
0x4203472d: bta_gatts_hdl_event at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/bta/gatt/bta_gatts_main.c:128
0x42034b05: bta_sys_event at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/host/bluedroid/bta/sys/bta_sys_main.c:499
0x42031f4e: osi_thread_run at C:/Espressif/frameworks/esp-idf-v5.1/components/bt/common/osi/thread.c:165 (discriminator 1)
0x4038181d: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v5.1/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162