<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Mcuboot swapping image slot is very slow after DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84900/mcuboot-swapping-image-slot-is-very-slow-after-dfu</link><description>I&amp;#39;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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Feb 2022 12:38:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84900/mcuboot-swapping-image-slot-is-very-slow-after-dfu" /><item><title>RE: Mcuboot swapping image slot is very slow after DFU</title><link>https://devzone.nordicsemi.com/thread/354342?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 12:38:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61420530-e012-4d24-afdc-219ab2b8d8c8</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I assume you&amp;#39;re using &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/17f6d045a10a8d2ba9f3dede820e9c6dd81a5c56/boot/zephyr/Kconfig#L206"&gt;CONFIG_BOOT_SWAP_USING_MOVE&lt;/a&gt;&amp;nbsp;(you can figure this out by checking the file &lt;em&gt;sample/build/mcuboot/zephyr/.config&lt;/em&gt;). That will use the approach described&amp;nbsp;under &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.0/mcuboot/design.html#swap-without-using-scratch"&gt;Swap without using scratch&lt;/a&gt;. 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&amp;#39;t think it&amp;#39;s possible to change this. So I&amp;#39;m not sure if it&amp;#39;s possible to improve this. If the community has any input on this, that would be welcomed.&lt;/p&gt;
&lt;p&gt;You could use the option &lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/17f6d045a10a8d2ba9f3dede820e9c6dd81a5c56/boot/zephyr/Kconfig#L199"&gt;CONFIG_BOOT_UPGRADE_ONLY&lt;/a&gt;, then you won&amp;#39;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.&lt;/p&gt;
&lt;p&gt;You might test out&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-mcuboot/blob/17f6d045a10a8d2ba9f3dede820e9c6dd81a5c56/boot/zephyr/Kconfig#L193"&gt;swap uisng scratch&lt;/a&gt;. That might decrease the swap time, but I can&amp;#39;t say for certain, since I haven&amp;#39;t tested it.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>