bonding lost in Android after Error Code: Attribute Not Found (0x0a)

Hi,

I have an NRF52840 as the peripheral and an Android phone as the central. Most of the time the connection can be established without any problems but sometimes during the connection, the information about the bonding gets lost from the pairing list of the phone.

After many trials I succeeded to reproduce the issue with the sniffer it seems that the phone is sending many Attribute Not Found (0x0a) errors and they lead to initiating the pairing from the beginning.

Can you please tell me what this error means? and how it can cause bonding deletion.

  • I did a lot of tests and finally regenerated this issue again. The connection works fine most of the time, but in some rare cases, it stops connecting. When this happens after a few attempts to reconnect Android deletes the bonding information and tries to reinitiate the pairing which leads to the sniffer logs in my first message, but in iOS the pairing is still on the list, so unless you delete it yourself you cannot connect anymore.
    It seems that the bonding information is somehow deleted from the nRF flash memory but I cannot understand why.
    Have you ever seen anything like that? What do you think I should do to figure this problem out?

  • Hello,

    This looks quite strange. Have you tested this with any other Android devices (a different phone)? This can be an Android issue but I am not 100% sure on this. I am checking this with our Android development team to see whether there is any known issue on Android side while trying to reconnect few times.

    Could you share share the Android and SDK version you are trying with?

    Kind Regards,

    Abhijith

  • Hello,

    Thank you for your reply.

    I don't think this can be a problem from the phone side because it happens with iOS too but with some difference. However, the Android version was 12, and the SDK version was 17.0.2.

    I also noticed something in the code that the pm_local_database_has_changed was called in the BLE_GAP_EVT_CONNECTED. I changed it now, but do you think this can be the source of this problem? Since this case happens rarely I cannot be sure by testing.

    Also, can you tell me what happens if during a connection a write to the flash fails? Can this issue be caused because somehow a peer manager write to the flash fails during initiating a connection?

  • Hello,

    Sorry for the long response time. It was a public holidays last week here in Norway. than you for the patience.
    Could you tell me whether you are using a DK or custom board? Also, you had mentioned that it worked on iOS right? Doesn't it now?

    And I think earlier you had uploaded a sniffer trace here, but I cannot find it now. It would be great if you could upload it.

    Kind Regards,

    Abhijith

  • Hi,

    Sorry for the late reply, and thank you for your answer.

    I was finally able to get the logs from when this issue is happening, and it turned out that the peer manager itself is deleting the peers. This was a similar issue to this ticket:  RE: Peer Manager deletes only peer while we still need it -- failed flash write race?

    The problem seems to be fixed after updating to v17.1.

Related