Module: | ilumi H52 BLE module (nRF52832) |
SDK: | nRF5_SDK_15.3.0_59ac345 |
Softdevice: | 132_nrf52_6.1.1_softdevice.hex |
Compiler: | gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (15:7-2018-q2-4) |
I could get working DFU successfully using secure bootloader example and a combined upload package (bootloader + softdevice + application). DFU is initiated by setting GPREGRET Bit 0 to 1. After performing the DFU the new firmware works without any problems.
I'm using nRF Toolbox DFU to manage the DFU. After finishing the DFU process the message "Application has been transferred successfully" appears and the device restarts in DFU mode again.
I need to hard reset the device to get the application running. But would like to start the application automatically after DFU.
I've tried to clear GPREGRET in dfu_observer function, case NRF_DFU_EVT_DFU_COMPLETED. But it seems that NRF_DFU_EVT_DFU_COMPLETED is never executed.
case NRF_DFU_EVT_DFU_COMPLETED: { ret_val = sd_power_gpregret_clr(0, 0xFFFFFFFF); APP_ERROR_CHECK(ret_val); ret_val = sd_power_gpregret_clr(1, 0xFFFFFFFF); APP_ERROR_CHECK(ret_val); NRF_LOG_INFO("-------> NRF_DFU_EVT_DFU_COMPLETED"); LED_ON(LED_GREEN_PIN); nrf_delay_ms(2000); break; }
FYI: flto option is not activated in Makefile
What could I check to figure out why reset doen't work properly and why NRF_DFU_EVT_DFU_COMPLETED is never executed?