测试发现了不应该的问题,还是问下确认。
环境:
ESP32 V1/V3
IDF:5.2.3 (5.3.1试过一样)
Ubuntu 20.04 vscode
问题描述:
通过例子创建工程 gatt_client 编译通过运行时发现log持续打印直到看门狗提斯错误,尝试将搜索时间修改为2S,结果发现2S后停止但未输出结束事件。
其他,编译运行gatt_server正常,使用nimble的主机端例子正常。
日志如下:
I (5859) GATTC_DEMO:
I (5869) GATTC_DEMO: 74 d7 13 86 de da
I (5869) GATTC_DEMO: searched Adv Data Len 26, Scan Response Len 0
I (5879) GATTC_DEMO: searched Device Name Len 0
I (5879) GATTC_DEMO:
I (5879) GATTC_DEMO: 2b aa cb 23 65 a9
I (5889) GATTC_DEMO: searched Adv Data Len 31, Scan Response Len 0
I (5899) GATTC_DEMO: searched Device Name Len 0
I (5899) GATTC_DEMO:
I (5909) GATTC_DEMO: 55 b1 f4 e5 0b 2f
I (5909) GATTC_DEMO: searched Adv Data Len 19, Scan Response Len 0
I (5919) GATTC_DEMO: searched Device Name Len 0
I (5919) GATTC_DEMO:
I (5919) GATTC_DEMO: 00 f9 e6 f4 f2 20
I (5929) GATTC_DEMO: searched Adv Data Len 31, Scan Response Len 0
I (5939) GATTC_DEMO: searched Device Name Len 0
I (5939) GATTC_DEMO:
I (5939) GATTC_DE (5949) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (5949) task_wdt: - IDLE0 (CPU 0)
E (5949) task_wdt: Tasks currently running:
E (5949) task_wdt: CPU 0: BTC_TASK
E (5949) task_wdt: CPU 1: IDLE1
E (5949) task_wdt: Print CPU 0 (current core) backtrace
启动部分
I (30) boot: ESP-IDF v5.2.3-dirty 2nd stage bootloader
I (30) boot: compile time Dec 9 2024 10:43:01
I (30) boot: Multicore bootloader
I (35) boot: chip revision: v1.0
I (39) boot.esp32: SPI Speed : 40MHz
I (44) boot.esp32: SPI Mode : DIO
I (48) boot.esp32: SPI Flash Size : 2MB
I (53) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (62) boot: ## Label Usage Type ST Offset Length
I (69) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (76) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (84) boot: 2 factory factory app 00 00 00010000 00100000
I (91) boot: End of partition table
I (95) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2066ch (132716) map
I (149) esp_image: segment 1: paddr=00030694 vaddr=3ffbdb60 size=049f8h ( 18936) load
I (157) esp_image: segment 2: paddr=00035094 vaddr=40080000 size=0af84h ( 44932) load
I (174) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=7a520h (501024) map
I (346) esp_image: segment 4: paddr=000ba548 vaddr=4008af84 size=0bc0ch ( 48140) load
I (377) boot: Loaded app from partition at offset 0x10000
I (377) boot: Disabling RNG early entropy source...
I (389) cpu_start: Multicore app
I (398) cpu_start: Pro cpu start user code
I (398) cpu_start: cpu freq: 160000000 Hz
I (398) cpu_start: Application information:
I (401) cpu_start: Project name: test01
I (406) cpu_start: App version: 1
I (410) cpu_start: Compile time: Dec 9 2024 10:42:54
I (416) cpu_start: ELF file SHA256: f3e708fc1...
I (422) cpu_start: ESP-IDF: v5.2.3-dirty
I (427) cpu_start: Min chip rev: v0.0
I (432) cpu_start: Max chip rev: v3.99
I (437) cpu_start: Chip rev: v1.0
I (442) heap_init: Initializing. RAM available for dynamic allocation:
I (449) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (455) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (461) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (467) heap_init: At 3FFC6FE0 len 00019020 (100 KiB): DRAM
I (473) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (479) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (486) heap_init: At 40096B90 len 00009470 (37 KiB): IRAM
I (494) spi_flash: detected chip: gd
I (496) spi_flash: flash io: dio
W (500) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (514) coexist: coex firmware version: 27d8387
I (519) main_task: Started on CPU0
I (529) main_task: Calling app_main()
I (539) BTDM_INIT: BT controller compile version [b022216]
I (539) BTDM_INIT: Bluetooth MAC: 80:7d:3a:c5:f0:ea
I (539) phy_init: phy_version 4840,a40f0ac,Aug 16 2024,16:48:06
I (929) GATTC_DEMO: REG_EVT
I (929) main_task: Returned from app_main()
I (939) GATTC_DEMO: scan start success
gatt_client 例子运行异常
Re: gatt_client 例子运行异常
仔细看了下源代码,额,超时原因是波特率太低而扫描间隔太小导致,这个可以修改代码解决。
至于没有普通蓝牙协议栈 scan 完成的事件,那的确协议栈里就没有,应该是自己通过定时器实现或则干脆一直扫描。
至于没有普通蓝牙协议栈 scan 完成的事件,那的确协议栈里就没有,应该是自己通过定时器实现或则干脆一直扫描。
Who is online
Users browsing this forum: No registered users and 49 guests