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

Increasing MTU size

Board: nRF52840DK

SDK: 15.3.0

Softdevice: 6.11

I am trying to increase the MTU size in order to read more data on the peripheral. I have tried to increase the NRF_SDH_BLE_GATT_MAX_MTU_SIZE to anything above 26 and the UART logs stops printing, as I have understood from reading over devzone that the RAM and FLASH address needs to be adjusted as suggested in logs, but my logs go completely blank.

I also increased that NRF_SDH_BLE_GAP_EVENT_LENGTH to 400 but to no avail. 

Finally I tried 2 calls that I saw on the forum

 1. nrf_ble_gatt_att_mtu_periph_set()

2. nrf_ble_gatt_data_length_set()

at the execution of both of these, the app crashes with "fatal error", the latter command gave me this error

<info> app: mtu of 200 requested

<error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_RESOURCES.

<error> nrf_ble_gatt: The requested TX/RX packet length is too long by 169/169 octets.

is there something I am missing ?

Please help me get through this

Thanks !

  • Hi,

    Please try to compare you configuration with the peripheral ble_app_uart example. This example is set up by default to support MTU=247 and a 251 byte radio packet length. Also, are you calling nrf_sdh_ble_default_cfg_set() when initializing the Softdevice? This ensures that the Softdevice configurations from sdk_config.h actually gets applied.

    the app crashes with "fatal error",

    You should get a more detailed crash log if you build the project with "DEBUG" globally defined. If you use Segger embedded studio, ot becomes defined if you change from the Release to the Debug configuration.

    Best regards,

    Vidar

  • Hi Vidar, thank you so much for your reply. 

    I am so sorry for the delay. 

    For some weird reasons, the crash log wasn't getting printed even though normal logs were working fine. 

    So, I took to the 'blinky' example and changed the size of MTU over there, as expected the crash log got printed and I got the RAM START address and MAX RAM printed over there. 

    I simply copied those values in my project and everything is working fine now. 

Related