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

Combining BLE NUS and Buttonless DFU

Hi everyone,
I am trying to use Buttonless DFU to reprogram the NRF 52 dev kit OTA. I had posted a question on the forum and had solved that problem:
devzone.nordicsemi.com/.../191437
I am now trying to combine my BLE NUS app with buttonless DFU without much success. It compiles without error but will not run. I tried the sample ble_app_uart instead and I am getting the same result. Which makes me think, I am doing it wrong. These are the changes.
1. In main.c:
static ble_uuid_t m_adv_uuids[]          =                                          /**< Universally unique service identifier. */
{
    {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
    {BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}
};
I added the DFU service UUID.
2. In services_init in main.c, I added:
    ble_dfu_buttonless_init_t dfus_init = {0};
    dfus_init.evt_handler = ble_dfu_evt_handler;
    err_code = ble_dfu_buttonless_init(&dfus_init);
    APP_ERROR_CHECK(err_code);
3. In the main of main.c:
    // Initialize the async SVCI interface to bootloader before any interrupts are enabled.
    err_code = ble_dfu_buttonless_async_svci_init();
    APP_ERROR_CHECK(err_code);
4. In sdk_config.h:
#define NRF_SDH_BLE_VS_UUID_COUNT 2
5. In ble_app_uart_gcc_nrf52.ld, there is:
RAM (rwx) :  ORIGIN = 0x20002a98, LENGTH = 0xd568
Should I change this and if so to what number?
The code works only when I comment out all the DFU parts and make NRF_SDH_BLE_VS_UUID_COUNT=1.
Searching through forums, the answers have been to change NRF_SDH_BLE_VS_UUID_COUNT to 2 and increase RAM. But I have been playing around with these values without result for a day. Attached the entire code just in case.
Thanks in advance.
Related