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

BLE characteristic disappears as MTU size increases

Hi,

I trying to use higher MTU size for my application and i have followed the  att mtu throughput example. it is working fine upto 50 bytes packet size but when i try to increase it beyond 50 my last characteristic is not showing up. does this a memory issue or result of a bad programming ? also if i increase the mtu size to 247, all 3 characteristics of a service is missing

My application has the following services,

generic acces, generic att, secure DFU, device information(with 3 chara), battery service(2 chara), heart rate service, and 3 custom service with a total of 7 characteristics.

my application size is around 107 kb,

and it has a dfu bootloader and s132 softdevice.

i have also observed that if i remove one more service, i can increase the MTU size a bit more?

has anybody faced similar issues ?

Parents
  • Check the error code returned by sd_ble_gatts_characteristic_add(). You can add wrap the call in an APP_ERROR_CHECK(). I'm pretty sure it's returning NO_MEM, i.e. you haven't allocated enough memory for the softdevice.

    If that's you're problem, the easiest way to fix it is by increasing NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE in sdk_config.h. It's pretty much a trial and error process or at least I've been told so by Nordic employees, I don't know what the formula for that value should be. Increase it in steps of 256 bytes or so until you don't have errors any longer.

Reply
  • Check the error code returned by sd_ble_gatts_characteristic_add(). You can add wrap the call in an APP_ERROR_CHECK(). I'm pretty sure it's returning NO_MEM, i.e. you haven't allocated enough memory for the softdevice.

    If that's you're problem, the easiest way to fix it is by increasing NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE in sdk_config.h. It's pretty much a trial and error process or at least I've been told so by Nordic employees, I don't know what the formula for that value should be. Increase it in steps of 256 bytes or so until you don't have errors any longer.

Children
Related