This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Peer manager Flash storage is full

I modified the FW "ble_app_uart" using the example "\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_uart \".
I added the pairing function and "delete_bonds ()".
The "delete_bonds ()" function is activated by pressing the EVAL button "Button 2" at startup.

After many pairing and delete_bonds () tests with the same device (Client) I saw that encrypted communication was no longer active (test by sniffer and wireshark).
I have seen that in these cases JLINK RTT sends me what is shown below.

00> <info> app: Debug logging for UART over RTT started.
00> <info> app: Connected
00> <info> app: Data len is set to 0xF4(244)
00> <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 133
00> <info> app: Disconnected
00> <info> app: Connected
00> <info> app: Data len is set to 0xF4(244)
00> <warning> peer_manager_handler: Flash storage is full
00> <info> peer_manager_handler: Attempting to clean flash.
00> <error> peer_manager_handler: There are no peers to delete.
00> <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
00> <info> peer_manager_handler: Attempting to clean flash.
00> <error> peer_manager_handler: There are no peers to delete.
00> <info> app: Disconnected
00>

To solve this problem I had to perform the "Erase flash" function through the "SEGGER J-FLASH" program.

Questions:
1) Why the "delete_bonds()" function does not solve this problem ?
2) Is there a way to solve this problem without having to perform the "Erase Flash" function through the SEGGER program ?

Thank you.

BR

Demetrio Magrin

Parents
  • Hi,

    I forgot to report the "void pm_evt_handler (pm_evt_t const * p_evt)" function below.

    static void pm_evt_handler(pm_evt_t const * p_evt)
    {
        pm_handler_on_pm_evt(p_evt);
        pm_handler_flash_clean(p_evt);

        switch (p_evt->evt_id)
        {
            case PM_EVT_PEERS_DELETE_SUCCEEDED:
            {
                advertising_start(false);
            }
            break;
            case PM_EVT_CONN_SEC_CONFIG_REQ:
            {
                //
                // Allow pairing request from an already bonded peer.
                // Note that this will enable a potential attacker to update an existing bond.
                // So there is a trade-off between security and user-friendliness.
                //
                pm_conn_sec_config_t conn_sec_config = { .allow_repairing = true };
                pm_conn_sec_config_reply(m_conn_handle, &conn_sec_config);
            }
            break;
            default:
            break;
        }
    }

    Thank you.

    BR

    Demetrio Magrin

Reply
  • Hi,

    I forgot to report the "void pm_evt_handler (pm_evt_t const * p_evt)" function below.

    static void pm_evt_handler(pm_evt_t const * p_evt)
    {
        pm_handler_on_pm_evt(p_evt);
        pm_handler_flash_clean(p_evt);

        switch (p_evt->evt_id)
        {
            case PM_EVT_PEERS_DELETE_SUCCEEDED:
            {
                advertising_start(false);
            }
            break;
            case PM_EVT_CONN_SEC_CONFIG_REQ:
            {
                //
                // Allow pairing request from an already bonded peer.
                // Note that this will enable a potential attacker to update an existing bond.
                // So there is a trade-off between security and user-friendliness.
                //
                pm_conn_sec_config_t conn_sec_config = { .allow_repairing = true };
                pm_conn_sec_config_reply(m_conn_handle, &conn_sec_config);
            }
            break;
            default:
            break;
        }
    }

    Thank you.

    BR

    Demetrio Magrin

Children
No Data
Related