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

Peer manager, bonding fails with error code 133

I am working on two devices, a peripheral and a central.  The peripheral is custom hardware.  The central is being run on a Rigado BMD-300 series evaluation kit.  I'm using Segger IDE and NRF5 SDK 16.

I can get the central and peripheral to pair consistently.  Discovery works and the central sees the characteristics (and changes) correctly.  Now I'm working on bonding and whitelisting.

After discovery is complete (in the discovery event handler), I am calling pm_conn_secure():

// Initiate bonding.
ret_code_t err_code = pm_conn_secure(p_evt->conn_handle, false);
NRF_LOG_DEBUG("Called pm_conn_secure, conn_handle = %d, err_code = %d", p_evt->conn_handle, err_code);
if (err_code != NRF_ERROR_BUSY)
{
  APP_ERROR_CHECK(err_code);
}

which returns NRF_SUCCESS.  Quickly thereafter, I get a PM_EVT_CONN_SEC_FAILED event in the Peer Manager event handler.  In the logs, I  see the following:

changes to <debug> app: Called pm_conn_secure, conn_handle = 0, err_code = 0

<debug> nrf_ble_gq: Processing the request queue...

<debug> nrf_ble_gq: Processing the request queue...

<info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Bonding, error: 133

<debug> app: Got PM_EVT_CONN_SEC_FAILED event

<debug> nrf_ble_gq: Processing the request queue...

<debug> nrf_ble_gq: Processing the request queue...

Questions:

1) Is there something I have to do in the peripheral to allow bonding?

2) Any ideas on what could be causing this?

Related