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

New application doesn't run after secure DFU process reaches 100%

Hi to everyone!

I'm following this guide to learn how to use secure DFU on a nRF52832DK board.

All steps have been done successfully, or I think so, until I reach the D4 step where the new program has to start automatically after DFU process, but it never runs.

Instead, the LED 3 lights up and If I press the button 4, the LED 1 also lights up and I can resend another application over DFU. So I think the board is still in the bootloader.

Indeed, I have some cuestions related to this:

  1. BLE Secure DFU example is only a boot loader or it also has an application?

  2. Depending on the above answer, if it is only a boot loader, do I have to program an application before doing the DFU proccess?

  3. The application, that will be written after DFU proccess, must use SoftDevice? (For my test, I upload my own blinky program. It works well when I flash the board directly through USB. But it doesn't use SoftDevice at all).

Thanks in advance!

Parents
  • I tried your way with the precompiled hex file, but that didn't work. The reason it doesn't work is because the precompiled hex file has the softdevice included, but in the secure DFU blog post you are looking at, you only want to update the application (not the softdevice too). Try building the blinky example using Keil instead (like it says in step C1). The hex file built by Keil in the _build folder does not include the softdevice. You can check this in nrfgostudio by uploading the precompiled hex file found in the hex folder as an application and seeing that there is a softdevice & application section in memory. If you program the hex file built by Keil, the softdevice will not be in memory.

    Like you said previously, you get errors if you try to create a zip file by using the precompiled blinky_pca10040.hex file. I am pretty sure you are doing everything else correctly. So essentially just follow the blog post and build your application using Keil & not using the precompiled hex files. Hope that helps!

Reply
  • I tried your way with the precompiled hex file, but that didn't work. The reason it doesn't work is because the precompiled hex file has the softdevice included, but in the secure DFU blog post you are looking at, you only want to update the application (not the softdevice too). Try building the blinky example using Keil instead (like it says in step C1). The hex file built by Keil in the _build folder does not include the softdevice. You can check this in nrfgostudio by uploading the precompiled hex file found in the hex folder as an application and seeing that there is a softdevice & application section in memory. If you program the hex file built by Keil, the softdevice will not be in memory.

    Like you said previously, you get errors if you try to create a zip file by using the precompiled blinky_pca10040.hex file. I am pretty sure you are doing everything else correctly. So essentially just follow the blog post and build your application using Keil & not using the precompiled hex files. Hope that helps!

Children
  • Ok, it worked!

    But it looks like only works with the hex file which has references to SoftDevice. I mean that only works the hex file obtained by compiling (in Keil) the next project: nRF5_SDK_14.0.0_3bcc1f7\examples\peripheral\blinky\pca10040\s132\arm4.

    Because the hex one which is in this project nRF5_SDK_14.0.0_3bcc1f7\examples\peripheral\blinky\pca10040\blank\arm4 doesn't work (I can't even create the zip with it).

    I think is because SoftDevice is programmed in the board memory. So, any program which doesn't use SoftDevice will not work (as if I upload a program without SoftDevice through USB to the board when the board has SoftDevice).

    In conclusion, I think I get the answer to my question #3. And the answer is yes, the hex file must use SoftDevice. Thats why my first hex didn't work either, because it didn't have SoftDevice.

    Thank you so much @Bjørn Kvaale!

  • No worries. :) Great to here that you figured it out! I also made the mistake of using the blank example first (without the SD). You are correct that you will need to use the blinky example that uses the softdevice, as you flash the softdevice to the DK first in step D1 of the Secure DFU blog post.

Related