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

buttonless DFU and NUS

Hi !

I am on a firmware project for a nrf52832. I am using SES on Windows. 

There seem to be a problem when combining buttonless DFU and NUS. When I do the services_init, I have to choose if I call 'ble_dfu_buttonless_init' or 'ble_nus_init'. If I call both, one of them raise an error in the ERROR_CHECK. 

I would like to now how to enable NUS and buttonless at the same time.

Thanks !

Parents
  • Hello,

    Can you please check what function inside ble_nus_init() that returned this?

    Not just inside the ble_nus_init() function, but keep digging until you find the softdevice call (sd_...()) that returned this value (4).

    The main suspect is that you need to increase the NRF_SDH_BLE_VS_UUID_COUNT from 1 to 2 in sdk_config.h.

    At least if it is the sd_ble_uuid_vs_add() that returns 4.

    BR,
    Edvin

Reply
  • Hello,

    Can you please check what function inside ble_nus_init() that returned this?

    Not just inside the ble_nus_init() function, but keep digging until you find the softdevice call (sd_...()) that returned this value (4).

    The main suspect is that you need to increase the NRF_SDH_BLE_VS_UUID_COUNT from 1 to 2 in sdk_config.h.

    At least if it is the sd_ble_uuid_vs_add() that returns 4.

    BR,
    Edvin

Children
  • Hi Edvin, 

    Thanks for your answer. You are right, I switched the NRF_SDH_BLE_VS_UUID_COUNT to 2 and had to move RAM start and size, now it works ! 

    Now, when I am avdertising, I am able to perform buttonless DFU with nrfToolbox. That part works fine. 

    The reason why I am using NUS is for a central to connect with the device and exchange data with the device. However, even though I see it advertising, the central does not connect like it used to before I setted up DFU. Is it anything else I need to change ?

    I suspect that part of the code to play a role : 

    ble_uuid_t m_adv_uuids[] =                                          /**< Universally unique service identifier. */
    {
        {BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}
    };

Related