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

secure dfu over UART - device programmed but application doesn't run

I am trying to upload firmware using the secure bootloader over UART onto nRF52840-DK. I managed to upload the precompiled blinky dfu test image using the uart debug bootloader. Now I wanted to upload my own program and failed. The dfu says "Device programmed." but the firmware doesn't get started. Even the blinky example doesn't run. This are the steps I am performing:
generating keys
cd $PROJ_DIR
nrfutil keys generate private.key
nrfutil keys display --key pk --format code private.key --out_file dfu_public_key.c
cp dfu_public_key.c ~/nordic/nRF5_SDK_16.0.0/examples/dfu/dfu_public_key.c

building secure bootloader
cd ~/nordic/nRF5_SDK_16.0.0/examples/dfu/secure_bootloader/pca10056_uart/armgcc
make
cp _build/nrf52840_xxaa_mbr.hex $PROJ_DIR/bootloader.hex
building firmware
cd ~/nordic/nRF5_SDK_16.0.0/examples/peripheral/blinky/pca10056/blank/armgcc
make
cp _build/nrf52840_xxaa.bin $PROJ_DIR/blinky.bin
flashing the bootloader
cd $PROJ_DIR
nrfjprog -f nrf52 --eraseall
nrfjprog -f nrf52 --program bootloader.hex --sectorerase
nrfjprog -f nrf52 --program ~/nordic/nRF5_SDK_16.0.0/components/softdevice/mbr/hex/mbr_nrf52_2.4.1_mbr.hex --sectorerase
nrfjprog -f nrf52 --reset

generating and uploading dfu package
nrfutil pkg generate --hw-version 52 --application-version 1 --application blinky.bin --key-file private.key blinky_dfu_package.zip --sd-req 0
nrfutil dfu serial -pkg blinky_dfu_package.zip -p /dev/ttyACM0

there are no errors, just a warning: "A UICR write operation has been requested but UICR has not been erased. Please verify that the result is correct." while flashing the bootloader.

when I upload the blinky example it works as expected
nrfjprog -f nrf52 --program blinky.hex --sectorerase
nrfjprog -f nrf52 --reset
What am I missing?
Related