invalidHeaderMagic when using IOS-nRF-Connect-Device-Manager

I am trying to update my firmware using IOS-nRF-Connect-Device-Manager and am getting an invalidHeaderMagic error when calling:

let package = try McuMgrPackage(from: savedUrl)


I am using version 1.7.3 (last version to still support Swift5) and read this issue and resolution stating:



So the 'invalid header magic' means the Data is not signed. So, you were maybe trying to DFU Data from a debug build, not Release. This is why it probably worked with your file instead of the Data bytes directly.

but I have this in the prj.conf:

# Enable MCUboot and FOTA
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
CONFIG_MCUBOOT_SIGNATURE_KEY_FILE="mcuboot/root-rsa-2048.pem"

and used the app_update.bin from the build/zephyr directory. I created a specific application just for the FOTA testing using the latest version of IOS-nRF-Connect-Device-Manager and it worked. I was also I was able to do it with my main app using the nRF Connect app on the iPhone with the package from the app_update.bin from the build/zephyr directory.

I see this ticket as well and it seems like it is due to a number not found in the file, but I don't know why it would not be there:



The error refers to the magic image number that is used in MCUboot (0x96f3b83d), and that is not found as expected in the image. Where does this .bin file come from? Are you sure it is a valid update image?

I did rename and then rename back after download to an iPhone using iOS FileManager, but also tested without renaming it and got the same error.

Related