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

How to combine Buttonless DFU, battery service and a custom service?

Hi, there:

        I am developing on nRF52840 platform with SDK Version 17.0.0_9d13099. I am developing based on ble_peripheral/ble_app_buttonless_dfu.

I succeeded to combine DFU and Battery Service. I tried to read related topics but still can't find a way to combine 3 service, I tried the following configuration

static ble_uuid_t m_adv_uuids[] =
{
     {BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
    {BLE_UUID_OUR_SERVICE_UUID, BLE_UUID_TYPE_VENDOR_BEGIN+1},
    {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
};

and also I set NRF_SDH_BLE_VS_UUID_COUNT as 2 and corresponding ram adjustment. It's just NOT working

Below listed the error messages in RTTViewer

<info> app: Setting vector table to bootloader: 0x000F8000
<info> app: Setting vector table to main app: 0x00027000
<info> app_timer: RTC: initialized.
<error> app: Fatal error

        Can anyone give me some tips? Thanks!

Parents
  • After defining "DEBUG" in preprocessor, it turned out that the error come from ble_advertising_init, error description is "NRF_ERROR_INVALID_PARAM'.

  • Hello,

    Joshhsu.tw said:
    After defining "DEBUG" in preprocessor, it turned out that the error come from ble_advertising_init, error description is "NRF_ERROR_INVALID_PARAM'.

    Well done - this tells us that the problem here is the parameters passed to ble_advertising_init, as written in the ble_advertising_init API Reference documentation.
    What is the entire contents of your ble_advertising_init_t? Are you advertising with a device name and appearance?

    I suspect that either your packet is too long ( most likely ), since you are trying to include all those UUID's in your advertising, and the advertising packet length is limited to 31 bytes total.
    Either that, or you are making an invalid configuration.
    Could you try to run this again, but leave out the BAS and DIS UUID's from your advertisement? See if this resolves your error - if it does, then we know that the length is the problem. If the issue persists, then we know that it is an invalid configuration ( depending on the remaining content of your advertising packet, of course. ).

    Best regards,
    Karl

Reply
  • Hello,

    Joshhsu.tw said:
    After defining "DEBUG" in preprocessor, it turned out that the error come from ble_advertising_init, error description is "NRF_ERROR_INVALID_PARAM'.

    Well done - this tells us that the problem here is the parameters passed to ble_advertising_init, as written in the ble_advertising_init API Reference documentation.
    What is the entire contents of your ble_advertising_init_t? Are you advertising with a device name and appearance?

    I suspect that either your packet is too long ( most likely ), since you are trying to include all those UUID's in your advertising, and the advertising packet length is limited to 31 bytes total.
    Either that, or you are making an invalid configuration.
    Could you try to run this again, but leave out the BAS and DIS UUID's from your advertisement? See if this resolves your error - if it does, then we know that the length is the problem. If the issue persists, then we know that it is an invalid configuration ( depending on the remaining content of your advertising packet, of course. ).

    Best regards,
    Karl

Children
No Data
Related