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

Too many services and characteristics --> NRF_ERROR_NO_MEM

Hello,

i create a custom profile with two services and with 30 characteristics. The first service has 29 characteristics. Up to this point everything is ok, but when I want to create the next service, NRF_ERROR_NO_MEM is returned. I already read that there is a static 1.5 kB of memory allocated for the GATT table internally in the softdevice. All my characteristics are located in BLE_GATTS_VLOC_USER. But the message NRF_ERROR_NO_MEM will nevertheless returned. What can I do to reduce the size in stack memory?

Parents
  • The Method sd_ble_gatts_characteristic_add returns the NO_MEMORY error. As you describe, I create the vendor specific base UUID only once with the function sd_ble_uuid_vs_add. Then I use the returned UUID type for all services and characteristics. But if I use as ble_uuid_t.type the BLE_UUID_TYPE_BLE and not the generated UUID Vendor Type, then I can create all the services and characteristics. Does a vendor UUID type needs more memory?

    If I use a vendor UUID type and create all characteristics with cccd_md.vloc = BLE_GATTS_VLOC_STACK instead of BLE_GATTS_VLOC_USER, I can create 1 service and 24 charertersitics. If I use attr_md.vloc = BLE_GATTS_VLOC_USER I can create 1 services with 29 characteristics and a second service with 0 characteristics. So with the VLOC_USER option I can create 5 characteristics and 1 service more before NO_Memory error is returned. Is it normal that the difference is so small here?

Reply
  • The Method sd_ble_gatts_characteristic_add returns the NO_MEMORY error. As you describe, I create the vendor specific base UUID only once with the function sd_ble_uuid_vs_add. Then I use the returned UUID type for all services and characteristics. But if I use as ble_uuid_t.type the BLE_UUID_TYPE_BLE and not the generated UUID Vendor Type, then I can create all the services and characteristics. Does a vendor UUID type needs more memory?

    If I use a vendor UUID type and create all characteristics with cccd_md.vloc = BLE_GATTS_VLOC_STACK instead of BLE_GATTS_VLOC_USER, I can create 1 service and 24 charertersitics. If I use attr_md.vloc = BLE_GATTS_VLOC_USER I can create 1 services with 29 characteristics and a second service with 0 characteristics. So with the VLOC_USER option I can create 5 characteristics and 1 service more before NO_Memory error is returned. Is it normal that the difference is so small here?

Children
  • I have a few more tests for version with vendor UUID and with BLE_UUID_TYPE_BLE. With vendor UUID i can create 29 charateristics and with BLE_UUID_TYPE_BLE I can create 45 charateristics.

    We have now optimized our protocol to less characteristics. Is it planned in the future to increase the static 1.5 kB of memory allocated for the GATT table or outsource this in the user area?

Related