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

Enabling Indications in Buttonless Secure DFU Service Without Bonds

Referring to the Nordic message sequence chart in the following link:

https://infocenter.nordicsemi.com/index.jsp

(Software Development Kit -> Previous Versions of nRF5 SDK -> Libraries -> BLE Services -> Buttonless Secure DFU Service-> Buttonless Secure DFU Service without bonds)

After writing a "1" into the characteristic UUID of the Buttonless Secure DFU Service Without Bonds,

We would like to know whether writing a "2" or a "1" would set indications to be enabled?

So in terms of using bluepy (running this with python on Raspberry Pi 3), it would be written either like this:

peripheral.writeCharacteristic(cccd_handle, b"\x02\x00", withResponse=True)

or 

peripheral.writeCharacteristic(cccd_handle, b"\x01\x00", withResponse=True)

Basically after writing a "1" to the characteristic UUID (of 0x8EC90003-F315-4F60-9FB8-838830DAEA50 for Buttonless DFU without bonds)  the documentation is quite vague on how to go about verifying whether writing the "1" was successfully able to place the target remote sensor into DFU mode.

Could you please clearly describe the necessary steps to put a target sensor into DFU mode ?

 

Parents Reply Children
  • Hi Edvin,

    How do you go about implementing this correct sequence to toggle the remote sensor to broadcasting DfuTarg like in using bluepy in python for example?

  • I am in no way an expert on python. Remember that we work mostly with C programming. Perhaps try something like this:

    https://github.com/IanHarvey/bluepy/pull/151

    I have never touched bluepy before, so I have no idea whether this is correct. But if you can use this to get services and characteristic, you should be able to follow the same logic using bluepy.

    Note that if you hover the mouse over the "Secure DFU" and "Buttonless Secure DFU without bonds" in nRF Connect, it will show you the UUID of the service/characteristic.

  • Hi Edvin,

    Do you have C code for NRF52 (nrf52840) to be the BLE host?  or a series of links that point to how to implement such functionality in C? (Because the end goal is to have the BLE dfu ota capability running in NRF52 which is able to dfu ota update an nrf52 based sensor.)

  • Hello,

    We don't have any DFU host over BLE code written in C. The closest would be the nrfutil repository (or to use nrfutil directly, if you are running it on an nRF52). 

    Other than that, if you want to do this in a custom project, you should know that the protocol is similar, whether it is serial or BLE. You can read about the protocol here.

    Note that when you write 0x01 to the buttonless dfu characteristic (if you use that), then the device will reboot. If you are not bonded, then the device will start advertising with BLE address = old address+0x01. 

    You will still use nrfutil to generate the dfu image, just as if you were to run the update from a computer / mobile phone.

    In case it is useful, we have a handful of experimental serial DFU hosts here and here.

    Best regards,

    Edvin

Related