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

Flashing bootloader, softdevice and application issue

Hello.
I'm having an issue with nrfjprog that has been discussed in this forum several times but I can't manage to get it working. I'll link some of mentioned posts at the end of this post.

My goal: I'd like to have a powershell script in which I can flash the softdevice, the bootloader and the application. And the device runs the application and doesn't get stuck in the bootloader. I don't mind if to merge all the .hex files into one .hex file as long as it works.

My setup: I have a nrf52832 custom board without any buttons that I'd like to be able to update the application via dfu. I'm using sdk 17.0 (this is working, I followed Getting started with Nordic's Secure DFU bootloader, a step by step guide).
My application is based on the template example and my bootloader is the secure bootloader example.

Things I've tried (besides other devzone posts answers):
1. My first approach was to flash the softdevice, bootloader and application in this order. When I scan using nrfConnect I don't see my device name I just see DfuTarg. Which means the application is not running and it's stuck in the bootloader. Note: When I connect the device to nRFgo Studio I can see that the bootloader, softdevice and application are all flashed into the device but the application is not starting. If using nrfConnect I upload via dfu the same application it runs flawlessly.

2. The most common answer I've found in the forums is that I need to merge the bootloader .hex with a settings .hex. As far as I understood, the first thing I tried didn't work because the CRC checking and this settings .hex for the bootloader will make it work.

I've tried the following piece of code:



As far as I know, I need to be using --bl-settings-version 2 because my sdk version is 17.0. And --application-version and --bootloader-version are values for me to increase.

After running the script, verifying says it's ok. Powershell output:



At this point I use nrfConnect to check if the bootloader is working and I'm unable to find the device. nRFgo Studio says the bootloader is flashed.

How can I make this work and reach my goal?
Is there any extra configuration to the bootloader or application that must be done for this to work?
Thanks.

Some of the devzone posts I've researched and couldn't make it work:
https://devzone.nordicsemi.com/f/nordic-q-a/10135/how-to-program-softdevice-and-firmware-with-new-nrfjprog
https://devzone.nordicsemi.com/f/nordic-q-a/24801/combining-bootloader-softdevice-and-application-in-single-hex
https://devzone.nordicsemi.com/f/nordic-q-a/27006/how-to-flash-the-softdevice-the-bootloader-and-the-application-at-once
https://devzone.nordicsemi.com/f/nordic-q-a/19502/flashing-sd-app-bl-sdk12-2/75758#75758
https://devzone.nordicsemi.com/f/nordic-q-a/46033/nrf51822-prepare-hex-file-for-mass-production-softdevice-application-bootloader-and-start-it-into-the-application
https://devzone.nordicsemi.com/f/nordic-q-a/53693/how-to-flash-application-after-dfu-bootloader
https://devzone.nordicsemi.com/f/nordic-q-a/51265/sdk-15-3-flash-application-does-not-run-after-flash-softdevice-and-bootloader-as-advised-on-devzone-topics
https://devzone.nordicsemi.com/f/nordic-q-a/50482/unable-to-flash-after-adding-bootloader
https://devzone.nordicsemi.com/f/nordic-q-a/58894/unable-to-merge-bootloader-softdevice-and-application
https://devzone.nordicsemi.com/f/nordic-q-a/57523/flash-the-softdevice-the-bootloader-bootloader-settings-and-the-application-at-once