Mcuboot swapping image slot is very slow after DFU

I'm working on NCS 1.8.0.

I can use DFU APIs to upgrade my firmware successfully, however, after DFU is finished and system reboot, the McuBoot to swap images is too slow to my project.

the size of my app_update.bin is about 230 kB, it takes about 23 seconds to swap. is it possible to accelerate this process?  

following are logs:

I: MCUBoot image upgrade scheduled. Reset device to apply

////////////REBOOT

*** Booting Zephyr OS build v2.7.0-ncs1 ***

I: Starting bootloader

I: Primary image: magic=good, swap_type=0x4, copy_done=0x1, image_ok=0x1

I: Secondary image: magic=good, swap_type=0x2, copy_done=0x3, image_ok=0x3

I: Boot source: none

I: Swap type: test

//////////// waiting for 23 seconds here...

I: Bootloader chainload address offset: 0xc000

I: Jumping to the first image slot

Parents
  • I assume you're using CONFIG_BOOT_SWAP_USING_MOVE (you can figure this out by checking the file sample/build/mcuboot/zephyr/.config). That will use the approach described under Swap without using scratch. It will move the whole primary image up by one sector and swap the whole image with the secondary image one sector at the time. For the nRF52840 for example, the sector size is 4096 and I don't think it's possible to change this. So I'm not sure if it's possible to improve this. If the community has any input on this, that would be welcomed.

    You could use the option CONFIG_BOOT_UPGRADE_ONLY, then you won't swap the images at all and instead simply overwrite it, and it will be much quicker. This method will not have any fallback mechanisms, so it might be smart to enable serial recovery for the mcuboot, so you can update the chip from mcuboot, in case the application is faulty.

    You might test out swap uisng scratch. That might decrease the swap time, but I can't say for certain, since I haven't tested it.

    Best regards,

    Simon

Reply
  • I assume you're using CONFIG_BOOT_SWAP_USING_MOVE (you can figure this out by checking the file sample/build/mcuboot/zephyr/.config). That will use the approach described under Swap without using scratch. It will move the whole primary image up by one sector and swap the whole image with the secondary image one sector at the time. For the nRF52840 for example, the sector size is 4096 and I don't think it's possible to change this. So I'm not sure if it's possible to improve this. If the community has any input on this, that would be welcomed.

    You could use the option CONFIG_BOOT_UPGRADE_ONLY, then you won't swap the images at all and instead simply overwrite it, and it will be much quicker. This method will not have any fallback mechanisms, so it might be smart to enable serial recovery for the mcuboot, so you can update the chip from mcuboot, in case the application is faulty.

    You might test out swap uisng scratch. That might decrease the swap time, but I can't say for certain, since I haven't tested it.

    Best regards,

    Simon

Children
No Data
Related