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

Enterance/Exit times from DFU mode

Hi!
Some prerequisite info:

  • We are using nrf52840 boards as our peripherals
  • We are using v16.0.0 SDK
  • We are using the s113 SoftDevice, more specifically s113_nrf52_7.0.1_softdevice.
  • Since our central code is written in .NET Core, we use Windows.Devices.Bluetooth to take care of the PC side of the bluetooth.

Now onto my question:
Our peripherals are now Secure Buttonless DFU (without bonds) ready, and we can successfully do the DFU OTA process with .NET CORE code that I have written with the help of this link. The code follows the infographics in the link, and through events raised by listening to the notifications of the DFU control point, we successfully utilize the DFU protocol.

We want to have a sanity check on our central side in case some error occurs during DFU using a list of bootloaded items and the time added to the list.

We are having a hard time ascertaining a good timeout time, that is not too long (taking up DFU time for other devices) or too short (causing accidental parrallel DFUs, that we do not want at this point in time).

It would help us to know if given our hardware, are there rule-of-thumb timings for the following:

  • The time between a successful response for the indication of the DFU characteristic (opcode 1), to it's readvertisement as DFUTarg on the incremented address
  • The time between DFU end or timeout, and it's readvertising with the app code (the original address)

Thanks!

Roi

  • Hello Roi,

    This really depends on the applications.

     

    The time between a successful response for the indication of the DFU characteristic (opcode 1), to it's readvertisement as DFUTarg on the incremented address

     If your application does a graceful shutdown, this may take as long as the application waits before it reboots. 

    A Graceful shutdown may include:

    Finishing flash write operations if ongoing, disconnecting all connected devices - which would depend on the connection interval. Alternatively if your application has any other tasks it wants to perform before the shutdown. Please check how the buttonless dfu service handles the events.

     

    The time between DFU end or timeout, and it's readvertising with the app code (the original address)

     I don't have an exact number, but this would be very dependent on the size of the application. First, when the total application is finished, the bootloader will run through the entire image, and verify the CRC, and that it matches with the CRC from the init packet. 

    Then, depending on whether it is a single or dual bank, it needs to move the application to the correct place. 

    I think the easiest way to get a good number is to measure this for your application. 

    I didn't quite understand the need to know this very accurate. Is there a problem to start scanning for the device before it has started advertising?

    BR,

    Edvin

Related