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

Large MTU + DLE Softdevice Crash

Hello,

I have followed a couple of the posts on the devzone on how to increase the MTU and add the DLE support such as this.

However, whenever I send over 20 bytes of data I get an "app_error_fault".

  • I have logging enabled and changed my ram size so my ram should be set correctly.

  • I have set the MTU size in sdk_config.h:

    #define NRF_BLE_MAX_MTU_SIZE 75

  • I set the att size in the setup function

    ble_enable_params.gatt_enable_params.att_mtu = NRF_BLE_MAX_MTU_SIZE;

  • I have set the DLE options

    ble_opt_t opt; memset(&opt, 0, sizeof(opt));

      opt.common_opt.conn_evt_ext.enable = 1;  //DLE
      
      err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &opt);
      APP_ERROR_CHECK(err_code);
      
      opt.gap_opt.ext_len.rxtx_max_pdu_payload_size = NRF_BLE_MAX_MTU_SIZE+4; //DLE
      
      err_code = sd_ble_opt_set(BLE_GAP_OPT_EXT_LEN, &opt);
      APP_ERROR_CHECK(err_code);
    
  1. I changed ble_nus.h to use the longer MTU size:

    *//#define BLE_NUS_MAX_DATA_LEN (GATT_MTU_SIZE_DEFAULT - 3) /< Maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module. */ #define BLE_NUS_MAX_DATA_LEN (NRF_BLE_MAX_MTU_SIZE - 3) /< Maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module. /

Any ideas as to why the softdevice would crash on a long write? I get a message saying I have requested the longer MTU by the central as well.

Parents
  • I just did this yesterday, can you post your files here? You need to request the MTU from the central upon connection established. You can use a function sd_ble_request_mtu() I believe that is what its called....I can lookup my notes

  • After doing some sleuthing on the crash data, it seems my error is in the softdevice_handler.c,

    err_code = sd_ble_evt_get(mp_ble_evt_buffer, &evt_len);
    

    This function fails with a NRF_ERROR_DATA_SIZE

    My thought to fix this was to set the NRF_BLE_GATT_MAX_MTU_SIZE to allow for larger GATT chars.

    This seems to work with single long writes, but when I push a lot of data (1kb file) the nRF52 gets hung on FIFO handling. Perhaps my UART is not able to push the data out fast enough? At 115kbps for the uart you would think that would not pose any issues.

Reply
  • After doing some sleuthing on the crash data, it seems my error is in the softdevice_handler.c,

    err_code = sd_ble_evt_get(mp_ble_evt_buffer, &evt_len);
    

    This function fails with a NRF_ERROR_DATA_SIZE

    My thought to fix this was to set the NRF_BLE_GATT_MAX_MTU_SIZE to allow for larger GATT chars.

    This seems to work with single long writes, but when I push a lot of data (1kb file) the nRF52 gets hung on FIFO handling. Perhaps my UART is not able to push the data out fast enough? At 115kbps for the uart you would think that would not pose any issues.

Children
No Data
Related