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

sd_ble_gap_data_length_update error 0x13

Hi

I have a problem changing the max_rx_octets and max_tx_octets parameters with the sd_ble_gap_data_length_update function. On request from the app the size is attempted to be changed to the maximum value of 251.

I receive a 0x13 error (NRF_ERROR_RESOURCES), and the limitation struct states that the size is 101 bytes too long.

On connection the data length is attempted to be changed to 255 and I have not investigated this.

In sdkconfig.h following is configured: #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 251

Using S132 rev. 5.0.0 SoftDevice.

Thanks in advance.

Here is a log from the communication.

[009.000 ble cmp] ble_mms_on_ble_evt: Connected
[009.000 ble inf] nrf_ble_gatt_on_ble_evt: BLE_GAP_EVT_CONNECTED
[009.000 ble deb] Requesting to update ATT MTU to 64 bytes on connection 0x0.
[009.000 ble deb] on_connected_evt: data length 255 > 27
[009.000 ble deb] Requesting to update data length to 255 on connection 0x0.
[009.000 ble err] data_length_update size=255, time=0
[009.000 ble err] sd_ble_gap_data_length_update() (request) on connection 0x0 returned unexpected value 0x7.
[009.000 ble err] Limitations: rx=0 tx=0 time=0
[009.000 ble cmp] ble_evt_handler: Other: 0x3A
[009.000 ble cmp] ble_mms_on_ble_evt: Other: 0x3A
[009.000 ble inf] nrf_ble_gatt_on_ble_evt: BLE_GATTC_EVT_EXCHANGE_MTU_RSP
[009.000 ble deb] ATT MTU updated to 64 bytes on connection 0x0 (response).
[009.000 ble cmp] gatt_evt_handler: Data len is set to 0x3D (61)
[009.000 ble cmp] ble_evt_handler: BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST
[009.000 ble cmp] ble_mms_on_ble_evt: Other: 0x23
[009.000 ble inf] nrf_ble_gatt_on_ble_evt: BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST
[009.000 ble deb] Peer on connection 0x0 requested a data length of 251 bytes.
[009.000 ble deb] Updating data length to 251 bytes on connection 0x0.
[009.000 ble err] sd_ble_gap_data_length_update() (reply) returned unexpected value 0x13.
[009.000 ble err] Limitations: rx=101 tx=101 time=1612
[017.000 ble cmp] Disconnected
[017.000 ble cmp] ble_mms_on_ble_evt: Disonnected
[017.000 ble inf] nrf_ble_gatt_on_ble_evt: BLE_GAP_EVT_DISCONNECTED

Kasper

Parents Reply Children
  • There is no exact answer to this as that is depending on the application. So the GAP event length wil affect the number of buffer used by communications. the longer the lengtht the more buffers (max 7 i think). You can also have longer events by using the connection extension in the options api, if you want to limit the number of buffers and still be able to send many packets per connection event. The attribute table will need to be increased if you have a lot of services and characteristics, and/or if the size of the characteristics increase. So if you get a NRF_ERROR_NO_MEM when adding service and characteristecs you need to increase the attr_tab_size.

Related