We are upgrading our product from SDK15 to SDK16 using DFU over USB. When we perform a DFU update (BL, SD, and App) form SDK15 to SDK16, it works fine. Then if we perform a DFU update back to SDK15 it works fine (BL, SD, App). Then if we try to go back to SDK16, it is stuck in DFU mode and we have to perform a second update to get to SDK16.
While this may not seem like a useful scenario, it really is since if bugs our found in later firmware and end users want to revert to previous versions. They will be locked at older versions at that point (unless we force updates to happen twice, but we would like to understand the root of the problem).
We have modified the bootloader code to allow downgrade of BL, SD, and Apps. We can also update from an SDK15 to SDK15 release fine and from an SDK16 to SDK16 just fine. And SDK15 to SDK16 works fine the first time. But any other time after that, going from SDK15 to SDK16 fails.
I have dumped the flash after both the first (success) and second (failed) attempts, and they show a 6 byte difference only past the bootloader addresses (0xFE25C and 0XFF25C, bootloader settings?).
Here is the command we are using to generate the update packages:
SDK15
C:\Python27\Scripts\nrfutil pkg generate --hw-version 52 --application-version 1 --application-version-string 1.4.5 --application ..\Output\Release\Exe\FW_App.hex --bootloader-version 7 --bootloader ..\Output\Release\Exe\FW_Boot.hex --sd-req 0x00 --sd-id 0xA9 --softdevice ..\nordicsdk-15.0\components\softdevice\s140\hex\s140_nrf52_6.0.0_softdevice.hex --key-file ..\priv.pem ..\Output\packages\FW\bt_sd_app_dfu_package.zip
SDK16
nrfutil pkg generate --hw-version 52 --application-version 1 --application-version-string 2.4.248 --application ..\Output\Release\Exe\FW_App.hex --bootloader-version 9 --bootloader ..\Output\Release\Exe\FW_Boot.hex --sd-req 0x00 --sd-id 0xCA --softdevice ..\nordicsdk-16.0\components\softdevice\s140\hex\s140_nrf52_7.0.1_softdevice.hex --key-file ..\priv.pem ..\Output\packages\FW\bt_sd_app_dfu_package.zip
I have tried using bootloader with settings instead of just a standalone bootloader, but nrfutil errors out when I include the settings.