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

Connection parameter update handling

Hello,

We are using SDS 6.0.0, SDK 5.2.0 on an nRF51822. Our application is a data logger that can collect up to 128Kbytes of data. Users can connect to the data logger and use our iOS application to offload the data. We are encountering a problem where the call to the function sd_ble_gap_conn_param_update is returning NRF_BUSY. What is happening is that the users are connecting to the data logger and initiating a data offload prior to the first time the connection parameter update timer fires (5 second timer). The data offload attempts to move the up to 128Kbytes of data over to the mobile as fast as possible, so I am jamming packets onto the radio as fast as it will let me.

I suspect when this happens it is possible we have jammed enough data onto the radio to transfer to the host that the radio can not accommodate the sd_ble_gap_conn_param_update request. This causes the code in module ble_conn_parms.c function update_timeout_handler to call the m_conn_params_config.error_handler function which in turn triggers an ASSERT.

In the case of NRF_BUSY as an error code, I'd prefer not to ASSERT. Would it be reasonable to check for NRF_BUSY as a return code and if so allow update_timeout_handler to exit without calling the error handler. Then allow the next BLE_GAP_EVT_CONN_PARAM_UPDATE event to restart the update timer?

I'm asking this question out of an abundance of caution. I'm just days away from cutting this FW over to production and I don't want to make a change that may cause subtle problems I don't catch in my bench testing, but causes problems for our customers.

Thanks, John

Parents
  • Hi John,

    sd_ble_gap_conn_param_update() will only return NRF_ERROR_BUSY if a previous connection parameter update procedure is still ongoing. Air traffic should have nothing to do with it.

    Are you sure you are waiting for a BLE_GAP_EVT_CONN_PARAM_UPDATE before you retry initiating the procedure?

    You can see a chart of the procedure here: devzone.nordicsemi.com/.../a00817.html

    Carles

  • Hi Carles,

    Thanks for the response and good question. I cannot say I am sure that the connection parameter update procedure isn't being triggered while a previous one is outstanding. I am using the ble_conn_params.c file provided as part of the SDK. I just skimmed through the code and it does appear there potentially are ways to restart the m_conn_params_timer_id timer when a previous connection parameters update procedure is running.

    I did change the code to not assert on the NRF_BUSY return code and it seems to do no harm. It has been running on many devices in our QA department with no problems.

Reply
  • Hi Carles,

    Thanks for the response and good question. I cannot say I am sure that the connection parameter update procedure isn't being triggered while a previous one is outstanding. I am using the ble_conn_params.c file provided as part of the SDK. I just skimmed through the code and it does appear there potentially are ways to restart the m_conn_params_timer_id timer when a previous connection parameters update procedure is running.

    I did change the code to not assert on the NRF_BUSY return code and it seems to do no harm. It has been running on many devices in our QA department with no problems.

Children
No Data
Related