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

sd_ble_uuid_vs_add: NRF_ERROR_NO_MEM inspite of same base UUID?

I am using SDK v11-alpha2 and following the BLE Services and BLE characteristics tutorial.

When calling sd_ble_uuid_vs_add as the Characteristics tutorial asks, I get a NRF_ERROR_NO_MEM error with the default attribute table size. I also tried increasing the attr_tab_size to 0x700, but that won't help. Why am I getting this NRF_ERROR_NO_MEM error? My vs_uuid_count = 1, but that should not be an issue. For both calls of sd_ble_uuid_vs_add I am using the same 128-bit base UUID, not two different ones.

BTW: I looked at the numerous previous questions regarding this issue, but they seem entirely unrelated to the problem here and talk about plenty of things I have not heard of.

Parents
  • So I identified the issue here, since the linked question is not a real answer to my key question:

    1. The core problem is a misunderstand - sd_ble_uuid_vs_add adds base UUIDs as opposed to complete UUIDs. I consider this a bug on the documentation side. To me, Nordic's code documentation of the SDK clearly suggests that sd_ble_uuid_vs_add adds 128-bit UUIDs including the 16-bit part which is unique for every service, characteristic etc. Thus, calling it a couple of times with different UUIDs (different octets 12 and 13) should not do the same. Please make it clear in the code comment that sd_ble_uuid_vs_add adds base UUIDs, not distinctive 128-bit full UUIDs and that octets 12 and 13 do not matter.

    2. The solution to the problem is not adding the same base UUID twice, i.e. only calling sd_ble_uuid_vs_add once for each base UUID, so typically only once in total in your own app's code.

  • The phrasing of the first line "Add a Vendor Specific UUID" (of sd_ble_uuid_vs_add) as well as the Characteristics Tutorial both suggest that the UUIDs for each non-Bluetooth-SIG service, characteristic etc need to be registered with the SoftDevice, not just their base. Generally, if you say "Vendor-specific UUID" this actually means every custom UUID, not just the prefix (base) of a bunch of custom ones, so I suggest to instead call it "Add a base of a Vendor Specific UUID" and maybe rename the function call to sd_ble_uuid_base_add.

Reply
  • The phrasing of the first line "Add a Vendor Specific UUID" (of sd_ble_uuid_vs_add) as well as the Characteristics Tutorial both suggest that the UUIDs for each non-Bluetooth-SIG service, characteristic etc need to be registered with the SoftDevice, not just their base. Generally, if you say "Vendor-specific UUID" this actually means every custom UUID, not just the prefix (base) of a bunch of custom ones, so I suggest to instead call it "Add a base of a Vendor Specific UUID" and maybe rename the function call to sd_ble_uuid_base_add.

Children
No Data
Related