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

Device reset when calling sd_ble_uuid_vs_add second time

I am using nRF5_SDK_11.0.0-2.alpha_bc3f6a0 with PCA10040 and GCC. I am working on the ble hrs with DFU example. I have modify the hrs to my custom service with a 128bit service UUID. I have call sd_ble_uuid_vs_add 2 times, first one is for my custom service init and the second one is in ble_dfu_init. On the second time, it will return NRF_ERROR_NO_MEM and cause the device reset. If I do not include the DFU service or do not include my custom service, it will working fine. Is there any solution for that?

image description

ble_hrs.c

ble_hrs.h

Parents
  • I found the cause: In ble_stack_init, the default ble_enable_params are set using softdevice_enable_get_default_config. If you go to the definition, you'll see that

    p_ble_enable_params->common_enable_params.vs_uuid_count   = 1;
    

    With this configuration you can only add one vendor specific UUID to the BLE stack's UUID table. However, if you set .vs_uuid_count to 2, i.e.

    p_ble_enable_params->common_enable_params.vs_uuid_count   = 2;
    

    you can add two vendor specific UUIDs to the table,i.e. your custom UUID and the DFU service UUID base.

Reply
  • I found the cause: In ble_stack_init, the default ble_enable_params are set using softdevice_enable_get_default_config. If you go to the definition, you'll see that

    p_ble_enable_params->common_enable_params.vs_uuid_count   = 1;
    

    With this configuration you can only add one vendor specific UUID to the BLE stack's UUID table. However, if you set .vs_uuid_count to 2, i.e.

    p_ble_enable_params->common_enable_params.vs_uuid_count   = 2;
    

    you can add two vendor specific UUIDs to the table,i.e. your custom UUID and the DFU service UUID base.

Children
Related