I am trying to update firmware that uses v14 of the nRF5 SDK to firmware that uses v15.3, but I am getting the error "Init command larger than expected.".
I'm wondering if this is supposed to be possible, or if v15.3 is not backwards compatible (I didn't see anything in the documentation saying it's not compatible).
It looks like the size of the init command buffer was increased in this version.
#define INIT_COMMAND_MAX_SIZE 512 /**< Maximum size of the init command stored in dfu_settings. */
#define INIT_COMMAND_MAX_SIZE_v1 256 /**< Maximum size of the init command in settings version 1. */
Yes, you should be able to update from v14 to v15.3 using DFU.
I am getting the error "Init command larger than expected.
What command are you using when generating the DFU package?Kind regards,Øyvind
Here is what we are using:
nrfutil settings generate
nrfutil pkg generate
I noticed that we never merge the $BOOT_SETTINGS_HEX_FILE and the $BOOT_HEX_FILE, and I'm thinking that this merged file is what actually should be passed to the "nrfutil settings generate --bootloader" option? Otherwise the default settings are used and the DFU firmware doesn't know it needs to upgrade the settings page.
I'll try this while waiting for an answer.
I've been trying to update using the iOS DFU library (4.4.2) which is when I get the error mentioned above.
When I try to update using the Android nRF Connect app I get a totally different error ('dfq_req_handling: Prevalidate failed!'), but it makes it a farther along in the process.
I'll have to keep looking into this, but I think since the two DFU libraries act differently, it might be something wrong with the firmware or one of the libraries, and probably not something wrong with the DFU ZIP I'm generating.
Hi Josh, I have not been able to reproduce your issue yet but it is work in progress. Discussing the issue with my team as well and we think there might be an issue with the:
--sd-boot-validation VALIDATE_ECDSA_P256_SHA256 --app-boot-validation VALIDATE_ECDSA_P256_SHA256
But will verify. In the mean time, please have look at the DFU tutorial (if you have not looked at this) it mentions: "For bootloader and softdevice update, please see the Appendix."
Hello again, I've managed to reproduce the issue, and the issue seems to be
which was not supported in SDK14.2, but is new in SDK15.3. The following call worked for me:
nrfutil pkg generate --application ble_app_hrs_pca10040_s132.hex --application-version 1 --softdevice s132_nrf52_6.1.1_softdevice.hex --bootloader secure_bootloader_ble_s132_pca10040.hex --bootloader-version 3 --hw-version 52 --sd-req 0x98,0x99,0x9E,0x9D,0xB7 --sd-id 0xB7 --app-boot-validation VALIDATE_ECDSA_P256_SHA256 --sd-boot-validation VALIDATE_ECDSA_P256_SHA256 --key-file private.pem hrs_dfu.zip
This updated the bootloader and softdevice to newest and installed the correct app. Please try to remove sd-boot-validation and let me know how that works for you.
Kind regards, Øyvind