<?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 crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery</link><description>Hello, I am encountering a crash in MCUBoot when using the following configuration: 
 
 MCUBoot as bootloader (SB_CONFIG_BOOTLOADER_MCUBOOT) 
 TFM configuration (build /ns board) 
 Multi-image update (SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES=2) 
 Swap mode</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Feb 2026 13:17:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery" /><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/561239?ContentTypeID=1</link><pubDate>Mon, 16 Feb 2026 13:17:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:397060d4-b01b-4b01-a1ff-f73177259be7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I haven&amp;#39;t tried to reproduce this yet. Are you currently on SDK v3.1 or v3.2?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/560926?ContentTypeID=1</link><pubDate>Wed, 11 Feb 2026 14:24:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e040c725-c86f-4922-9356-1df961de1310</guid><dc:creator>Remi Moessner</dc:creator><description>&lt;p&gt;Hi Vidar,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I missed your question : yes the hang was still present and easy to reproduct :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;MCUBOOT configured with&amp;nbsp;CONFIG_BOOT_SERIAL_CDC_ACM &amp;amp;&amp;nbsp;CONFIG_BOOT_SERIAL_WAIT_FOR_DFU&lt;/p&gt;
&lt;p&gt;Have you been able to reproduce on your side ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/556454?ContentTypeID=1</link><pubDate>Mon, 08 Dec 2025 12:49:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8dc8d4b-1fc8-4ea2-b07d-e4586a271af5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Rémi&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Please consider raising these issues in the mcuboot project (&lt;a href="https://github.com/mcu-tools/mcuboot"&gt;https://github.com/mcu-tools/mcuboot&lt;/a&gt;) so they can be reviewed&amp;nbsp;&amp;nbsp;by the maintainers. Are you still experiencing that the bootloader hangs on startup when you have the USB connected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/556174?ContentTypeID=1</link><pubDate>Wed, 03 Dec 2025 17:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d52250dc-ca0d-4eb7-8909-bc48e6b27b88</guid><dc:creator>Remi Moessner</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry, I didn&amp;#39;t see your questions&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery/555689"]Is the problem that auterm is trying to mark the secondary slot as pending when the image was uploaded directly to the primary slot? Did you patch something around this code:&amp;nbsp;&amp;nbsp;&lt;span&gt;&lt;a id="" href="https://github.com/nrfconnect/sdk-mcuboot/commit/fac2cabe98d81b4416052990a22e9698d39267a3"&gt;https://github.com/nrfconnect/sdk-mcuboot/commit/fac2cabe98d81b4416052990a22e9698d39267a3&lt;/a&gt;&amp;nbsp;?&lt;/span&gt;[/quote]
&lt;p&gt;The problem is that boot_serial code ignore that the PRIMARY slot has been written and set the SECONDARY slot as containing an update (and it is not the case ... as we wrote slot 0)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;my patch in boot_serial.c for this is :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@@ -648,7 +652,10 @@ bs_set(char *buf, int len)
                 if (rc == 0 &amp;amp;&amp;amp; memcmp(hash, img_hash.value, sizeof(hash)) == 0) {
                     /* Hash matches, set this slot for test or confirmation */
                     found = true;
-                    goto set_image_state;
+                    if  (slot != BOOT_PRIMARY_SLOT)
+                        goto set_image_state;
+                    else
+                        goto out;
                 }
             }
         }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery/555689"]ould you also say if you have made any changes to the bootloader in addition to the patch mentioned above? The developer was asking whether any of the clocks were stopped prior to this call as this could explain the issue.[/quote]
