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

LMP Responese Timeout - nRF52840 S140v6.1.0 SDK 15.2.0

Hello everybody,

I'm using nRF5280 (Laird BL654) with SoftDeveice S140v6.1.0 and SDK 15.2.0 with a modified version of the blinky peripheral example.

I've changed NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 138 and NRF_SDH_BLE_GAP_DATA_LENGTH to 142

After connecting to this chip with a Samsung Galaxy S7 with Android 8.0.0 the chip disconnects with reason 0x22 (LMP Response Timeout).

I've attached the debug log from SES.


Galaxy S7 Android 8.0.0  MTU 138 Bytes

<debug> nrf_sdh_ble: RAM starts at 0x20002768
<info> app: Blinky example started.
<debug> nrf_sdh_ble: BLE event: 0x10.
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 138 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 142 on connection 0x0.
<info> app: Connected
<debug> nrf_sdh_ble: BLE event: 0x3A.
<debug> nrf_ble_gatt: ATT MTU updated to 138 bytes on connection 0x0 (response).
<debug> nrf_sdh_ble: BLE event: 0x12.
<debug> nrf_sdh_ble: BLE event: 0x12.
<debug> nrf_sdh_ble: BLE event: 0x12.
<debug> nrf_sdh_ble: BLE event: 0x11.
<info> app: Disconnected reason: 0x22

This problem occures only with this specific phone and if the MTU is larger than 23.

For example this is the debug log of a connection with a Galaxy S9 with Android 9.0.0 and an MTU of 138.

alaxy S9 Android 9.0.0 MTU 138 Bytes

<debug> nrf_sdh_ble: RAM starts at 0x20002768
<info> app: Blinky example started.
<debug> nrf_sdh_ble: BLE event: 0x10.
<debug> nrf_ble_gatt: Requesting to update ATT MTU to 138 bytes on connection 0x0.
<debug> nrf_ble_gatt: Updating data length to 142 on connection 0x0.
<info> app: Connected
<debug> nrf_sdh_ble: BLE event: 0x3A.
<debug> nrf_ble_gatt: ATT MTU updated to 138 bytes on connection 0x0 (response).
<debug> nrf_sdh_ble: BLE event: 0x24.
<debug> nrf_ble_gatt: Data length updated to 142 on connection 0x0.
<debug> nrf_ble_gatt: max_rx_octets: 27
<debug> nrf_ble_gatt: max_tx_octets: 142
<debug> nrf_ble_gatt: max_rx_time: 328
<debug> nrf_ble_gatt: max_tx_time: 2120
<debug> nrf_sdh_ble: BLE event: 0x12.
<debug> nrf_sdh_ble: BLE event: 0x23.
<debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 27 bytes.
<debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
<debug> nrf_sdh_ble: BLE event: 0x24.
<debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
<debug> nrf_ble_gatt: max_rx_octets: 27
<debug> nrf_ble_gatt: max_tx_octets: 27
<debug> nrf_ble_gatt: max_rx_time: 328
<debug> nrf_ble_gatt: max_tx_time: 2120
<debug> nrf_sdh_ble: BLE event: 0x12.
<debug> nrf_sdh_ble: BLE event: 0x12.

Parents Reply Children
  • Hi ,

    I have only changed the MTU.

    I Havn't toched the connection interval.

    #define MIN_CONN_INTERVAL               MSEC_TO_UNITS(100, UNIT_1_25_MS)        /**< Minimum acceptable connection interval (0.5 seconds). */
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(200, UNIT_1_25_MS)        /**< Maximum acceptable connection interval (1 second). */
    #define SLAVE_LATENCY                   0                                       /**< Slave latency. */
    #define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)         /**< Connection supervisory time-out (4 seconds). */
    
    #define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(20000)                  /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (15 seconds). */
    #define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(5000)                   /**< Time between each call to sd_ble_gap_conn_param_update after the first call (5 seconds). */
    #define MAX_CONN_PARAMS_UPDATE_COUNT    3                                       /**< Number of attempts before giving up the connection parameter negotiation. */
    
    #define BUTTON_DETECTION_DELAY          APP_TIMER_TICKS(50)                     /**< Delay from a GPIOTE event until a button is reported as pushed (in number of timer ticks). */

    These are the original connection Parameter from the example.

  • Hi,

    In nrf_ble_gatt.c, inside data_length_update(..), could you add these two lines:

    err_code = sd_ble_gap_data_length_update(conn_handle, &dll, &dll);
    return err_code;

    Like this:

    static ret_code_t data_length_update(uint16_t conn_handle, uint16_t data_length)
    {
        NRF_LOG_DEBUG("Updating data length to %u on connection 0x%x.",
                      data_length, conn_handle);
    
        ble_gap_data_length_params_t const dlp =
        {
            .max_rx_octets  = data_length,
            .max_tx_octets  = data_length,
            .max_rx_time_us = BLE_GAP_DATA_LENGTH_AUTO,
            .max_tx_time_us = BLE_GAP_DATA_LENGTH_AUTO,
        };
    
        ble_gap_data_length_limitation_t dll = {0};
    
        ret_code_t err_code = sd_ble_gap_data_length_update(conn_handle, &dlp, &dll);
        if (err_code != NRF_SUCCESS)
        {
            NRF_LOG_ERROR("sd_ble_gap_data_length_update() (request) on connection 0x%x returned %s.",
                          conn_handle, nrf_strerror_get(err_code));
    
            if (   (dll.tx_payload_limited_octets != 0)
                || (dll.rx_payload_limited_octets != 0))
            {
                NRF_LOG_ERROR("The requested TX/RX packet length is too long by %u/%u octets.",
                              dll.tx_payload_limited_octets, dll.rx_payload_limited_octets);
    +                         err_code = sd_ble_gap_data_length_update(conn_handle, &dll, &dll);
    +                         return err_code;
            }
    
            if (dll.tx_rx_time_limited_us != 0)
            {
                NRF_LOG_ERROR("The requested combination of TX and RX packet lengths "
                              "is too long by %u microseconds.",
                              dll.tx_rx_time_limited_us);
            }
        }
    
        return err_code;
    }

    See if this helps you solve the problem?

  • Hi,

    I have added these two lines but it didn't help me.

    The Problem is still the same.

    The error code after  sd_ble_gap_data_length_update(conn_handle, &dlp, &dll)  is NRF_SUCCESS so the added lines of code won't get executed

    However I have found out that there are no problems with SD132v6.1.0.

    I have tried the app_blinky example for pca10040 on the pca10056 with the same modifications i have mentioned above. (changed NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 138 and NRF_SDH_BLE_GAP_DATA_LENGTH to 142)

    With this example the S7 didn't disconnect with LMP Response Timeout.

    P.S.

    I think there is a typo in the two lines I should add.

    I think they schould be like this:

    err_code = sd_ble_gap_data_length_update(conn_handle, &dlp, &dll);
    return err_code;

  • So it works when you use the PCA10040 project but not when you are using the PCA10056 project?

    No, it isn't a typo. 

  • OK

    Yes it works with the PCA10040 project but not with the PCA10056 project.

Related