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

Buttonless DFU with bonding

Good afternoon,

I first devoloped my app based on the nRF52840 (SDK 15.2; S140 V.6.1.0) and it was perfectly working with or without bonds.

After that, and following what it is shown in this link (https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/getting-started-with-nordics-secure-dfu-bootloader), I implemented Buttonless DFU funcntionality without bonds, and it was working fine. Now, I have tried to go ahead and doing the same DFU process with bonds, but application gets stuck when initializing DFU service: it gets stopped at 'ble_dfu_buttonless_init' function, when calling 'ble_dfu_buttonless_backend_init', and the result is 0x0008 (NRF_ERROR_INVALID_STATE). In order to test DFU with bonds, I have carried out the required modifications according to information specified in the link above:

Do you know which can be the reason of such error?

Best regards,

Dani.

Parents
  • Now, the application is working but when carrying out DFU process, it does not work --> when using 'nRF Connect' desktop application, I get the following message:

    Any suggestion?

    Best regards,

    Dani

  • I found I was getting this message because device was in debug mode. Now, it is not in debug mode but I'm getting a different message:

    Trying to guess which is the problem....

  • Hi Dani,

    I did not remember that issue, but yes, this could very well be the problem. You can check if the same thing happens in your case using a sniffer, or simply implement the fix as suggested by Vidar in that thread (which you should do anyway).

    With the that fixed I cannot think of any likely reasons for this issue, but if you are still stuck, there are a few things worth doing:

    • Could it be that the phone has cached the services form before you added service changed characteristic to both the bootloader and application (if ever)? If so, then you should remove the bonding information and toggle BLE off and on on the phone to clear it's cache. Then fully erase the nRF and program the bootloader and application again. In this case, the phone should be aware of the issue
    • If still not sure if the phone could have cached something from before service changed characteristic was added, you could change the MAC address of the nRF (remember to do so both in app and bootloader in that case), or simply test with a new phone.
    • If the above also doe snot work, then it would be useful with a sniffer trace to see what is actually happening on-air (is the service change indication sent, ...?)

    Einar

  • Hi Einar,

    Some new information for you:

    Before implementing fix suggested by Vidar, I have directly gone to first point you have suggested in last answer: now, nRFToolbox is crashing but I have succeeded with nRF Connect application. After DFU update, the situation was the same (only DFU services were observed) but after selecting and connecting again to the bonded device, all application services appear again after going to options and selecting 'Refresh Services'.

    Dani.

  • Hi Dani,

    Dani said:
    Before implementing fix suggested by Vidar, I have directly gone to first point you have suggested in last answer: now, nRFToolbox is crashing but I have succeeded with nRF Connect application. After DFU update, the situation was the same (only DFU services were observed) but after selecting and connecting again to the bonded device, all application services appear again after going to options and selecting 'Refresh Services'.

    That is good. It is expected that the phone can discover all the services when you tell it to do service discovery. The problem is that this should have been automatic when you issue a service changed. What happens if you do DFU again at this point, but not "manually" select refresh service when entering the application again. Do the application's services appear then, or is it back to the old behavior?

  • Hi Einar,

    Is the same: DFU works correctly but if I do not select a 'manual refresh', I'm back to same situation: only DFU services are shown.

    Dani

  • Hi Dani,

    That should not be the case when using service changed. Can you upload your complete bootloader project and application project here?

Reply Children
Related