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.
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?
Edvin said:So does the application still stop on 0x0A60?
Edvin said:Does it still stop on 0x0A60 after you place those breakpoints? If so, press "continue" (F5) and not "Step into". What happens then?
Yes. Break at 0x0A60 first. After pressing F5, break at 0x0A80. Then pressing F5 again, the system reboot.
Does that means the system cannot reboot to bootloader?
So it never hits any of the breakpoints in app_error_fault_handler() or HardFault_c_handler()?
Due to holiday season in Norway, we are really low on capacity. Is there any way for me to reproduce this issue? If so, can you give me a detailed description, and zip your project so I can easily reproduce it, preferably with an unmodified bootloader from the SDK and your project. Perhaps I can see where the hardfault handler is pointing to.
For your sake, I will be looking at the SP (stack pointer) and see what functions in the .map file it points to in 0xa60 and 0xa80, so if you want to give this a go, you can try this as well.
I have already attached my project in the 1st thread and you can find it there.
I just perform the DFU using the iOS nordic APP. After I press "start",the problem occurs.
Sorry, I didn't notice that it was attached.
So I tested your project (compiled with SES) in SDK15.3.0 with an unmodified bootloader, running on a DK. I was not able to reproduce the issue.
Can you try to unzip the project that you attached in the path "test\251837" (create this folder) in the examples folder in the SDK, and compile it.
Then generate your own private.key and dfu_pulbic_key.c in the default location, and run the following .bat script from SDK15.3.0\examples\dfu\secure_bootloader\pca10040_ble\armgcc:
copy ..\..\..\..\test\251837\pca10040\s132\ses\Output\Release\Exe\ble_app_hrs_freertos_pca10040_s132.hex files\freertos_app.hex
nrfutil settings generate --family NRF52 --application files\freertos_app.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 --key-file ..\..\..\..\dfu\private.key files\bl_settings.hex
nrfjprog --program ..\..\..\..\..\components\softdevice\s132\hex\s132_nrf52_6.1.1_softdevice.hex
nrfjprog --program _build\nrf52832_xxaa_s132.hex --verify
nrfjprog --program files\freertos_app.hex --verify
nrfjprog --program files\bl_settings.hex --verify
nrfutil pkg generate --application files\freertos_app.hex --application-version 2 --hw-version 52 --sd-req 0xB7 --key-file ..\..\..\private.key files\dfu_test.zip
Then try to perform the DFU with the file generated in:
Does that start advertising on a DK, or not? If you don't use a DK, can you try to run it on a Nordic DK?
I did exactly the same.
After I start the DFU on iOS, the EVB reboot. The APP is running but cannot update the FW.
Seems the EVB cannot reboot to bootloader!!!5315.armgcc.zip