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

SDK15 pm_conn_secure() doesn't bond

Hi!

After connected and get log info "Connected." I start bonding:

Fullscreen
1
2
3
4
5
6
// Initiate bonding.
err_code = pm_conn_secure(p_ble_evt->evt.common_evt.conn_handle, false);
if (err_code != NRF_ERROR_INVALID_STATE)
{
APP_ERROR_CHECK(err_code);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

but there is no any success message. 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
0> <info> app: Heart Rate collector example started.
0> <info> app: Starting scan.
0> <info> app: Connected.
0> <info> app: Disconnected, reason 0x8.
0> <info> app: Starting scan.
0> <info> app: Connected.
0> <info> app: Disconnected, reason 0x8.
0> <info> app: Starting scan.
0> <info> app: Connected.
0> <info> app: Disconnected, reason 0x8.
0> <info> app: Starting scan.
0> <info> app: Connected.
0> <info> app: Disconnected, reason 0x8.
0> <info> app: Starting scan.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Therefore nRF52 SDK15 can't to made secure bond.

Why?

Parents
  • FormerMember
    0 FormerMember

    The SDKs do only provide a higher level abstraction, so different SDK version should not matter. In the application, for both central and peripheral, could you set the logging level to "debug"? And also enable logging for the "peer manager" module?

    With the above settings, could you do the following bonding tests:

    • SDK15 <--> SDK13: not working
    • SDK15 <--> SDK 15: working (for the peripheral, use a SDK example)
    • SDK13 <--> SDK 13: working (for the central, use a SDK example)

    And then upload the logs here.

  • Hi! I use RTT debugging. How to set logging for peer manager?

    SDK15--SDK15- all OK

    SDK13--SDK13- all OK

    SDK15 perph --- SDK13 central- OK

    SDK15 central ---- SDK 13 periph- doesn't works.

    how to enable logging for peer manager?

  • FormerMember
    0 FormerMember in reply to Mikhail

    Yes, you can disable MTU request in the SDK15 central by not calling sd_ble_gattc_exchange_mtu_request().

  • in wich case should I do it? In wich part of code.

  • FormerMember
    0 FormerMember in reply to Mikhail

    Instead of disabling MTU exchange request in SDK 15, it is better to add support for it in your SDK 13  peripheral. If max MTU size for the SDK 13 peripheral should remain 23, you can do something like this in on_ble_evt() in main.c:

     

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    case BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST:
    ret_code_t err_code;
    uint16_t mtu_size_supported_by_peripheral = 23;
    err_code = sd_ble_gatts_exchange_mtu_reply(conn_handle, mtu_size_supported_by_peripheral);
    if (err_code != NRF_SUCCESS)
    {
    NRF_LOG_ERROR("sd_ble_gatts_exchange_mtu_reply() returned unexpected value 0x%x.",
    err_code);
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

     

     

  • Yes, I understand it that better was add MTU in the SDK13. But If we already have project on the SDK13 and don't want any change it? Is it possible to disable MTU request on central side SDK15?

  • FormerMember
    +1 FormerMember in reply to Mikhail

    Yes, the MTU exchange is initiated by the central/client when calling  sd_ble_gattc_exchange_mtu_request().  Not calling/commenting out that function will disable MTU request exchange.

Reply Children