I am currently working on the secure_bootloader example (pca10056_s140_ble) for the nRF52840 DK board and am encountering an issue with updating the OTA application. I have followed the standard steps for generating the required keys, merging the softdevice and bootloader, and attempting to update the application over-the-air (OTA), but it seems that the application is not updating as expected.
Here are the steps I have taken:
1.Private Key Generation:
I successfully generated a private key using the following command:
.\nrfutil.exe keys generate private.key
2.Public Key Generation:
After generating the private key, I generated the corresponding public key:
.\nrfutil.exe keys display --key pk --format code .\private.key --out_file public_key.c
I then replaced the old public key content in the bootloader source code with the newly generated one and recompiled the bootloader.
3.Merging Bootloader and SoftDevice:
I merged the bootloader and SoftDevice hex files:
mergehex -m bootloader.hex softdevice.hex -o bl_sd.hex
I then uploaded this bl_sd.hex file to the device.
4.Package the Application:
I created the application DFU package with the following command:
.\nrfutil.exe pkg generate --hw-version 52 --application-version 1 --application .\nrf52840_xxaa.hex --sd-req 0x0100 --key-file .\private.key app_dfu_package_code.zip
5.OTA Update:
After loading the bootloader and SoftDevice onto the device, I attempted to update the application using the DFU Target (DFUtrg) on my mobile app. However, the application is not updating as expected, and the process seems to stall or fail or sometime upto 17% process and GATT ERROR.
I have checked the connections and the commands several times, but the issue persists. Could you kindly assist me in troubleshooting this problem or provide guidance on what might be missing from the process?
I would greatly appreciate any help or suggestions you can provide to resolve this issue.
Thank you for your time and support.