Bonjour à tous,
Merci JML, j’ai regardé, mais comme tu en avait parlé au post #2, il me semble que le profil A2DP ne vas pas gérer le micro.
Je me suis donc tourné du coup vers cet exemple qui apparemment gère le HFP :
Pour cet exemple j’utilise un module ESP32-DevKitC ESP-WROOM-32.
Le soucis que je rencontre pour l’instant est que je n’arrive pas à appairer le casque avec l’ESP32.
J’utilise également pour la programmation ESP-IDF sur VSCODE.
La compile et le téléversement se passe bien et le résultat dans la console est le suivant :
rst:0x1 (POWERON_RESET),boot:0x13 (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:6276
load:0x40078000,len:15736
load:0x40080400,len:4
--- 0x40080400: _init at ??:?
load:0x40080404,len:3860
entry 0x4008063c
I (29) boot: ESP-IDF v5.4.3 2nd stage bootloader
I (29) boot: compile time Dec 29 2025 21:12:30
I (29) boot: Multicore bootloader
I (31) boot: chip revision: v1.0
I (33) boot.esp32: SPI Speed : 40MHz
I (37) boot.esp32: SPI Mode : DIO
I (41) boot.esp32: SPI Flash Size : 2MB
I (44) boot: Enabling RNG early entropy source...
I (49) boot: Partition Table:
I (51) boot: ## Label Usage Type ST Offset Length
I (58) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (64) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (71) boot: 2 factory factory app 00 00 00010000 00100000
I (77) boot: End of partition table
I (80) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=1e020h (122912) map
I (130) esp_image: segment 1: paddr=0002e048 vaddr=3ffbdb60 size=01fd0h ( 8144) load
I (133) esp_image: segment 2: paddr=00030020 vaddr=400d0020 size=72d98h (470424) map
I (295) esp_image: segment 3: paddr=000a2dc0 vaddr=3ffbfb30 size=02948h ( 10568) load
I (299) esp_image: segment 4: paddr=000a5710 vaddr=40080000 size=17e30h ( 97840) load
I (337) esp_image: segment 5: paddr=000bd548 vaddr=50000000 size=0001ch ( 28) load
I (349) boot: Loaded app from partition at offset 0x10000
I (349) boot: Disabling RNG early entropy source...
I (359) cpu_start: Multicore app
I (368) cpu_start: Pro cpu start user code
I (368) cpu_start: cpu freq: 160000000 Hz
I (368) app_init: Application information:
I (368) app_init: Project name: casque
I (372) app_init: App version: 1
I (375) app_init: Compile time: Dec 29 2025 21:11:47
I (380) app_init: ELF file SHA256: cafb548fa...
I (385) app_init: ESP-IDF: v5.4.3
I (388) efuse_init: Min chip rev: v0.0
I (392) efuse_init: Max chip rev: v3.99
I (396) efuse_init: Chip rev: v1.0
I (400) heap_init: Initializing. RAM available for dynamic allocation:
I (407) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (411) heap_init: At 3FFB6BF8 len 00001408 (5 KiB): DRAM
I (417) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (422) heap_init: At 3FFC7CE0 len 00018320 (96 KiB): DRAM
I (427) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (432) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (438) heap_init: At 40097E30 len 000081D0 (32 KiB): IRAM
I (445) spi_flash: detected chip: generic
I (447) spi_flash: flash io: dio
W (450) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (463) coexist: coex firmware version: b0bcc39
I (467) main_task: Started on CPU0
I (477) main_task: Calling app_main()
I (497) BTDM_INIT: BT controller compile version [f5c3312]
I (497) BTDM_INIT: Using main XTAL as clock source
I (497) BTDM_INIT: Bluetooth MAC: 24:6f:28:7a:76:72
I (507) phy_init: phy_version 4861,b71b5ad,Aug 5 2025,11:16:06
I (1137) BT_APP_HF: Own address:[24:6f:28:7a:76:72]
I (1157) BT_APP_HF: APP HFP event: PROF_STATE_EVT
I (1157) BT_APP_HF: AG PROF STATE: Init Complete
I (1157) gpio: GPIO[5]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1167) gpio: GPIO[25]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1177) gpio: GPIO[26]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1177) gpio: GPIO[35]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1187) gpio: GPIO[19]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1197) gpio: GPIO[21]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (1207) gpio: GPIO[22]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
n
==================================================
| 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 |
| |
=================================================
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.
Your terminal application does not support escape sequences.
Line editing and history features are disabled.
On Windows, try using Putty instead.
hfp_ag> I (2257) main_task: Returned from app_main()
con
Connect.
hfp_ag> W (48597) BT_SDP: SDP - Rcvd conn cnf with error: 0x4 CID 0x40
W (48607) BT_HCI: hcif conn complete: hdl 0xfff, st 0x4
I (48607) BT_APP_HF: APP HFP event: CONNECTION_STATE_EVT
I (48607) BT_APP_HF: --connection state DISCONNECTED, peer feats 0x0, chld_feats 0x0
Comme on peut le voir le module démarre bien, mais quand le tape “con” l’ESP passe en connexion, mais juste aprés une erreur se produit que je n’arrive pas à analyser:
hfp_ag> W (48597) BT_SDP: SDP - Rcvd conn cnf with error: 0x4 CID 0x40
Et apparemment l’ESP32 passe en connexion, mais ce déconnecte aussitôt :
W (48607) BT_HCI: hcif conn complete: hdl 0xfff, st 0x4
I (48607) BT_APP_HF: APP HFP event: CONNECTION_STATE_EVT
I (48607) BT_APP_HF: --connection state DISCONNECTED, peer feats 0x0, chld_feats 0x0
Pendant cette phase de connection mon casque bluetooth est en mode appairage, mais pas moyen de l’appairer.
Auriez vous une idée que ce qui ne vas pas ?