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
  • I actually just found the file. I modified the linker file as such:

    MEMORY
    {
    UNPLACED_SECTIONS (wx) : ORIGIN = 0x100000000, LENGTH = 0
    RAM (wx) : ORIGIN = 0x20000016, LENGTH = 0x0000FFEA
    FLASH (wx) : ORIGIN = 0x00000000, LENGTH = 0x00080000
    }

    Where the original RAM origin was at 0x20000000 and Length was 0x00010000.

    I'm using Seeger embedded studio for reference.

    It seems that when I rebuild the file it gets automatically regenerated with the default values, overwriting my changes. But then it crashes before it even enters the main.

Children
Related