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

  • Craig,

    how did you know how to set RAM?

    The program checks it in ble_stack_init(), it is output over the j-link RTT window. This is the code that checks the RAM settings:

    //Check the ram settings against the used number of links
    CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);
    

    The only difference I see between your code and mine was this link after the GATT Connected callback:

    sd_ble_gattc_exchange_mtu_request(m_conn_handle, NRF_BLE_MAX_MTU_SIZE);
    

    Adding this didn't seem to change anything, it works fine on small sends but breaks on large data transfers. Have you tested your code for the throughput using larger packet sizes?

Reply
  • Craig,

    how did you know how to set RAM?

    The program checks it in ble_stack_init(), it is output over the j-link RTT window. This is the code that checks the RAM settings:

    //Check the ram settings against the used number of links
    CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);
    

    The only difference I see between your code and mine was this link after the GATT Connected callback:

    sd_ble_gattc_exchange_mtu_request(m_conn_handle, NRF_BLE_MAX_MTU_SIZE);
    

    Adding this didn't seem to change anything, it works fine on small sends but breaks on large data transfers. Have you tested your code for the throughput using larger packet sizes?

Children
No Data
Related