cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB pairing error with mixed bonded/nonbonded devices

LSpad.1
Associate III

Hi,

I am running a system with some STM32WB, one client and some server.

Right now i am connecting, pairing and bonding the devices.

If i start from a condition where i have all the server not bonded (aci_gap_get_bonded_devices return nothing) and I start the firmware, the client connects, pairs and bonds all the server and all works.

If i start from a condition where i have all the server already bonded and I start the firmware, the client connects and rebonds all the server and all works.

Instead if i start from a condition where I have some server bonded and others not I have some problems. In particular:

  • If I connects (and pair and bond) before all the not bonded devices and after the bonded devices the system still works.
  • If I connects (and rebond) only one server that was already bonded, all the not bonded server cannot be paired anymore.

In particular:

  • I start the firmware, mac address list of the servers is received.
  • the first server is bonded, so i connect it, send a pairing request via aci_gap_send_pairing_req, that rebond the server.
  • the second server is not bonded.
  • I connect it and i ask for pairing with this call: aci_gap_send_pairing_req(server->connectionHandle, 0x02).
  • After called, returns 0, and i receive a EVT_BLUE_GAP_PAIRING_CMPLT event with status 2 (failed) and reason 8 (UNSPECIFIED_REASON) (error codes from AN5270 page141).
  • If i retry to call the aci_gap_send_pairing_req function i receive the error 0x59 (BLE_STATUS_DEV_IN_BLACKLIST) (error code from ble_defs.h).

I have tryed to call the aci_gap_send_pairing_req with the force rebond parameter equal to 0x00. I have tryed to update the stack to the one published in 1.10 packages but no changes. Do you have any idea witch can be the problem?

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
LSpad.1
Associate III

I solve starting pairing and rebond from the server and not from the client. Apparently it is the correct way to use BLE, the pairing and bonding are not started from the one that start the connection but from the one that advertise.

View solution in original post

6 REPLIES 6
rsilva
Associate II

Are there any updates to this? Were you able to solve this?

rcoel.1
Associate

I have the same problem. Can someone help?

LSpad.1
Associate III

I solve starting pairing and rebond from the server and not from the client. Apparently it is the correct way to use BLE, the pairing and bonding are not started from the one that start the connection but from the one that advertise.

rsilva
Associate II

Thank you for you answer @Community member​ so, the server starts the connection, but the client starts the pairing/bonding process?

LSpad.1
Associate III

The opposite. The server is the advertiser and the one that starts pairing/rebond process. The client finds the advertiser (or not if the server uses directed advertising) and starts the connection.

rsilva
Associate II

Thank you for the clarification.