I've been following the instructions on how to test buttonless secure DFU without bonds using the Buttonless DFU Template Application page.
I followed the instructions at the bottom of the page, and loaded the two following precompiled hex files using JLinkExe's command "loadfile":
- examples\dfu\secure_dfu_test_images\ble\nrf52832
softdevice_bootloader_secure_ble_debug_without_bonds_s132.hex - examples\dfu\secure_dfu_test_images\ble\nrf52832
ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex
I then used nRF Connect and performed a DFU using the prepackaged test image:
- examples\dfu\secure_dfu_test_images\ble\nrf52832\softdevice_s132.zip
The DFU started, I could see the progress, and it completed without error.
I then followed the exact same steps, however this time tried to load an image I packaged myself. When I tried to start the DFU, it aborted with the message "Invalid Object."
In order to avoid complications, I packaged the blinky example and did so in the following way:
- Created a private key:
nrfutil keys generate blinky_key.pem
- Created public key and stored in file:
nrfutil keys display --key pk --format code blinky_key.pem --out_file dfu_public_key.c
- Copied "dfu_public_key.c" to \examples\dfu\dfu_req_handling, replacing the existing file.
- Prepared the firmware package:
nrfutil pkg generate --debug-mode --application nrf52832_xxaa.hex --key-file blinky_key.pem blinky_package.zip
What's causing the invalid package?
Any help on the matter would be greatly appreciated.