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

Issue with simultaneous 16-bit UUID Heart Rate Service example and blank 128-bit vendor specified custom service

Hi. I am currently using an nRF52840 DK board and SDK 17.0.2.

I require 16-bit heart rate service UUID to work with a 128-bit vendor specified custom service.

When I create the custom service and tested alone, it is working fine.

However, when I tested with the heart rate service there is an issue.

The issue is show in the pic below:

The error code after the call of ble_advertising_init has no value.

Then goes to NRF_BREAKPOINT_COND

I require assistance in this issue.

Thank you and appreciate the help. 

  • Hi,

    What do you mean by error code having no value? Is it just that you are debugging optimized code? You need to disable optimization when inspecting code - if using a SES example project, just select the Debug build target.

    I see from your debugger screenshot that you are at VERIFY_SUCCESS for the return value from uuid_list_encode(). I assume that is because that is where the error is detected, meaning that err_code has a value other than 0 (NRF_SUCCESS)? Please confirm what the error code is and from where. That should give a good indication on what the issue is.

    Assuming it is uuid_list_encode() then the error is likely from sd_ble_uuid_encode(), and should be either NRF_ERROR_INVALID_ADDR if an invalid pointer is used or NRF_ERROR_INVALID_PARAM if an invalid UUID type is used. I suspect the latter?. Depending on which base UUID you add first, the type will differ (first added becomes BLE_UUID_TYPE_VENDOR_BEGIN = 0x02, second 0x03, etc.). It would only fit if you have more than one custom UUID though, which is not indicated by your post.

  • Hi. So sorry. The error code is 12 and can I confirm that I should add BLE_UUID_TYPE_VENDOR_BEGIN first? 

    Can you give me an example on how to combine 16-bit UUID and 128-bit UUID services?

    If that is okay with you?

    With the example I can better understand how to implement.

    Thank you.

  • Hi,

    Looking at the error I do not think this is related to combining 16 bi tand 128 bit UUIDs specifically. Error 12 is NRF_ERROR_DATA_SIZE and looking at the SDK code you would get this if there is not enough room in the advertising packet to be encoded (size is given by the last parameter in ble_advdata_encode()). Specifically this propagates to uuid_list_encode() and then to uuid_list_sized_encode() where I expect this error originates. Can you confirm? If so, you need to remove something from your advertising packet so that it is no longer too large. If still needed you can move to the scan response packet instead.

  • Hi. Looks like there is a current time service 16-bit. Therefore, currently I do not need a 128-bit UUID custom service. I have changed my code and it is working with some minor issues. But I will raise a ticket on that on a separate ticket. Thanks for the reply. Really appreciate the help.

Related