In an attempt to do in app DFU I have taken the following resources for inspiration:
nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_bootloader\pca10056_uart_debug
and the DFU_MASTER_UART.ZIP from this link
Essentially I push the init packet and the application (compiled in as arrays) into the DFU also running in app space. I am hoping that after I transfer both init and app, the DFU code will restart into bootloader, switch and run my new app.
I am trying to send an init packet and an application image to a DFU process I have elevated into application space.
SDK is nrf SDK5 17.02.
Board is 52840DK.
I am seeing a Signature failed (err_code: 0x8542) upon sending the init packet and then sending the execute DFU transport request.
I have tried generating the dfu_zip, wherein I take out the .dat and the .bin, with a couple versions of nrfutil 5.20, 4.00 and 6.10 as some posts on the devzone seems to suggest nrfutil version errors.
The command I am using go generate the dfu zip is as follows.
./nrfutil pkg generate --hw-version 51 --application-version 4 --application nrf52840_xxaa_white.hex --sd-req 0x0100 --key-file ../../../../../../keys/private.key "test_dfu.zip"
I have verified that generating a public key with nrfuti on the private key is repeatable. I have verified that I am compiling the PK variable which matches the private key used to generate the DFU files.
What would you suggest I try next to get this sorted?
All the information from the init file seems to be arriving in the DFU request handler, as I can debug and largely see the contents of the init file in debug structures as they are displayed by nrfutil pkg display test_dfu.zip.
I am seeing the failure in these functions:
nrf_crypto_ecdsa_verify() come back in error with 8542. nrf_dfu_validation_signature_check() nrf_dfu_validation_prevalidate()