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

connection parameter update request

Hello,

I made an application inspired from the ble_uart example project.

I encounter now a problem that I don't have with the ble_uart example.

I found that after few minutes, the connection is lost with nRF Connect (Android). Using a debugger, I see that the disconnection comes from a BLE_CONN_PARAMS_EVT_FAILED event that leads in a call to sd_ble_gap_disconnect().

Now I want to understand the reason why I get this BLE_CONN_PARAMS_EVT_FAILED event. Using a sniffer, I can see that there are 3 connection parameter update requests from the nRF52 that are rejected by the smartphone respectively 5s, 35s and 65s after connection establishment. 95s after connection establishment, the connection is lost.

Attached you can see what I use in the firmware as acceptable connection interval, I also show the content of the parameter update request from the nRF52 to the Smartphone.

  • Question 1: what would cause the nRF52 to request for connection parameters update? I don't see this request with the sniffer whant I run the ble_uart example, only with my application.

  • Question 2: do you think that the smartphone rejects the update request because of these strange values 0xFFFF for both minimum and maximum?

  • Question 3: what would cause the connection parameter request to include these strange values 0xFFFF for both minimum and maximum?

image description

image description

image description

SDK 11. S132 nRF52832 Keil

  • FormerMember
    0 FormerMember

    In your application, do you call gap_params_init(..)? In gap_params_init(..), the peripheral preferred connection parameters are set. Setting those parameters should apply those parameters during a connection parameter update.

    I would think that the reason for no connection parameter update when running ble_app_uart is that the original parameters set by the central is within the connection interval range for the peripheral.

  • Yes this method is called before I connect. sd_ble_gap_ppcp_set() is called with the valid parameters and returns 0x00.

    I can also read the GenericAccess service/Peripheral Preferred Connection Parameters with the correct values: 20ms/200ms/0/400.

    Can this sd_ble_gap_ppcp_set() function be called at anytime or should it be called absolutely before some other BLE initialization?

  • FormerMember
    0 FormerMember

    sd_ble_gap_ppcp_set(..) has to be called before conn_params_init(): conn_params_init() retrieves the set preferred connections parameters (ppcp) and use the retrieved parameters to check if, during a connection, the connection parameter are ok, see ble_conn_params_init(..) and conn_params_negotiation() --> is_conn_params_ok(..). Therefore, if sd_ble_gap_ppcp_set(..) is called after conn_params_init(), m_preferred_conn_params will not contain the ppcp, and hence, the device won't initiate a connection parameter update.

  • excellent! Thanks a lot, it solved my problem. I called the gap_params_init() function after conn_params_init() for some reason.

Related