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 error code 4

Hello All,

I have looked around for answers to my specific issue, however I did not seem to find one that aided me enough to fix my issue.

I have created a BLE profile with BDS and utilized the Nordic plugin to generate the code. Everything seemed to work out well, but I have an issue when initializing my custom service.

The code breaks down when attempting to add a custome base UUID. This is the snippet of code from my service .c file. I traced the code and this is where it breaks.

ble_uuid128_t bds_base_uuid = {{0xD0, 0x70, 0x1F, 0x19, 0x94, 0xB8, 0xF2, 0x86, 0xF5, 0x4A, 0xF5, 0xFF, 0x00, 0x00, 0x84, 0x56}};
uint8_t uuid_type;
err_code = sd_ble_uuid_vs_add(&bds_base_uuid, &uuid_type); <----- Right here.
if (err_code != NRF_SUCCESS)
{
return err_code;
}

My first thought is that I needed to modify the main.c file in this location:

// YOUR_JOB: Use UUIDs for service(s) used in your application.
static ble_uuid_t m_adv_uuids[] = /**< Universally unique service identifiers. */
{
{BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
};

But I cannot seem to figure out the correct way.

Here is a trace of my locals from the execution right after the error code is generated. 

If anyone can point me in the right direction or tell me what easy thing is missing I'd very much appreciate it!

Thanks!

Adam

Parents Reply
  • When you increase the number of vendor-specific UUIDs, the softdevice needs more RAM. Your application is crashing when initializing because you haven't updated the linker script to reflect the new RAM regions.

    If you enable the debug output you should be able to see how you need to adjust the RAM size and start address. If you can't see it simply add 16 bytes to the start and subtract 16 from the size per each new UUID you add.

Children
Related