2025-11-20 5:50 PM
Hello,
I am using STM32H735 and installed a Bluetooth module STM32WB05N.
For the STM32WB05N, it is configured as a transparent mode running as HOST + CONTROLLER firmware. I got the firmware from this github: STM32WB05N Firmware.
I have modified STM32WB05N firmware to use the correct PINS and adjusted the baudrate to work with our MCU STM32H735.
So from STM32H735, I have successfully sent the ACI & HCI commands and is able to advertise my device. I am using my Laptop to try and pair it using the windows bluetooth built in app and when I tried to pair my device, I got a confirmation from my STM32H735 and received the following events
HCI_LE_ENHANCED_CONNECTION_COMPLETE_EVENT
HCI_LE_ADVERTISING_SET_TERMINATED_EVENT
HCI_LE_CHANNEL_SELECTION_ALGORITHM_EVENT
After that the windows pairing failed. I was expecting to receive more events and vendor events like:
HCI_LE_DATA_LENGTH_CHANGE_EVENT
ACI_ATT_EXCHANGE_MTU_RESP_EVENT
ACI_GATT_SRV_ATTRIBUTE_MODIFIED_EVENT
HCI_LE_CONNECTION_UPDATE_COMPLETE_EVENT
HCI_ENCRYPTION_CHANGE_EVENT
ACI_GAP_PAIRING_COMPLETE_EVENT
But I did not receive these events.
My question is that is the firmware of my bluetooth module STM32WB05N working properly? what else do I need to do to make the pairing work?
Here's a snippet of my serial log to give you an idea on my issue:
[2025-11-20 15:57:32.929] [COMM][BT] Advertising enabled
[2025-11-20 15:57:32.933] [HCI][INFO] Sending AciGapSetAdvertisingEnable Command
[2025-11-20 15:57:32.933] [DCT][HCI][TX] 01 AC FC 06 01 01 00 00 00 00
[2025-11-20 15:57:32.941] [DCT][HCI][RX] USART RX 1 (7 bytes)
[2025-11-20 15:57:32.941] [DCT][HCI][RX] 04 0E 04 01 AC FC 00
[2025-11-20 15:57:32.941] [HCI][INFO] Event: Command Complete
[2025-11-20 15:57:32.945] [COMM][BT] GATT services initialized
[2025-11-20 15:57:32.945] [COMM][BT] *********************BLUETOOTH READY FOR PAIRING******************
[2025-11-20 15:57:32.945] [COMM][BT] ✓ Bluetooth advertising enabled - ready for pairing
[2025-11-20 15:57:32.945] [COMM][BT] Device should now be visible to mobile phones
[2025-11-20 15:57:32.949] [COMM][BT] ******************************************************************
[T+00:01:33.660] [BLE][ISR] RX IDLE detected, len=50: 04 3E 1F 0A 00 01 08 01 00 6B AF E8 94 9E F8 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 C0 03 01 04 3E 06 12 00 00 01 08 00 04 3E 04 14 01 08 01
[2025-11-20 15:58:43.406] [COMM][BT][DEBUG] Processing 50 bytes: 04 3E 1F 0A 00 01 08 01 00 6B AF E8 94 9E F8 00 00 00 00 00 00 00 00 00 00 00 00 30 00 00 00 C0 03 01 04 3E 06 12 00 00 01 08 00 04 3E 04 14 01 08 01
[2025-11-20 15:58:43.406] [COMM][BT][DEBUG] LE Meta Subevent: 0x0A
[2025-11-20 15:58:43.406] [COMM][BT][DEBUG] Enhanced Connection Complete - Status: 0x00, Handle: 0x0801
[2025-11-20 15:58:43.406] [COMM][BT][DEBUG] Role: Peripheral, Peer: F8:9E:94:E8:AF:6B
[2025-11-20 15:58:43.410] [COMM][BT][DEBUG] Interval: 48 (60.00 ms), Latency: 0, Timeout: 9600 ms
[2025-11-20 15:58:43.410] [COMM][BT] ✓ BLE Connection established (0x0801)
[2025-11-20 15:58:43.410] [COMM][BT] Initiating pairing...
[2025-11-20 15:58:43.410] [HCI][INFO] Sending AciGapSetSecurity Command
[2025-11-20 15:58:43.414] [DCT][HCI][TX] 01 8D FC 04 01 08 02 01
[2025-11-20 15:58:43.417] [DCT][HCI][RX] USART RX 1 (7 bytes)
[2025-11-20 15:58:43.417] [DCT][HCI][RX] 04 0E 04 01 8D FC 00
[2025-11-20 15:58:43.421] [HCI][INFO] Event: Command Complete
[2025-11-20 15:58:43.421] [COMM][BT] Pairing request sent
[2025-11-20 15:58:43.769] [COMM][BT][DEBUG] Processing 7 bytes: 04 05 04 00 01 08 3E
[2025-11-20 15:58:43.769] [COMM][BT][DEBUG] Disconnection Complete - Handle: 0x0801, Reason: 0x3E [SUCCESS]
[2025-11-20 15:58:43.769] [COMM][BT] BLE Connection closed (reason: 0x3E)
After I received the event HCI_LE_ENHANCED_CONNECTION_COMPLETE_EVENT, I tried to send ACI gap set security command to force to initiate the pairing but still not getting the expected events.
Thanks in advance.