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

Setting MTU Above 64 bytes Crashes ble_app_uart

Hi all,

I am trying to send a large stream of bytes(60kb) to an NRF52823 using bbowl. BBowl exposes the uart through a TCP socket connection using noble.

I modified the gatt_init code in SDK13 to support the largest MTU possible:

void gatt_init(void) {
    ret_code_t err_code;

    err_code = nrf_ble_gatt_init(&m_gatt, gatt_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_periph_set(&m_gatt, 155);
    APP_ERROR_CHECK(err_code); }

I validated that the MTU is set properly and that packets are being sent by using:

sudo hcidump -i -x

Problems

  1. The connect is very slow. It takes 2-5 minutes to transfer the full 60 kilobytes depending on the MTU.
  2. If the MTU is set above 64 bytes on the raspberry pi the transfer times out and/or the NRF52DK reboots.

Questions

  1. Could the NRF52DK be running out of memory due to the extremely fast MTU? Is there any way to verify? I didn't see anything in the J-Link logs.
  2. Is there a setting I can change to achieve an MTU of 241 bytes instead of 158?
  3. Do I need to increase the RX/TX buffer?
  4. Would it help to enable DLE with the SDK 13 examples? Or is it already enabled?

Thanks so much for your help!

Related