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 ?

  • Ok, I tried with the buttonless DFU demo (2.0.0 version) by generating a zip package from it (exactly with same settings and signature file as with the application). First I erased the flash and flashed softdevice and bootloader to it. The device was shown as normal (DfuTarg or DfuTest, can't remember which) and uploading the package worked without problems. After the upload the device was shown as Nordic_Template so I selected it and tried to upload the demo packet again. Guess what message I received ? Yep, "DFU service not found". So the demo appears to be broken, after all ?

  • @jpolvi: Please follow step 6 and 7 in this guide. You need to write to the charactersitic under 8e400001-f315-4f60-9fb8-838830daea50. You can use nRF Connect for this. Sorry that the app is not up to date for SDK v12.1 experimental example.

    But the principle is very simple, you add a service and characteristic so that when you write 0x01 to it, it switches to bootloader.

  • So, if I got this right: I connect to the device using NRF connect, enable services from the menu and select the unknown service having the UUID shown above, then write 0x01 to the characteristic and it should then go into bootloader ? I first had trouble finding the characteristic (had to disable "parse known characteristics" for it to appear) but writing 0x01 to it doesn't seem to work (will type setting of byte array be ok ?).

    I noticed that ble_dfu.c in my copy of SDK doesn't seem to have the line char_md.char_props.write = 1; but it does have char_md.char_props.notify = 1; and the characteristic only seems to have the notify property. Perhaps I need to add the write property and recompile for it to work ?

    Sorry this is taking so long, but I'm kinda new to Bluetooth development. But I'm learning...

  • Hi jpolvi, Sorry that it takes so long. Yes it's a known bug, as described at #3 in Newly found issues here.

    You need to add write property for the characteristic.

  • Ok, I added a write property and did a rebuild. Still problems. For some reason writing 1 to the characteristic while the application is running causes it to lock up. The last log messages I'm getting are:

    :INFO:Erasing old settings at: 0x0007a000 :INFO:Erasing: 0x0007a000, num: 1 :INFO:Writing 0x00000057 words :INFO:Writing settings... Debug: BLE: default - error? :INFO:Obtained settings, enter dfu is 1 Debug: BLE: disconnected! Debug: Starting advertising...

    After that - nothing. Lines starting with Debug are BLE event handler messages using my customised logging routine. For some reason I could not get the logging macros to work so I did a custom implementation.

Related