Hello,
I'm working on a bootloader based on the example of SDK13.1. I want to add two more characteristics to the DFU service, but after I add them, the nRF Connect app is not able to perform a DFU. The app says writing to characteristic failed.
I did some debugging and I think this a fault of the app and not my fault.
These are the characteristic handles before and after I add the new characteristics:
Before | After --------------------------------- Ctrl Pt Handles | Ctrl Pt Handles - CCCD: 0x0011 | - CCCD: 0x0011 - Value: 0x0010 | - Value: 0x0010 Packet Handles | Packet Handles - CCCD: 0x0000 | - CCCD: 0x0000 - Value: 0x0013 | - Value: 0x0013 STM Handles | STM Handles - CCCD: 0x0000 | - CCCD: 0x0016 - Value: 0x0000 | - Value: 0x0015 Boot Handles | Boot Handles - CCCD: 0x0000 | - CCCD: 0x0019 - Value: 0x0000 | - Value: 0x0018
These are the BLE events I usually get when performing a DFU before and after adding the new characteristics:
Before | After ------------------------------------------- BLE event 16 | BLE event 16 BLE event 33 | BLE event 33 BLE event 34 | BLE event 34 BLE event 85 | BLE event 85 BLE event 80 | BLE event 80 Write handle: 0x000D | Write handle: 0x000D BLE event 80 | BLE event 80 Write handle: 0x0011 | Write handle: 0x0016 BLE event 80 | BLE event 17
As you can see, for some reason after adding the new characteristics, the app tries to write to a characteristic that is not supposed to write to.
Since at this moment we still don't have the DFU implemented on our own app, we are still depending on nRF Connect for development. I really need to add those two characteristics, and I wouldn't like to include them as part of a different service (and after seeing this weird behavior I'm not even sure if the app is going to behave worse by adding a second service).
There's of course the possibility that I'm doing something wrong on my side, but as far as I can tell, this behavior is not because of me. Any suggestions on how to go about this are appreciated.
UPDATE: I checked debugging with nRF Connect for Android to see if there was any difference and a possible bug on just the iOS app. It turns out it also didn't work, but I noticed that the Android app recognized my two new characteristics as some proprietary characteristics from Nordic, Buttonless and Buttonless secure.
As far as I can see in the documentation, there are only two UUIDs reserved for this service: 0x0001 for the DFU control point and 0x0002 for the DFU packet. Naturally, I used 0x0003 and 0x0004 for my characteristics. These are not documented to be currently used by Nordic anywhere. I changed the UUIDs of my characteristics to 0xF001 and 0xF002 (random numbers) and everything worked again. What are those UUIDs used for? Thanks for your help!