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

SDK12 DFU service not found

I am developing software for a custom hardware based on NRF52. Previously I was tasked on updating the old NRF51 based software (used on older version of the device) for NRF52 using SDK11. Once that was done my next task was updating the software for SDK12. The software is otherwise working fine but I am having problems with DFU. I tried creating a zip of the application and flashed the combined softdevice/bootloader from SDK12 examples folder (dfu/ble_dfu_send_hex) to the device. The device shows as DfuTest on the mobile DFU app but when I try to upload the zip all I get is "DFU service not found". I also tried compiling the secure DFU bootloader example and using that instead but the result is the same.

Do I need to also have DFU support in the application for that to work ? Currently the application has some kind of DFU functionality from the earlier SDK 11 implementation but I'm guessing that wont work. Any examples to study so that I can implement the functionality ?

  • If you want buttonless dfu update, you would need to implement the DFU service in your application (only the service not the whole DFU bootloader). You can have a look at our experimental example here also you can have a look at my answer here.

  • I think I am doing the initialisation wrong. Currently the application is only calling the function ble_dfu_init in ble_dfu.c (this is how it was done in the SDK 11 version) using following init settings:

    dfus_init.evt_handler = ble_dfu_event_handler; dfus_init.ctrl_point_security_req_write_perm = SEC_SIGNED; dfus_init.ctrl_point_security_req_cccd_write_perm = SEC_SIGNED;

    However, when I compared the implementation of this function under SDK 11 and SDK 12 I noticed that the SDK 11 version is doing a lot more initialisations than the SDK 12 version. OTOH the init function with the same name (but different params) in nrf_ble_dfu.c seems to do about the same as the other function. Perhaps I should be using that instead ?

  • The SDK v12 bootloader is quite different from the one on SDK v11, including the buttonless dfu service. If you are using SDK v12 bootloader, you should follow what we have in experimental_ble_app_buttonless_dfu.

    Note that there is no bonding information forwarding in the example and the bootloader yet. You would need to implement on your own.

  • Well, I used the experimental_ble_app_buttonless_dfu as a reference and did the DFU initialisation in my app exactly as the initialisation was done in the demo. When I use NRF Connect to connect to my device I see "Unknown service (UUID 8e400001-f315-4f60-9fb8-838830daea50)" in addition to the other services (battery, device information, nordic UART service). Also, if I build the demo and flash it to the device I get the very same unknown service. So it seems either the demo is broken or I'm missing something ?

  • 8e400001-f315-4f60-9fb8-838830daea50 is the UUID we generated for the experimental_ble_app_buttonless_dfu example. It's random generated and not official Bluetooth SIG UUID. So it's normal to see "Unknown service" for that service in the app. You are free to generate your own 128 bit service UUID for the purpose of switching from application to DFU. There is no specific requirement there. To switch from application to bootloader please follow the documentation about the example in the SDK.

Related