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

nfr52840 - BLE_APP_CSCS - increase buffer length - BLE data

Hi,

I developing a application with the nfr52840 board with SDK 15.2. i have started form the ble_app_cscs example for development my code. I I would like to send packet data via BLE with lenght uqual to 200 byte. I have checked  that is possible send packet with lenght uqual to 20 byte, What i must implement on my code for increase the buffer lenght to send ?

Thanks you,

Parents
  • Probably you need to extend the NRF_SDH_BLE_GAP_EVENT_LENGTH value too.

    That is atleast how it is done in the throughput example in our SDK.

  • I have tried to follow the example ble_app_uart, where it changes the maximum size the packet, but i don't works. When i change these values NRF_SDH_BLE_GATT_MAX_MTU_SIZE ,  NRF_SDH_BLE_GAP_EVENT_LENGTH and   BLE_GATT_ATT_MTU_DEFAULT, the function nrf_sdh_ble_enable ( ) return error with code 0x04. The function nrf_sdh_ble_enable ( ) is contained in the function ble_stack_init ( ). Why the function nrf_sdh_ble_enable ( ) return error if i change these NRF_SDH_BLE_GATT_MAX_MTU_SIZE ,  NRF_SDH_BLE_GAP_EVENT_LENGTH and   BLE_GATT_ATT_MTU_DEFAULT value ?

  • What are the values you set to these defines and what is the error you get from nrf_sdh_ble_enable?

Reply Children
  • Hi,

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 247

    NRF_SDH_BLE_GAP_EVENT_LENGTH = 247

    BLE_GATT_ATT_MTU_DEFAULT = 247

    How i must set this define ? There are value fixed ?

     

    The nrf_sdh_ble_enable function return error with code 0x04.

    Is it possible that in the nrf52840 board the length of the BLE packets can't be changed? I have read this information here:link:devzone.nordicsemi.com/.../configurable-att-mtu

  • you should set BLE_GATT_ATT_MTU_DEFAULT to 23 to start with and let the exchange params procedure decide the correct length.

  • I setted the value in this way :

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 247

    NRF_SDH_BLE_GAP_EVENT_LENGTH = 247

    BLE_GATT_ATT_MTU_DEFAULT = 23

    But the function  nrf_sdh_ble_enable return error code 0x04 , that is equal NRF_ERROR_NO_MEM  (No Memory for operation). Probably in the nrf52840 board is not possible change the packet BLE size, it's correct ?        

  • The values are not fixed, they are defined in sdk_config.h file

  • Ok, i have setted like this : 

    NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 247

    NRF_SDH_BLE_GAP_EVENT_LENGTH = 247

    BLE_GATT_ATT_MTU_DEFAULT = 23

    But don't work, the function  nrf_sdh_ble_enable return error code 0x04 , that is equal NRF_ERROR_NO_MEM  (No Memory for operation). Probably in the nrf52840 board is not possible change the packet BLE size, it's correct ?