This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I get soft reset when MTU is bigger than 65

Hello!

I am trying to increase the MTU size to get higher speeds. When I increase the MTU above 65 the application locks/software reset when doing transfer. Up to 65 it works. I have increased RAM memory for SoftDevice a lot. No difference. I check the return value of softdevice_enable(). Always zero. I have not enabled DLE.

65 sounds awfully close to 64, but it is still a bit strange value.

Any hints or tips would be appreciated

  • Hi,

    What SDK version are you using? What example in the SDK are you testing this on?

    In e.g. SDK 13 in the ble_app_uart example you set the ATT_MTU with the nrf_ble_gatt_att_mtu_periph_set() function:

    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, 64);
        APP_ERROR_CHECK(err_code);
    }
    
  • General Note: A reset indicates that you are running into the error handler, where the default behavior is to do a reset. You should then debug in order to find the reason for the reset. See this post about debugging.

  • Hi Sigurd,

    I use SDK 12.2 (SD132).

    I do not test on any particular example, I do test it on our application directly. I try to speed up transfers and currently increasing the MTU seems to be the only viable way.

    I set MTU by:

    #if (NRF_SD_BLE_API_VERSION == 3)
        ble_enable_params.gatt_enable_params.att_mtu = NRF_BLE_MAX_MTU_SIZE;
    #endif
        // Enable BLE stack.
        ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
        err_code = softdevice_enable(&ble_enable_params);
        APP_ERROR_CHECK(err_code);
    

    I hope this is the way to do it in 12.*.

    I will check out the debugging post you refer to, thanks!

  • Are you handling the event BLE_GATTC_EVT_EXCHANGE_MTU_RSP ? and starting the ATT_MTU exhange with sd_ble_gattc_exchange_mtu_request() ? Take a look at the S132 v.3.0.0 migration document. "Configurable ATT_MTU" section contains information you need.

    You can also find an example on how to enable DLE and increase ATT_MTU for SDK 12 in this post.

  • Hi Sigurd,

    your debug suggestion worked. I have now found that the error comes from softdevice_handler.c line 187 and I get NRF_ERROR_DATA_SIZE (error code 12). I do not understand why.

    I will close this and open a new question, thanks for the help!

    /Stefan

Related