Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[FDS] PeerManager error -> try to find record which recently has been invalidated

Hi,

I am using SDK13 and  have noticed some critical issue with peer manager while bonding. The problem is that after performing dfu of my device (which was bonded with two phones before update) when I try to connect to device with first bonded device everything goes ok, but when I try to connect with the second phone device reset due to catching error inside pm_evt_handler

pm_evt_handler(...)
{
 ...
 
    case PM_EVT_PEER_DATA_UPDATE_FAILED:
    {
        APP_ERROR_CHECK(p_evt->params.peer_data_update_failed.error);
    }
...
}

This error is caused by fds which try to find record with function:

 

peer_data_find(...)
{
...
    ret = fds_record_find(file_id, record_key, p_desc, &ftok);

    if (ret != FDS_SUCCESS)
    {
        return NRF_ERROR_NOT_FOUND; <--- CALLED ERROR
    }
    
...
}

After my analysis error is caused by trying to find record which was recently invalidated (fds record keys overwritten with 0x0000). This error reproduce each time following steps below:

  1. Program device with FW (bootloader + application) over JLink
  2. In application perform bonding procedure for 2 phones (1st one HUAWEI HONOR 5X, 2nd Xiaomi Redmi Note 4)
  3. Enter bootloader and perform application dfu (same application as in 1st step)
  4. After DFU in application perform connection of 1st phone -> works perfectly
  5. Perform connection with 2nd phone -> cause error in code shown abowe.

After spending some time with that problem I suggest that it is caused by some race condition in updating peer manager bonding records.

What shall I do to prevent situation because it cause brick of all of my production devices?

Parents Reply
  • That is good news. You should use the compilers that are listed in the SDK release notes.

    GCC: GCC ARM Embedded 4.9 2015q3

    Can you test with an unmodified SDK and armgcc version 4.9 2015q3?

    As I mentioned in an earlier reply, I the LESC example, updated to the same application via DFU (a newer application version), and I am not able to reproduce this issue. Maybe you can give some instructions on how to reproduce your issue with an unmodified SDK?

    Best regards,

    Edvin

Children
No Data
Related