MCUBoot reverting slots immediately after image swap

Hi,

OS: sdk-nRF 2.3.0

OTA slots: primary slot 0 on the uC; secondary slot 1 on external flash

Chip: nrf52840

Build OS: MacOs

Problem

We are using LwM2M to perform DFU which has been working fine until recently when we tweaked the partition locations. Aka we moved the settings partition to the end of flash (primary) and made it larger in size.

The firmware runs fine when flashing the "merged.hex" file.

When we perform a DFU the download to slot 1 goes fine. When executing the update MCUBoot swaps the content of slot 0 for 1 as expected. However as soon as this finishes it then reverts the slots back, see image below.

I'm lost as to why MCUBoot would revert the slots before the app as even attempted to load.

Debugging

In the past MCUBoot would load as such, with no secondary reboot/reverting.

I've also noticed when doing a "sys_boot()" the uC will actually reboot twice; which does not seem right.

However when boot the device up from cold / real world power cycle, it only reboots once:

The paritition.yml file can be seen here encase it helps: https://gist.github.com/motters/072ffe54c56c074a3fd96e907b973999

Let me know if i can provide anything else that will help.

Any help greatly appreciated.

Thanks,

Sam

  • After a 2 days of messing around with dfu issues i may have fixed it. I have no idea why but the following seem to be required:

    In mcuboot prj.conf

    • Removal of CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
    • Add in CONFIG_BOOT_WATCHDOG_FEED=y

    In app prj.cong

    • Add CONFIG_ROM_START_OFFSET=0x200
    • Removal of CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y

    Not sure which 1,2 or 3 fixes it. But want to update the thread.

    On sys_reboot is now only does it once

    Any executing the update only swaps slot data once

  • Hello,

    motters said:
    After a 2 days of messing around with dfu issues i may have fixed it. I have no idea why but the following seem to be required:

    I have been assigned to this case and saw this response. Is your issue resolved? Do I need to look into this? Please let me know about this.

    Kind Regards,

    Abhijith

Related