I added the feature of the 'buttonless dfu' to the 'hrs freertos' using the SDK v15.3.0.
After programmed the built image to the EV board PCA10040, it could run normally.
However, when I started the DFU process using 'nRF Connect' APP, the EV board reset itself.
The attached zip file is my changes made.
Have you attempted to get the context of the reset? the reset can only happen to a call to NVIC_SystemReset and you can check in your code where you have these and put a breakpoint there. Run your code in debug mode and to get some context on why this reset happens. If you can get the context of the reset, I would try to assist you further.
I have setup all breakpoints where NVIC_SystemReset is calling.
However, this problem occurred without triggering any breakpoint.
Please find the attached screen capture.
0XA60 is the Hardfault handler in the MBR. Please do the following
After I setup the breakpoints on app_error_fault_handler() and HardFault_c_handler(), the FW could not be triggered by those breakpoints.
Then, I checked the .map file and then setup a breakpoint on ble_evt_handler(). The FW stopped when I started the DFU process on the mobile phone.
Please find the captured screens.
Then, press 'Step Into'
Terry said:After I setup the breakpoints on app_error_fault_handler() and HardFault_c_handler(), the FW could not be triggered by those breakpoints.
So does the application still stop on 0x0A60?
The ble_evt_handler() is likely to be called when you start performing a DFU process. It doesn't mean that the issue is related to the first ble event.
Does it still stop on 0x0A60 after you place those breakpoints? If so, press "continue" (F5) and not "Step into". What happens then?