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

Errors when modifying the multirole example into serialized connection mode

Hi,

I modified the example: nRF5_SDK_17.0.2_d674dde\examples\ble_central_and_peripheral\experimental\ble_app_multirole_lesc to run on a serialized connection mode with two PCA10040 boards.

The code can be built without any issues after removing software device and adding serialization lib etc.

When run it, it has connection issues with a peripheral (PCA10056, running a HRS example). When tried to connect a mobile (central), it also has problems.

I put the code on through the debugger to sure the memory is erased.

Any help I can get?

The logging is attached:


<info> app: Scanning
<info> peer_manager_handler: Peer data updated in flash: peer_id: 1, data_id: Peer rank, action: Update, no change
<info> app: CENTRAL: Connected, handle: 0.
<info> app: CENTRAL: Searching for HRS on conn_handle 0x0
<info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102
<warning> peer_manager_handler: Disconnecting conn_handle 0.
<info> app: CENTRAL: Disconnected, handle: 0, reason: 0x16
<info> app: Scanning
<info> app_timer: RTC: initialized.
<info> app: LE Secure Connections example started.
<info> app: Scanning
<info> app: Advertising
<info> app: PERIPHERAL: Connected, handle 1.
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x1, procedure: Encryption, error: 4157
<warning> peer_manager_handler: Disconnecting conn_handle 1.
<info> app: PERIPHERAL: Disconnected, handle 1, reason 0x3D.
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
<info> app: PERIPHERAL: Connected, handle 1.
<info> app: PERIPHERAL: BLE_GAP_EVT_SEC_PARAMS_REQUEST
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x1, procedure: Bonding, error: 133
<warning> peer_manager_handler: Disconnecting conn_handle 1.
<info> app: PERIPHERAL: BLE_GAP_EVT_AUTH_STATUS: status=0x85 bond=0x0 lv4: 0 kdist_own:0x0 kdist_peer:0x0
<info> app: PERIPHERAL: Disconnected, handle 1, reason 0x16.
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
<info> app: PERIPHERAL: Connected, handle 1.
<info> app: PERIPHERAL: BLE_GAP_EVT_SEC_PARAMS_REQUEST
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x1, procedure: Bonding, error: 133
<warning> peer_manager_handler: Disconnecting conn_handle 1.
<info> app: PERIPHERAL: BLE_GAP_EVT_AUTH_STATUS: status=0x85 bond=0x0 lv4: 0 kdist_own:0x0 kdist_peer:0x0
<info> app: PERIPHERAL: Disconnected, handle 1, reason 0x16.

  • Hi,

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

    The "4102" error corresponds to PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING and it indicates that the bonding information is deleted on the device, but not on another device side. Can you try deleting the bonding information on the peripheral (PCA10056) or a mobile (central) as well? Make sure to delete the bond information on all the devices. 

    Please let me know this can help or not. Thanks. 

    -Amanda H.

  • I cleared the memory and it works fine now.

    Even though it works, I have noticed that this serialized code (270k) is bigger than the original one (240k). The serialized code should have no software device code. 

    When I modified the code to serialized, I had removed "SOFTDEVICE_PRESENT".

    Anything else should I do?

    Thank you for your help

  • Hi, 

    The original example doesn't build and include the softdevice. In another word, the original one (240k) is the application without the softdevice. You need to load the application and the softdevice images to make it work, and segger will do that with the setting. Therefore, I guess adding serialization lib might make the size large than the original one. You might look into sdk_config.h and disable the configurations related softdevice if you are pretty sure the softdevice is not used. 

    -Amanda H.

  • You said: "You need to load the application and the softdevice images to make it work, and segger will do that with the setting"

    Could you please tell me where the setting is? 

    I guess, I build the hex file based on the original project settings and the softdevice image is still in the serialized code, even if it does not use it any more.

    Thank you for your help.

  • Hi, 

    Segger will load the softdevice when loading the application. You can remove the setting if you don't use the softdevice, but it will not affect the size of the application.  

    -Amanda H.

Related