zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.69k stars 6.53k forks source link

stm32wb55 BLE unable to connect / pair #48951

Closed Niels-Be closed 2 years ago

Niels-Be commented 2 years ago

Describe the bug I am unable to connect / pair to my stm32wb55 after upgrading Zephyr from 2.6.0 to 3.1.0 and Copro Binaray from 1.10.1 to 1.13.3.

I had to switch from stm32wb5x_BLE_Stack_full_fw.bin to stm32wb5x_BLE_HCILayer_fw.bin otherwise it would not start at all.

Two errors occur, see logs below. The connection succeeds, but pairing is not initiated and services can not be resolved. After 30sec the connection times out and is closed.

CONFIG_BT_SMP_SC_ONLY has no effect on this issue. Is LE Pairing no longer supported in BLE_HCILayer_fw?

Logs and console output

[00:00:09.578,000] <dbg> hci_ipm: bt_ipm_rx_thread: EVT: hcievt->evtserial.evt.evtcode: 0x3e
--- 20 messages dropped ---
[00:00:09.583,000] <dbg> bt_hci_core: process_events: ev->state 1
[00:00:09.584,000] <dbg> bt_hci_core: hci_tx_thread: Calling k_poll with 3 events
[00:00:09.584,000] <dbg> hci_ipm: bt_ipm_rx_thread: EVT: hcievt->evtserial.evt.evtcode: 0x0f
[00:00:09.584,000] <dbg> bt_hci_core: bt_recv: buf 0x200098b0 len 6
[00:00:09.584,000] <dbg> bt_hci_core: hci_cmd_status: opcode 0x2016
[00:00:09.584,000] <dbg> bt_hci_core: hci_cmd_done: opcode 0x2016 status 0x3a buf 0x200098b0
>[00:00:09.584,000] <wrn> bt_hci_core: opcode 0x2016 status 0x3a
>[00:00:09.584,000] <err> bt_hci_core: Failed read remote features (-5)
[00:00:09.584,000] <dbg> bt_hci_core: bt_hci_cmd_create: opcode 0x2032 param_len 7
[00:00:09.584,000] <dbg> bt_hci_core: bt_hci_cmd_create: buf 0x200098b0
[00:00:09.584,000] <dbg> bt_hci_core: bt_hci_cmd_send_sync: buf 0x200098b0 opcode 0x2032 len 10
[00:00:09.584,000] <dbg> bt_hci_core: process_events: count 3
[00:00:09.584,000] <dbg> bt_hci_core: process_events: ev->state 4
[00:00:09.584,000] <dbg> bt_hci_core: send_cmd: calling net_buf_get
[00:00:09.584,000] <dbg> bt_hci_core: send_cmd: calling sem_take_wait
[00:00:09.585,000] <dbg> bt_hci_core: send_cmd: Sending command 0x2032 (buf 0x200098b0) to driver
[00:00:09.585,000] <dbg> bt_hci_core: bt_send: buf 0x200098b0 len 10 type 0
[00:00:09.585,000] <dbg> hci_ipm: bt_ipm_send: CMD: buf 0x200098b0 type 0 len 10
[00:00:09.585,000] <dbg> bt_hci_core: process_events: ev->state 0
[00:00:09.585,000] <dbg> bt_hci_core: process_events: ev->state 0
[00:00:09.585,000] <dbg> bt_hci_core: hci_tx_thread: Calling k_poll with 3 events
[00:00:09.585,000] <dbg> hci_ipm: bt_ipm_rx_thread: EVT: hcievt->evtserial.evt.evtcode: 0x0f
[00:00:09.585,000] <dbg> bt_hci_core: bt_recv: buf 0x200098b0 len 6
[00:00:09.585,000] <dbg> bt_hci_core: hci_cmd_status: opcode 0x2032
[00:00:09.585,000] <dbg> bt_hci_core: hci_cmd_done: opcode 0x2032 status 0x0c buf 0x200098b0
>[00:00:09.585,000] <wrn> bt_hci_core: opcode 0x2032 status 0x0c
>[00:00:09.585,000] <err> bt_hci_core: Failed LE Set PHY (-5)
[00:00:14.579,000] <dbg> bt_hci_core: process_events: count 3
[00:00:14.579,000] <dbg> bt_hci_core: process_events: ev->state 0
[00:00:14.579,000] <dbg> bt_hci_core: process_events: ev->state 0
[00:00:14.579,000] <dbg> bt_hci_core: process_events: ev->state 4
[00:00:14.579,000] <dbg> bt_hci_core: bt_send: buf 0x200098e8 len 20 type 2
[00:00:14.579,000] <dbg> hci_ipm: bt_ipm_send: ACL: buf 0x200098e8 type 2 len 20
[00:00:14.579,000] <dbg> bt_hci_core: hci_tx_thread: Calling k_poll with 3 events
[00:00:14.669,000] <dbg> hci_ipm: bt_ipm_rx_thread: EVT: hcievt->evtserial.evt.evtcode: 0x13
[00:00:14.670,000] <dbg> bt_hci_core: bt_recv: buf 0x20009728 len 7
[00:00:14.670,000] <dbg> bt_hci_core: hci_num_completed_packets: num_handles 1
[00:00:14.670,000] <dbg> bt_hci_core: hci_num_completed_packets: handle 2049 count 1
[00:00:42.031,000] <dbg> hci_ipm: bt_ipm_rx_thread: EVT: hcievt->evtserial.evt.evtcode: 0x05
--- 4 messages dropped ---
[00:00:42.031,000] <dbg> bt_hci_core: hci_event: event 0x05
[00:00:42.031,000] <dbg> bt_hci_core: hci_disconn_complete: status 0x00 handle 2049 reason 0x13
[00:00:42.031,000] <dbg> bt_hci_core: process_events: count 3
[00:00:42.031,000] <dbg> bt_hci_core: process_events: ev->state 0
[00:00:42.031,000] <dbg> bt_hci_core: process_events: ev->state 1
[00:00:42.031,000] <dbg> bt_hci_core: process_events: ev->state 0
[00:00:42.031,000] <dbg> bt_hci_core: hci_tx_thread: Calling k_poll with 2 events
[00:00:42.031,000] <dbg> bt_smp: bt_smp_disconnected: chan 0x20001cb4 cid 0x0006
[00:00:42.037,000] <dbg> main: onDisconnect: Disconnected
[00:00:42.037,000] <dbg> bt_adv: bt_le_adv_resume: Resuming connectable advertising
[00:00:42.037,000] <dbg> bt_hci_core: bt_hci_cmd_create: opcode 0x200a param_len 1
[00:00:42.037,000] <dbg> bt_hci_core: bt_hci_cmd_create: buf 0x200098b0
[00:00:42.037,000] <dbg> bt_hci_core: bt_hci_cmd_send_sync: buf 0x200098b0 opcode 0x200a len 4
[00:00:42.037,000] <dbg> bt_hci_core: process_events: count 2
[00:00:42.037,000] <dbg> bt_hci_core: process_events: ev->state 4
[00:00:42.037,000] <dbg> bt_hci_core: send_cmd: calling net_buf_get
[00:00:42.037,000] <dbg> bt_hci_core: send_cmd: calling sem_take_wait
[00:00:42.038,000] <dbg> bt_hci_core: send_cmd: Sending command 0x200a (buf 0x200098b0) to driver
[00:00:42.038,000] <dbg> bt_hci_core: bt_send: buf 0x200098b0 len 4 type 0
[00:00:42.038,000] <dbg> hci_ipm: bt_ipm_send: CMD: buf 0x200098b0 type 0 len 4
[00:00:42.038,000] <dbg> bt_hci_core: process_events: ev->state 0
[00:00:42.038,000] <dbg> bt_hci_core: hci_tx_thread: Calling k_poll with 2 events
[00:00:42.038,000] <dbg> hci_ipm: bt_ipm_rx_thread: EVT: hcievt->evtserial.evt.evtcode: 0x0e
[00:00:42.038,000] <dbg> bt_hci_core: bt_recv: buf 0x200098b0 len 6
[00:00:42.038,000] <dbg> bt_hci_core: hci_cmd_complete: opcode 0x200a
[00:00:42.038,000] <dbg> bt_hci_core: hci_cmd_done: opcode 0x200a status 0x00 buf 0x200098b0
[00:00:42.038,000] <dbg> bt_hci_core: bt_hci_cmd_send_sync: rsp 0x200098b0 opcode 0x200a len 1

Environment:

Niels-Be commented 2 years ago

After some more playing around and flashing different Corpo Binaries the issue has gone away. My final setup stayed exactly the same, maybe there is a upgrade path of the firmeware or something. I do not know. Those two errors stayed but I can connect and pair now. I can not say what the issue was ...