&lt;p&gt;No clock modification, just my own modification for both issues i detected. Please find attached the full patch I used (it includes also the null ptr patch).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/boot_5F00_serial_5F00_nullptr_5F00_exception.patch"&gt;devzone.nordicsemi.com/.../boot_5F00_serial_5F00_nullptr_5F00_exception.patch&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;R&amp;eacute;mi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/555689?ContentTypeID=1</link><pubDate>Fri, 28 Nov 2025 07:45:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:629cf633-e88a-4072-9868-c850d7292f14</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;R&amp;eacute;mi,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="121118" url="~/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery/555631"] I&amp;#39;ve also detected another issue if&lt;br /&gt;CONFIG_BOOT_SERIAL_IMG_GRP_IMAGE_STATE &amp;amp;&amp;nbsp;CONFIG_BOOT_SERIAL_IMG_GRP_HASH are set and I flash Slot 0. Indeed boot_set_pending_multi is called and set SECONDARY as pendy although it should not ! I patched this. Are you aware of such issue [/quote]
&lt;p&gt;Is the problem that auterm is trying to mark the secondary slot as pending when the image was uploaded directly to the primary slot? Did you patch something around this code:&amp;nbsp;&amp;nbsp;&lt;span&gt;&lt;a id="" href="https://github.com/nrfconnect/sdk-mcuboot/commit/fac2cabe98d81b4416052990a22e9698d39267a3"&gt;https://github.com/nrfconnect/sdk-mcuboot/commit/fac2cabe98d81b4416052990a22e9698d39267a3&lt;/a&gt;&amp;nbsp;?&lt;/span&gt;&lt;/p&gt;
[quote userid="121118" url="~/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery/555631"]On my hardware, I&amp;#39;m not sure to have not seen the issue. But it appears only when : USB cable is wired but there is no serial communication[/quote]
&lt;p&gt;Thanks for confirming. Could you also say if you have made any changes to the bootloader in addition to the patch mentioned above? The developer was asking whether any of the clocks were stopped prior to this call as this could explain the issue.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/555631?ContentTypeID=1</link><pubDate>Thu, 27 Nov 2025 14:07:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7998739-6cdc-4b58-bb00-8042bc440093</guid><dc:creator>Remi Moessner</dc:creator><description>&lt;p&gt;Hello Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery/555628"]&lt;span&gt;In that case it&amp;#39;s not a problem to select one of the swap&amp;nbsp;&lt;/span&gt;algorithms. [/quote]
&lt;p&gt;OK. I&amp;#39;ve created a patch in mcuboot for the moment it works well. I&amp;#39;ve also detected another issue if&lt;br /&gt;CONFIG_BOOT_SERIAL_IMG_GRP_IMAGE_STATE &amp;amp;&amp;nbsp;CONFIG_BOOT_SERIAL_IMG_GRP_HASH are set and I flash Slot 0. Indeed boot_set_pending_multi is called and set SECONDARY as pendy although it should not ! I patched this. Are you aware of such issue ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/125800/mcuboot-crash-when-using-multi-image-swap-serial-recovery/555628"]Would you say it&amp;#39;s hard to reproduce with your code[/quote]
&lt;p&gt;On my hardware, I&amp;#39;m not sure to have not seen the issue. But it appears only when : USB cable is wired but there is no serial communication&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regrads,&lt;/p&gt;
&lt;p&gt;R&amp;eacute;mi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/555628?ContentTypeID=1</link><pubDate>Thu, 27 Nov 2025 13:52:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b57bcbf-c9fc-4475-9d15-b3703624d3be</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;R&amp;eacute;mi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I see. In that case it&amp;#39;s not a problem to select one of the swap&amp;nbsp;&lt;/span&gt;algorithms. v3.2.0 is scheduled to be tagged mid December (this is subject to change) so you should expect to see release candidate (v3.2.0-RC1) tagged soon.&lt;/p&gt;
&lt;p&gt;The issue with the &amp;quot;hang&amp;quot; in the boatloader appears to be caused by the workaround added for this errata:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/errata_nRF5340_Rev1/page/ERR/nRF5340/Rev1/latest/anomaly_340_167.html"&gt;https://docs.nordicsemi.com/bundle/errata_nRF5340_Rev1/page/ERR/nRF5340/Rev1/latest/anomaly_340_167.html&lt;/a&gt;. A temporary solution could be to uncomment this code and accept the risk of getting the spurious event that will lead to a secure fault exception. I&amp;#39;m still working on understanding why this workaround may failing in your case. Would you say it&amp;#39;s hard to reproduce with your code?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&amp;nbsp;&lt;/p&gt;
&lt;p&gt;EDIT:&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;there does not appear to be any reported issues with this workaround. I checked with the developer. Have you made any code changes to the bootloader that we should be aware of if we need to try replicate this issue on our end?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/555488?ContentTypeID=1</link><pubDate>Wed, 26 Nov 2025 10:42:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b844f9f-2479-42e0-9079-fd827cfdfa2f</guid><dc:creator>Remi Moessner</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
&lt;p&gt;Thanks for your feedback.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t use multi image for network core, but for nrf7 wifi image. When is&amp;nbsp; 3.2.0 release forecasted ?&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;R&amp;eacute;mi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot crash when using multi-image + swap + serial recovery</title><link>https://devzone.nordicsemi.com/thread/555480?ContentTypeID=1</link><pubDate>Wed, 26 Nov 2025 10:10:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d35a640-f9e6-421d-acd3-45bf9c671ade</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Rémi&amp;nbsp;&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;The fix for this regression will be included in the upcoming v3.2.0 release. I would also add that for multi image DFU (with network core update support), it&amp;#39;s not recommended to use the swap algorithms as it is not possible to safely revert the network core image&amp;nbsp;from the emulated flash partition in RAM:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1764140079176v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.0.1/page/nrf/app_dev/device_guides/nrf53/simultaneous_multi_image_dfu_nrf5340.html"&gt;https://docs.nordicsemi.com/bundle/ncs-3.0.1/page/nrf/app_dev/device_guides/nrf53/simultaneous_multi_image_dfu_nrf5340.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t recall seeing the issue with usb_disalbe() before. I will need to look more into this and get back to you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>