MCUboot rollback happening after successful upgrade on nRF9160 (NCS 2.7.0)

I am debugging an issue where my nRF9160 (NCS 2.7.0) rolls back to the previous firmware after a seemingly successful upgrade. I am not getting enough logs from MCUboot to understand the rollback reason.

Symptoms:

  • Firmware upgrade completes successfully.

  • After reboot, MCUboot attempts to boot the new image but then rolls back.

  • Looks like a version-related validation failure, but I cannot confirm due to limited logs.

MCUboot configuration (summary):

CONFIG_FW_INFO=y
CONFIG_FW_INFO_FIRMWARE_VERSION=2
CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=n

CONFIG_MCUBOOT_SERIAL=y
CONFIG_BOOT_SERIAL_NO_APPLICATION=y
CONFIG_BOOT_SERIAL_BOOT_MODE=y
CONFIG_RETAINED_MEM=y
CONFIG_RETENTION=y
CONFIG_RETENTION_BOOT_MODE=y

CONFIG_BOOT_MAX_IMG_SECTORS=216
CONFIG_SIZE_OPTIMIZATIONS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FPROTECT=y

My questions:

  1. What are the typical reasons MCUboot rolls back even when signature verification succeeds?

  2. Is there any additional logging option for MCUboot in NCS 2.7.0 to see the exact failure reason?

  3. Is there any known issue around CONFIG_FW_INFO_FIRMWARE_VERSION or version comparison in NCS 2.7.0 for nRF9160?

  4. How can I reliably debug when the bootloader decides that the new image is invalid or should be reverted?

Any guidance or recommended configs to increase verbosity or isolate version-validation issues would be very helpful.

Parents
  • Hi Purushotham,
    Could you let me know what exactly FOTA way you are doing ? 
    Did you base your application on one of the sample ? Did you try to test with FOTA samples we have ? 

    Could you explain what exactly you meant by "Another thing that i noticed is if i cut a formal release with proper versions like v2.2.2 then it worked, if i just do an incremental build and upload that to my server and download/install then i see this behaviour of rolling back "

    Please tell how exactly you define the application version, did you use the VERSION file ? Or CONFIG_FW_INFO_FIRMWARE_VERSION , as far as I know CONFIG_FW_INFO_FIRMWARE_VERSION  may not related to MCUBoot but NSIB 

    When you call boot_write_img_confirmed () do you receive an error. Please try to capture a log when the image is rolled back. 

Reply
  • Hi Purushotham,
    Could you let me know what exactly FOTA way you are doing ? 
    Did you base your application on one of the sample ? Did you try to test with FOTA samples we have ? 

    Could you explain what exactly you meant by "Another thing that i noticed is if i cut a formal release with proper versions like v2.2.2 then it worked, if i just do an incremental build and upload that to my server and download/install then i see this behaviour of rolling back "

    Please tell how exactly you define the application version, did you use the VERSION file ? Or CONFIG_FW_INFO_FIRMWARE_VERSION , as far as I know CONFIG_FW_INFO_FIRMWARE_VERSION  may not related to MCUBoot but NSIB 

    When you call boot_write_img_confirmed () do you receive an error. Please try to capture a log when the image is rolled back. 

Children
No Data
Related