nRF52840 UART bootload issue

Hi,

I developed a firmware without softdevice for a custom board with nRF52840

I recently decided to add a bootloader to my application and I based my bootloader code from the example : secure bootloader pca10056 uart

In the bootloader code I changed main to :

int main(void)
{
	gpio_setup();
	LED_GREEN();
	nrf_bootloader_init(dfu_observer);
}

As I intend to stay in bootloader using retention register, I set in sdk_config.h :

#ifndef NRF_BL_DFU_ENTER_METHOD_GPREGRET
#define NRF_BL_DFU_ENTER_METHOD_GPREGRET 1
#endif

Here are my steps regarding how I flash my device/prepare my files :

1 - From my app hex I generate a bootloadable app zip

nrfutil --verbose pkg generate --hw-version 52 --application-version 1 --application app.hex --key-file private.key --sd-req 0 app.zip

2 - I generate bootloader settings for my app

nrfutil --verbose settings generate --family NRF52840 --application app.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 btl_settings.hex

3 - I merge the bootloader hex and the bootloader settings to a bundle hex

mergehex --merge btl_settings.hex btl.hex --output bundle.hex

4 - I erase my whole chip to make sure to start clean

nrfjprog -f nrf52 --eraseall

5 - I flash the mbr hex I found in "nRF5_SDK_17.1.0_ddde560\examples\dfu\secure_dfu_test_images\uart\nrf52840\mbr.hex"

nrfjprog -f nrf52 --program mbr.hex --sectorerase --verify

6 - I flash the bundle generated in step 3

nrfjprog -f nrf52 --program bundle.hex --sectorerase --verify

7 - I flash the app

nrfjprog -f nrf52 --program app.hex --sectorerase --verify

8 - hard reset my device

Output :

I can clearly see that bootloader is exited shortly after power on with the green led but it doesn't look like my app is started after the bootloader exited

Why doesn't my app start and how can I fix this issue ?

I am working with :

- SDK 17.1.0

- Latest nrf command line tools

- Latest nrfutil

Parents Reply Children
No Data
Related