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

NRF ERROR DATA SIZE in from sd_ble_evt_get in softdevice_handler.c

Hi,

I am trying to increase MTU size for transfers and it works up to a size of about 72. After that I get an error.

Thanks to Sigurd I now know that it is when calling sd_ble_evt_get() in nrf_sdk/softdevice/common/softdevice_handler/softdevice_handler.c (line 187) that returns error 12, which I have decoded to NRF_ERROR_DATA_SIZE.

There must be a place I have forgotten to set proper size and up to certain point it breaks.

Anyone having inputs or pointers?

Thanks!

  • Hi,

    You shoud add the define NRF_BLE_GATT_MAX_MTU_SIZE in sdk_config.h, so that the size of BLE event message buffer is set correctly.

    In ble_stack_handler_types.h we have the following code in sdk12.2 that will set the buffer size based on NRF_BLE_GATT_MAX_MTU_SIZE /GATT_MTU_SIZE_DEFAULT :

    /** @brief  Default Maximum ATT MTU size.
     *
     * This define should be defined in the sdk_config.h file to override the default.
     */
    
    #ifndef NRF_BLE_GATT_MAX_MTU_SIZE
        #define NRF_BLE_GATT_MAX_MTU_SIZE GATT_MTU_SIZE_DEFAULT
    #endif
    
    #define BLE_STACK_EVT_MSG_BUF_SIZE       (sizeof(ble_evt_t) + (NRF_BLE_GATT_MAX_MTU_SIZE))
    
  • Thanks Sigurd,

    Sorry for long time to answer, but I have now tested this and it works as far as I can test.

    I discovered that I am not using 12.2, but 12.1 or 12.0. But it was simple enough to add these lines to ble_stack_handler_types.h and get it running.

    Thanks again!

Related