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

Buttonless DFU with bond not working

Hi,

I'm struggling to get Buttonless DFU with bond enabled working.

Setup details:

1) SDK 14.2

2) DK board - nrf52832

3) nrfconnect app on Android phone (8.0) :

DFU settings = Pkts receipt notification procedure : ON

Number of packets : 10

MBR : 4096

Keep bond information: ON

External MCU DFU : OFF

4) Custom app with bond enabled, BLE_GAP_ADDR_TYPE_RANDOM_STATIC(C1:C1:C1:C1:C1:C1), MITM enabled,

Followed the steps to generate bootloader keys and everything seems to be fine. Flashed SD, BL, APP onto DK board and I can see the app running.

Connected nrfconnect to my custom app, paired succesfully. I can see secure DFU service with Secure buttonless DFU.

After enabling the indication, I write value "0x01" and send to switch to DFU mode. I see device moved to DFU mode but with BD addr = EA:F8:73:D2:B8:CC.

Connected nrfconnect to DfuTarg and if I try to DFU, I think device switches to my custom app and I don't see DFU happening any more.

I'm wondering what would be wrong and I believe encryption fails due to different BD address used in DFU and app mode. What am I missing?

Tried looking into Nordic blogs, dev support but could not move forward. Also, I tried to see the DFU NRF log but I don't see any log messages

All I see on power ON is

<info> µ˜°: Setting vector table to bootloader: 0x00066000
<info> µ˜°: Setting vector table to main app: 0x00023000
<info> µ˜°: Record ID:    0x0001
<info> µ˜°: File ID:    0xF020
<info> µ˜°: Record key:    0x7010

I did used \nRF5_SDK_14.2.0_17b948a\examples\dfu\bootloader_secure_ble\pca10040_debug\armgcc\Makefile with logger enabled and optimization is -O0 in makefile. I'm not sure DFU logger does not show up in RTT viewer.

Attached are the config,make files for reference.

Your help is highly appreciated.

dfu.rarapp.rar

Parents
  • Hello,

    Attached you will find a fresh copy of the SDK, where I only replaced the files you attached in my_dfu.rar and power_strip.rar.

    Your app is located in SDK\examples\Suresh\power_strip\power_strip

    the bootloader is located in SDK\examples\dfu\bootloader_secure_ble\pca10040\armgcc

     

    There (in the bootloader folder) you will also find a folder called "application". When you run SDK\examples\dfu\bootloader_secure_ble\pca10040\arngcc\flash_everything.bat it will run your prog_uicr.bat code, flash softdevice, bootloader, bootloader_settings, and application, then reset, and then create the dfu_packages inside the "application" folder. Try to connect to it with nRF Connect and then bond, and upload one of the dfu packs, Suresh_app2.zip or Suresh_app3.zip. They have application version 2 and 3, respectively (the application already running has application version 1, so the packets must start at 2).

     

    The only file I didn't replace in the SDK was the makefile.windows, because I had to use my own compiler. Just edit that file, and you should be able to compile your own version of the bootloader, with a new set of keys(as well of your own application). The keys, by the way, are also located in the bootloader folder (armgcc).

     

    Give it a go, and let me know if this one works for you.

     

    SDK14.2.0_Suresh.zip

     

    Best regards,

    Edvin

  • Hello,

    Tried with SDK you sent me and it works fine without any issues. Next step I started carefully comparing the files and configuration if something is different.

    Only difference I spotted is I was working with SDK\examples\dfu\bootloader_secure_ble\pca10040_debug\armgcc. So I switched my SDK\bootloader to use SDK\examples\dfu\bootloader_secure_ble\pca10040\armgcc and it worked as well ;).

    So what is causing in pca10040_debug\armgcc? I used this config to see nrf logger messages on Jlink RTT viewer, this be a reason? _debug bootloader does not match with non debug version of app?

    Will dig further and let you know.

    Appreciate your time and effort in resolving my issues.

    Thank you very much.

    regards

    Suresh

Reply
  • Hello,

    Tried with SDK you sent me and it works fine without any issues. Next step I started carefully comparing the files and configuration if something is different.

    Only difference I spotted is I was working with SDK\examples\dfu\bootloader_secure_ble\pca10040_debug\armgcc. So I switched my SDK\bootloader to use SDK\examples\dfu\bootloader_secure_ble\pca10040\armgcc and it worked as well ;).

    So what is causing in pca10040_debug\armgcc? I used this config to see nrf logger messages on Jlink RTT viewer, this be a reason? _debug bootloader does not match with non debug version of app?

    Will dig further and let you know.

    Appreciate your time and effort in resolving my issues.

    Thank you very much.

    regards

    Suresh

Children
  • I don't know exactly what the difference is. I added all the logging files to the bootloader project (not _debug, I realize I should have used the _debug project instead to save some time). But other than that, I am not sure what the difference between the two are, that would cause any issues.

     

    I think there is something with the debug bootloader which accepts packets that are not signed (or actually signed with a fixed key, for debugging purposes). But why it works without bonding, and not with bonding, I am not sure.

     

    Best regards,

    Edvin

  • >> I think there is something with the debug bootloader which accepts packets that are not signed (or actually signed with a fixed key, for debugging purposes). 

    Make sense

Related