最近开发一个项目有一个需求,需要BLE gatt client + BT HFP AG 共存
我写了一个demo,参考examples\bluetooth\bluedroid\classic_bt\hfp_ag and examples\bluetooth\bluedroid\ble\gatt_client
首先hfp ag连接耳机,成功。
然后开始gatt client扫描,扫一会就出现了panic
串口log如下:
rst:0x1 (POWERON_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7100
ho 0 tail 12 room 4
load:0x40078000,len:14292
load:0x40080400,len:3688
0x40080400: _init at ??:?
entry 0x40080678
I (29) boot: ESP-IDF v4.3-dirty 2nd stage bootloader
I (29) boot: compile time 15:17:17
I (29) boot: chip revision: 3
I (32) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (40) boot.esp32: SPI Speed : 40MHz
I (44) boot.esp32: SPI Mode : DIO
I (49) 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 (77) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (84) boot: 2 factory factory app 00 00 00010000 00100000
I (92) boot: End of partition table
I (96) boot_comm: chip revision: 3, min. application chip revision: 0
I (103) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2a77ch (173948) map
I (177) esp_image: segment 1: paddr=0003a7a4 vaddr=3ffbdb60 size=040d8h ( 16600) load
I (184) esp_image: segment 2: paddr=0003e884 vaddr=40080000 size=01794h ( 6036) load
I (187) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=a2d88h (667016) map
I (443) esp_image: segment 4: paddr=000e2db0 vaddr=40081794 size=164b0h ( 91312) load
I (482) esp_image: segment 5: paddr=000f9268 vaddr=50000000 size=00010h ( 16) load
I (495) boot: Loaded app from partition at offset 0x10000
I (495) boot: Disabling RNG early entropy source...
I (507) cpu_start: Pro cpu up.
I (507) cpu_start: Starting app cpu, entry point is 0x400813cc
0x400813cc: call_start_cpu1 at /home/liupeng/WorkSpace/espressif/esp/esp-idf/components/esp_system/port/cpu_start.c:141
I (0) cpu_start: App cpu up.
I (524) cpu_start: Pro cpu start user code
I (524) cpu_start: cpu freq: 160000000
I (524) cpu_start: Application information:
I (528) cpu_start: Project name: bt_ble_coex
I (533) cpu_start: App version: v4.3-dirty
I (539) cpu_start: Compile time: Aug 24 2021 15:17:17
I (545) cpu_start: ELF file SHA256: 2ba164595fb42e8d...
I (551) cpu_start: ESP-IDF: v4.3-dirty
I (556) heap_init: Initializing. RAM available for dynamic allocation:
I (563) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (569) heap_init: At 3FFB6BF8 len 00001408 (5 KiB): DRAM
I (575) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (581) heap_init: At 3FFC9C00 len 00016400 (89 KiB): DRAM
I (588) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (594) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (600) heap_init: At 40097C44 len 000083BC (32 KiB): IRAM
I (608) spi_flash: detected chip: gd
I (611) spi_flash: flash io: dio
W (615) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (629) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (639) BT_APP_HF: [app_main] app main start....
I (689) BTDM_INIT: BT controller compile version [1342a48]
I (689) system_api: Base MAC address is not set
I (689) system_api: read default base MAC address from EFUSE
I (699) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
E (1419) BT_BTC: btc_hf_cb_handler: Invalid index -1
I (1429) gpio: GPIO[19]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1429) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1439) gpio: GPIO[22]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
==================================================
| Steps to test hfp_ag |
| |
| 1. Print 'help' to gain overview of commands |
| 2. Setup a service level connection |
| 3. Run hfp_ag to test |
| |
=================================================
I (1689) BT_APP_HF: ble_gattc_init in.
I (1699) APP_GATTC: REG_EVT
I (1699) APP_GATTC: scan param set complete
hfp_ag>
hfp_ag> W (7539) BT_APPL: new conn_srvc id:5, app_id:0
I (7539) BT_APP_HF: APP HFP event: CONNECTION_STATE_EVT
I (7539) BT_APP_HF: --connection state CONNECTED, peer feats 0x0, chld_feats 0x0
I (7609) BT_APP_HF: APP HFP event: CIND_RESPONSE_EVT
I (7609) BT_APP_HF: --CIND Start.
I (7639) BT_APP_HF: APP HFP event: CONNECTION_STATE_EVT
I (7639) BT_APP_HF: --connection state SLC_CONNECTED, peer feats 0x3f, chld_feats 0x4013
I (7659) BT_APP_HF: APP HFP event: NREC_RESPONSE_EVT
I (7659) BT_APP_HF: --NREC status is: NREC DISABLE.
I (7669) BT_APP_HF: APP HFP event: VOLUME_CONTROL_EVT
I (7669) BT_APP_HF: --Volume Target: SPEAKER, Volume 13
I (7719) BT_APP_HF: APP HFP event: UNKNOW_AT_CMD
I (7719) BT_APP_HF: --UNKOW AT CMD: +XAPL=0000-0000-0100,7
I (7739) BT_APP_HF: APP HFP event: UNKNOW_AT_CMD
I (7739) BT_APP_HF: --UNKOW AT CMD: +IPHONEACCEV=2,1,8,2,0
I (7789) BT_APP_HF: APP HFP event: CLCC_RESPONSE_EVT
I (7789) BT_APP_HF: --Calling Line Identification.
I (7829) BT_APP_HF: APP HFP event: UNKNOW_AT_CMD
I (7829) BT_APP_HF: --UNKOW AT CMD: +CSRSF=0,0,0,1,0,0,0
hfp_ag>
hfp_ag>
hfp_ag>
hfp_ag>
hfp_ag>
hfp_ag>
hfp_ag> blescan
ble start scanning
I (17059) APP_GATTC: scan start success
I (17089) APP_GATTC: 1d a8 c0 ac e8 da
I (17089) APP_GATTC: searched Adv Data Len 31, Scan Response Len 0
I (17089) APP_GATTC: searched Device Name Len 0
I (17099) APP_GATTC:
I (17119) APP_GATTC: 53 7b 57 35 54 29
I (17119) APP_GATTC: searched Adv Data Len 17, Scan Response Len 0
I (17119) APP_GATTC: searched Device Name Len 0
I (17129) APP_GATTC:
I (17129) APP_GATTC: 5d be a4 a5 2f 6f
I (17129) APP_GATTC: searched Adv Data Len 31, Scan Response Len 0
I (17149) APP_GATTC: searched Device Name Len 0
I (17149) APP_GATTC:
hfp_ag> I (17189) APP_GATTC: 1d a8 c0 ac e8 da
I (17199) APP_GATTC: searched Adv Data Len 31, Scan Response Len 0
I (17199) APP_GATTC: searched Device Name Len 0
I (17209) APP_GATTC:
I (17219) APP_GATTC: 2a 67 91 78 8e 5d
I (17219) APP_GATTC: searched Adv Data Len 31, Scan Response Len 0
I (17219) APP_GATTC: searched Device Name Len 0
I (17229) APP_GATTC:
I (17319) APP_GATTC: d4 f2 5d 21 96 5a
I (17319) APP_GATTC: searched Adv Data Len 31, Scan Response Len 0
I (17319) APP_GATTC: searched Device Name Len 0
I (17329) APP_GATTC:
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4001ac19 PS : 0x00060e31 A0 : 0x800881fe A1 : 0x3ffbe7f0
A2 : 0x008479d4 A3 : 0x00000007 A4 : 0x00000000 A5 : 0x3ffb8360
A6 : 0x000005b4 A7 : 0x00000000 A8 : 0x0000002f A9 : 0x00000507
A10 : 0x00000000 A11 : 0x3ffcc584 A12 : 0x00000000 A13 : 0x00000001
A14 : 0x00000000 A15 : 0x3ffb8360 SAR : 0x0000001e EXCCAUSE: 0x0000001c
EXCVADDR: 0x008479d8 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Backtrace:0x4001ac16:0x3ffbe7f0 0x400881fb:0x3ffbe810 0x40085502:0x3ffbe850 0x4008aaea:0x3ffbe870 0x4008b603:0x3ffbe890 0x40082b59:0x3ffbe8b0 0x40170413:0x3ffbd690 0x400da8ca:0x3ffbd6b0 0x40091fb5:0x3ffbd6d0 0x40093cd9:0x3ffbd6f0
0x400881fb: r_lld_evt_schedule at ??:?
0x40085502: r_ea_finetimer_isr at ??:?
0x4008aaea: r_rwbt_isr at ??:?
0x4008b603: r_rwbtdm_isr_wrapper at intc.c:?
0x40082b59: _xt_lowint1 at /home/liupeng/WorkSpace/espressif/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1105
0x40170413: cpu_ll_waiti at /home/liupeng/WorkSpace/espressif/esp/esp-idf/examples/bluetooth/bluedroid/coex/bt_ble_coex/build/../../../../../../components/hal/esp32/include/hal/cpu_ll.h:183
(inlined by) esp_pm_impl_waiti at /home/liupeng/WorkSpace/espressif/esp/esp-idf/components/esp_pm/pm_impl.c:827
0x400da8ca: esp_vApplicationIdleHook at /home/liupeng/WorkSpace/espressif/esp/esp-idf/components/esp_common/src/freertos_hooks.c:63
0x40091fb5: prvIdleTask at /home/liupeng/WorkSpace/espressif/esp/esp-idf/components/freertos/tasks.c:3839 (discriminator 1)
0x40093cd9: vPortTaskWrapper at /home/liupeng/WorkSpace/espressif/esp/esp-idf/components/freertos/port/xtensa/port.c:168
BLE gatt client + BT HFP AG 共存问题
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 77 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.