BLE Static Passkey - Pairing Prompt Not Working Consistently for nRF52810

I’m implementing static passkey security in a BLE peripheral using nRF52810 with SDK 17.1.0. I have added a feature where the device disconnects automatically if the user doesn’t enter the passkey within a timeout window.

The problem I’m facing is:

1. When I connect to the BLE device from **some phones**, the **passkey entry prompt appears**, but when I enter the correct PIN, **nothing happens**. After the timeout, the device disconnects.
2. On other phones (e.g., my friend's phone), it works fine — the prompt appears, the PIN is entered, and pairing succeeds.
3. After pairing once, the phone doesn't show the PIN prompt again when reconnecting — I want the phone to **ask for the passkey every time**.

Questions:
- Why is the correct passkey not working on some phones?
- How can I **force the phone to always ask for the passkey**?
- Is there something I need to clear from the phone or the peripheral after disconnection to reset bonding?

I have configured the security with static passkey using `pm_sec_params_t` with MITM and IO capabilities. I also start a timer on connection and disconnect if pairing does not complete in time.

Any advice or steps to debug this further would be appreciated.

  • Work through the BTLE security lessons on Dev Academy first. That is not how BTLE is supposed to work.

  • Hi k@pkr, 

    Regarding this:

    I have added a feature where the device disconnects automatically if the user doesn’t enter the passkey within a timeout window.

    What have you done to accomplish this?

    - Why is the correct passkey not working on some phones?

    I need more information.

    • What have you done to enable static passkey pairing?
    • Does this happen with a sample that supports pairing, if you change it to using static passkey?
    - How can I **force the phone to always ask for the passkey**?

    You need to use pairing only, without bonding. Bonding means storing the pairing information to skip the process in future connection.

    - Is there something I need to clear from the phone or the peripheral after disconnection to reset bonding?

    Obviously, you can clear the bonding data to force another bonding process from the beginning. This can be done on either the phone or peripheral, or both. Doing it only on one side is enough but will lead to error when the other peer tries to reuse the bond information it still has. This will almost always be resolved by the BLE stack also deletes the bond information on the peer. Then, you can pair the two anew. 

    This is very crude and isn't going to give good user experience. If you just want to force passkey entering every time, then just use pair without bond.

Related