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

Using DLE and NRF_BLE_GATT_MAX_MTU_SIZE > 23

I've been trying to increase NRF_BLE_GATT_MAX_MTU_SIZE on SDK13.0.0 + SD123 5.0.0 trying to follow examples such as this as well as Throughput and Range Demo

For e.g. I tried setting MTU to 50, but keep getting the following output:

nrf_ble_gatt:DEBUG:Requesting to update ATT MTU to 50 bytes on connection 0x0.
nrf_ble_gatt:ERROR:sd_ble_gattc_exchange_mtu_request() returned unexpected value 0x7.
nrf_ble_gatt:DEBUG:Requesting to update data length to 54 on connection 0x0.
nrf_ble_gatt:INFO:Requesting rx octets 54, tx octets 54
nrf_ble_gatt:ERROR:sd_ble_gap_data_length_update() (request) on connection 0x0 returned unexpected value 0x13.
nrf_ble_gatt:ERROR:Limits tx_oct 27, rx_oct 27, time_us 0
nrf_ble_gatt:DEBUG:Peer on connection 0x0 requested a data length of 27 bytes.
nrf_ble_gatt:DEBUG:Updating data length to 27 bytes on connection 0x0.
nrf_ble_gatt:DEBUG:Data length updated to 27 on connection 0x0.
nrf_ble_gatt:DEBUG:max_rx_octets: 27
nrf_ble_gatt:DEBUG:max_tx_octets: 27
nrf_ble_gatt:DEBUG:max_rx_time: 328
nrf_ble_gatt:DEBUG:max_tx_time: 328

All the examples I've found use BLE_GAP_OPT_EXT_LEN which is not available on S132 4.0.4 or 5.0.0, so I still havent found a way to enable DLE

I'm clearly missing something here. Can someone please help me get NRF_BLE_GATT_MAX_MTU_SIZE > 23 working?

Any help is much appreciated, Thanks

Parents
  • Hi,

    Please refer to the Softdevice Migration document to see how to configure long MTU and DLE. The document is included in the zip file with the Softdevice hex file. Note that to configure a non-default link you will have to use a configuration tag other than 0 and then also make sure to start the advertiser with this tag. To change advertising tag you can use

    ble_advertising_conn_cfg_tag_set(tag); 
    

    I have attached a main.c file that I used for testing (based on the ble_app_template example in SDK 13.0 and S132 v4). Search for // MTU & DLE to see the changes I made.

    main.c

  • Thanks Martin, I was able to get the larger MTU to set after I changed #define BLE_GATT_ATT_MTU_DEFAULT in ble_gatt.h to 60 as well as NRF_BLE_GATT_MAX_MTU_SIZE to 60. Then I also modified the Android app to request larger MTU after connection is made.

    The connection stays on, but, now when I try to send a notification, sd_ble_gatts_hvx() returns BLE_ERROR_GATTS_SYS_ATTR_MISSING any ideas how I can fix this?

    Thanks again!

Reply
  • Thanks Martin, I was able to get the larger MTU to set after I changed #define BLE_GATT_ATT_MTU_DEFAULT in ble_gatt.h to 60 as well as NRF_BLE_GATT_MAX_MTU_SIZE to 60. Then I also modified the Android app to request larger MTU after connection is made.

    The connection stays on, but, now when I try to send a notification, sd_ble_gatts_hvx() returns BLE_ERROR_GATTS_SYS_ATTR_MISSING any ideas how I can fix this?

    Thanks again!

Children
No Data
Related