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.

  • Hi, same problem is also got to me, by changing the p_ble_enable_params->common_enable_params.vs_uuid_count = 2 two 128 bit uuid services are added successfully but I got the problem with pstorage module when increase p_ble_enable_params->common_enable_params.vs_uuid_count more than 1. That is when I write the data to pstorage using pstroae_store() it gives NRF_SUCESS returns but after if I checked is their any pending operations by using pstorage_access_status_get() it always gives 1 always. If I take p_ble_enable_params->common_enable_params.vs_uuid_count = 1; then these problem is not rising i.e it gives pending operations 0. what is the relation b/w pstorage and vs_uuid_count. Can any one help me to solve these problem. The code I am using is

    pstorage_clear(&m_pstorage_handle,44);

    pstorage_store(&m_pstorage_handle,(uint8_t *)uart_data,44);

    uint_32 pending_ops;

    pstorage_access_status_get(&pending_ops);

    while(pending_ops != 0) { pstorage_access_status_get(&pending_ops); }

    • List item
Reply
  • Hi, same problem is also got to me, by changing the p_ble_enable_params->common_enable_params.vs_uuid_count = 2 two 128 bit uuid services are added successfully but I got the problem with pstorage module when increase p_ble_enable_params->common_enable_params.vs_uuid_count more than 1. That is when I write the data to pstorage using pstroae_store() it gives NRF_SUCESS returns but after if I checked is their any pending operations by using pstorage_access_status_get() it always gives 1 always. If I take p_ble_enable_params->common_enable_params.vs_uuid_count = 1; then these problem is not rising i.e it gives pending operations 0. what is the relation b/w pstorage and vs_uuid_count. Can any one help me to solve these problem. The code I am using is

    pstorage_clear(&m_pstorage_handle,44);

    pstorage_store(&m_pstorage_handle,(uint8_t *)uart_data,44);

    uint_32 pending_ops;

    pstorage_access_status_get(&pending_ops);

    while(pending_ops != 0) { pstorage_access_status_get(&pending_ops); }

    • List item
Children
No Data
Related