Hello,
In my application (SDK, 16.0.0, nRF 52840) I need to enable the DFU service after initialization, which I do by exposing a custom service "DFU enable". This in turn allows to read/write a uint8_t property which I check in the code, inside the DFU enable callback function (executed on BLE_GATTS_EVT_WRITE). If this uint8 is equal to a hardcoded value I execute:
ble_dfu_buttonless_init_t dfus_init = {.evt_handler = ble_dfu_buttonless_evt_handler};
......
if(app_state.enable_key==0xCA) {
nrf_gpio_pin_write(LED_2,1);
ble_dfu_buttonless_init(&dfus_init);
}
The fact that LED_2 switches on only when I write 0xCA in the custom property assures that the logic is correct and, after all, once I write 0xCA and refresh the connection the DFU icon nicely pops out on the Nordic NRFConnect app (both on my smartphone and on desktop, using a Nrf52840SDK board). However, if I select the (correctly signed) .zip and try to update the device I get the following message:
DFU failed with error: Unable to find characteristic 8EC90001F3154F609FB8838830DAEA50 for service FE59 on device DA:A9:8D:E5:90:9E.0.
I should mention that when the DFU service is started at inizialization (with exactly the same command) the service is up and running and I can complete the DFU successfully with the same zip file.
Is there smtg that I should do in addition to enabling the DFU to correctly expose the new service? From the error message It seems like the required DFU characteristics cannot be found.
Thanks!
Stefano