Hello,
I am attempting to use the DFU Target library to receive an update file over a custom protocol. I aim to do an MCUboot-style upgrade such that after the file upload, I can call dfu_target_schedule_update() and MCUboot will recognize the new image upon reboot.
So far, I am able to upload the app_update.bin file and write it to the secondary partition (external flash in my case) using the DFU Target libraries. I finish the upload by calling dfu_target_done(1); followed by dfu_target_schedule_update(0); where 0 is to signify the application core image. Upon reboot, I get the following message:
I: Starting bootloader I: Image index: 0, Swap type: test E: Image in the secondary slot is not valid! I: Image index: 1, Swap type: none I: Bootloader chainload address offset: 0x18000 I: Jumping to the first image slot
It seems that MCUboot recognized my new image, but after debugging, the calculated hash does not match the hash that MCUboot wants.
Is app_update.bin the appropriate image to write into the secondary partition with the DFU Target library? If not, what is the appropriate image? Also, does the DFU Target library take care of writing the image trailer into the secondary partition as well?
I will note that I am using a pm_static.yml file, and that is getting recognized correctly by the build system.
Thank you, and I appreciate your help.