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

Call to SoftDevice returns illegal error code 0x3204 in Current Time Service client ?

Hello,

I am trying the ble_app_cts_c_pca10040_s132 (current time service client). Under the conditions described below, ultimately a SoftDevice call to sd_ble_gap_device_identities_set() seems to return an illegal return code 0x3204.

Setup:

ble_app_cts_c_pca10040_s132 runs on PCA10040, launched with button 2 pressed to remove bond data

nrfConnect for desktop runs on same PC using a PCA10059. Client is discovered and I deliberately also clear the bond data.

When I connect via nrfConnect, after a few seconds the client (through the debug console) claims that it couldn't find serve 0x1805 (current time service). (That maybe a misconfiguration in my nrfConnect, even though I did load the cts_central.ncs configuration. Anyhow, I guess the client should fail gracefully ?!). I believe the client then disconnects but still wants to enter the central into the whitelist. This seems to fail.

Debug log is below. The last two messages stem from additional logging that I added to the end of im_device_identities_list_set() in id_manager.c . At the end it calls sd_ble_gap_device_identities_set(). Via debugger I see that the key_ptrs array seems to have the central in its first array element.

My mistake ? SoftDevice issue ? Any help would be appreciated !!

Shockel

ret_code_t im_device_identities_list_set(pm_peer_id_t const * p_peers, uint32_t peer_cnt)

<snipped, my modification follow:>

NRF_LOG_DEBUG("returning through sd_ble_gap_device_identities_set(<>,NULL,%d)", peer_cnt);
ret = sd_ble_gap_device_identities_set(key_ptrs, NULL, peer_cnt);
NRF_LOG_DEBUG("return code %d", ret);
return ret;
}

<info> app: Current Time service client started.
<info> app: Erase bonds!
<debug> peer_manager_handler: Event PM_EVT_PEER_DELETE_SUCCEEDED
<info> peer_manager_handler: Peer deleted successfully: peer_id: 0
<debug> peer_manager_handler: Event PM_EVT_PEERS_DELETE_SUCCEEDED
<info> peer_manager_handler: All peers deleted.
<debug> peer_manager_im: returning after clearing the device identities list
<debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
<info> app: Fast advertising
<debug> ble_cts_c: BLE event handler called with event 0x10
<debug> peer_manager_handler: Connected, securing connection. conn_handle: 0
<info> app: Connected.
<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ
<debug> peer_manager_handler: Security parameter request
<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_START
<debug> peer_manager_handler: Connection security procedure started: role: Peripheral, conn_handle: 0, procedure: Bonding
<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ
<debug> peer_manager_handler: Security parameter request
<debug> ble_cts_c: BLE event handler called with event 0x13
<debug> ble_cts_c: BLE event handler called with event 0x1A
<debug> peer_manager_handler: Event PM_EVT_CONN_SEC_SUCCEEDED
<info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bonding
<debug> ble_db_disc: Starting discovery of service with UUID 0x1805 on connection handle 0x0.
<debug> ble_cts_c: BLE event handler called with event 0x19
<debug> ble_db_disc: Service UUID 0x1805 not found.
<debug> ble_cts_c: Database <debug> ble_cts_c: Database Discovery handler called with event 0x2
<info> app: Current Time Service not found on server.
<debug> ble_cts_c: BLE event handler called with event 0x30
<debug> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
<info> app: Fast advertising
<debug> ble_cts_c: BLE event handler called with event 0x11
<info> app: Disconnected.
<debug> peer_manager_handler: Event PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
<debug> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Bonding data, action: Update
<debug> app: New Bond, add the peer to the whitelist if possible
<debug> app: m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8
<debug> peer_manager_im: returning through sd_ble_gap_device_identities_set(<>,NULL,1)
<debug> peer_manager_im: return code 12804
<error> app: pm_device_identities_list_set() returned 0x3204
<error> app: ERROR 12804 [Unknown error code] at C:\Users\Documents\nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_cts_c\main.c:310
PC at: 0x00030F51
<error> app: End of error report

Related