I am using SDK17, nRF52840 based custom board and SoftDevice 7.2.0 with SES.
I want to use SDK's secure bootloader (pca10056_s140_ble) with my own keys.
To enter to the bootloader I need to perform these functions and I have added them to my code.
err_code = sd_power_gpregret_clr(0, 0xffffffff); APP_ERROR_CHECK(err_code); err_code = sd_power_gpregret_set(0, 0xB1); APP_ERROR_CHECK(err_code); nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU);
On bootup, the device shows up as DfuTarg, I can connect to it, upload the ZIP and the device runs perfectly. But to perform another OTA, when I connect to my own service and perform the above-given code portion, the device hangs. It does not enter DFU(I verified it by toggling an LED at the start of the bootloader ).
What else do I need to change in my application? As far as I know, I can not debug my application as there is a bootloader.