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

DFU succeeds but flash is erased

I'm setting up the DFU using the example project in SDK 12.3. The only changes are a custom entry using GPREGRET, and a custom exit of a button press. I have removed the button entry from the example, and my button for exit is on pin 14. The exit is only for the case where the bootloader is entered, but the user does not actually want to do the update.

I've tested the entry and exit multiple times.

I have generated my own keys. The firmware update is for the application only, using the keys.

I am able to find the device, enter the bootloader, start the dfu process and watch it finish successfully on my phone. nrfConnect reports that the application was transferred successfully.

In the bootloader with a debugger, I am able to confirm that the application gets to: nrf_bootloader_app_start(MAIN_APPLICATION_START_ADDR);

If I read back the flash: nrfjprog --family nrf52 --memrd 0x7f020 0x0007F020: 00000001 |....|

The application just never runs. What I then noticed is that if I read back the entire flash to a file, there is no application.

nrfjprog -f nrf52 --memrd 0x00 --n 0x80000 >> working.txt (done after a program by nrfGo Studio)

nrfjprog -f nrf52 --memrd 0x00 --n 0x80000 >> uploaded.txt (done after a 'successfull' dfu update from my phone.

If I look at the working file, as you would expect starting at 0x29000 I see flash contents matching the size of the application (~94k). If I look at the updated file, I see nothing but 0xFF from 0x29000 until the start of the bootloader (0x78000).

I am using SD332. I have all of the headers and defines changed over.

working.txt uploaded.txt dfu_update.zip Any thoughts as to why it would tell the phone it succeeded, but clearly have not written the flash?

Related