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

Secure serial DFU example question

I am running the example:

C:\Nordic\nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_bootloader\pca10040_uart_debug\arm5_no_packs

Everything seems to be working well except for one step, please see step 8 below:

Using PCA10040 board:

Step 1
Compile bootloader

Step 2
Create bootloader settings

Step 3
Merge bootloader with bootloader settings

Step 4
Load Softdevice and bootloader with bootloader settings (using nRF Connect Programmer)

Step 5
Do a serial DFU with HRS example
Confirm that it works by connecting to smartphone app <- OK

Step 6
Do a serial DFU with Blinky example
Confirm that it works by observing the LEDs <- OK

Step 8
Repeat a serial DFU with HRS example <- Not OK XXXXXXXX

Step 7
Repeat a serial DFU with Blinky example <- OK

My question is, why I can do DFU of the HRS example the first time (Step 5) but not for a second time (Step 8)?

Is this expected behavior or please tell me what I am missing. Thank you.

Parents
  • Hi,

    I see from step 4 that you have programmed the SoftDevice. However this is not used by the serial bootloader so that in itself does not show that it is correctly programmed (other than the MBR, which is the first page in the SoftDevice hex and is needed by the bootloader). Can you double check that the correct SoftDevice is programmed?

    On the same note, the Blinky example has no dependency on the SoftDevice. The HRS example on the other hand, has. Can you double check that you have build the HRS example for the exact same SoftDevice version? And can you check that it work with that SoftDevice if you program only the SoftDevice and HRS app, but not bootloader via nRF Connect Programmer?

    Lastly, can you explain in what way it fails (when you write" Not OK XXXXXXXX")? Any logs or error messages?

    Einar

  • Hi Einar,

    I figured this out. 

    The DFU of the Blinky example was in the middle of the Softdevice area. As you noted, the Blinky example does not need the Softdevice. However, I recompiled the Blinky example to start at flash address 0x26000 and I added the Softdevice ID (0x101) to the DFU package for the Blinky.

    And now I can go back and forth between the DFU of the Blinky example and the DFU of the HRS example. 

    In summary the bootloader is working fine. But I had to properly build and compile the examples keeping an eye on their flash locations and assuming there is a Softdevice installed.

    Perhaps a warning for future DFU users is to be cautious of using the examples provided in \nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_dfu_test_images\uart\nrf52832, e.g., blinky_mbr.zip and hrs_application_s132.zip since they are incompatible. I guess you can tell right away from their names "_mbr" and "_s132" that they make different assumptions. I learned the hard way :) 

    Thank you.

Reply
  • Hi Einar,

    I figured this out. 

    The DFU of the Blinky example was in the middle of the Softdevice area. As you noted, the Blinky example does not need the Softdevice. However, I recompiled the Blinky example to start at flash address 0x26000 and I added the Softdevice ID (0x101) to the DFU package for the Blinky.

    And now I can go back and forth between the DFU of the Blinky example and the DFU of the HRS example. 

    In summary the bootloader is working fine. But I had to properly build and compile the examples keeping an eye on their flash locations and assuming there is a Softdevice installed.

    Perhaps a warning for future DFU users is to be cautious of using the examples provided in \nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_dfu_test_images\uart\nrf52832, e.g., blinky_mbr.zip and hrs_application_s132.zip since they are incompatible. I guess you can tell right away from their names "_mbr" and "_s132" that they make different assumptions. I learned the hard way :) 

    Thank you.

Children
No Data
Related