<?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>Will sys_reboot(SYS_REBOOT_COLD) clear the flag bit set by bootmode_set(BOOT_MODE_TYPE_BOOTLOADER)? (Attempted in the DFU upgrade routine by pressing a key (l9_e1_sol).)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127393/will-sys_reboot-sys_reboot_cold-clear-the-flag-bit-set-by-bootmode_set-boot_mode_type_bootloader-attempted-in-the-dfu-upgrade-routine-by-pressing-a-key-l9_e1_sol</link><description>Below is the relevant code and log: 
 SDK：v2.9.1 
 static void dfu_work_handler ( struct k_work * work ) 
 { 
 int ret = bootmode_set ( BOOT_MODE_TYPE_BOOTLOADER ); 
 LOG_INF ( &amp;quot;bootmode_set ret: %d \n &amp;quot; , ret ); 
 
 k_sleep ( K_SECONDS ( 3 )); 
 
 if</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Mar 2026 07:29:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127393/will-sys_reboot-sys_reboot_cold-clear-the-flag-bit-set-by-bootmode_set-boot_mode_type_bootloader-attempted-in-the-dfu-upgrade-routine-by-pressing-a-key-l9_e1_sol" /><item><title>RE: Will sys_reboot(SYS_REBOOT_COLD) clear the flag bit set by bootmode_set(BOOT_MODE_TYPE_BOOTLOADER)? (Attempted in the DFU upgrade routine by pressing a key (l9_e1_sol).)</title><link>https://devzone.nordicsemi.com/thread/563178?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2026 07:29:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fae2769a-c7a8-46f1-8337-ef70a2c988f3</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Glad to hear that the issue has been resolved.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Abhijith&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Will sys_reboot(SYS_REBOOT_COLD) clear the flag bit set by bootmode_set(BOOT_MODE_TYPE_BOOTLOADER)? (Attempted in the DFU upgrade routine by pressing a key (l9_e1_sol).)</title><link>https://devzone.nordicsemi.com/thread/563176?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2026 06:42:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68004ee0-0372-4229-904f-35ee07a83e50</guid><dc:creator>bobo Chen</dc:creator><description>&lt;h4 class="m_8a5d1357 mantine-Title-root" data-order="4"&gt;Now this problem has been solved.&lt;br /&gt;&lt;br /&gt;Root Cause Summary&lt;/h4&gt;
&lt;p class="mantine-focus-auto m_b6d8b162 mantine-Text-root"&gt;The issue was that the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;boot mode retention backend was incorrectly configured&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;in the Devicetree overlay files.&lt;/p&gt;
&lt;h5 class="m_8a5d1357 mantine-Title-root" data-order="5"&gt;What went wrong&lt;/h5&gt;
&lt;p class="mantine-focus-auto m_b6d8b162 mantine-Text-root"&gt;The original overlay used&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;gpregret1&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(a hardware General Purpose Retention Register) as the backend for the boot mode retention system. While&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;gpregret1&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is a valid hardware peripheral, it did not work reliably for the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;bootmode_set()&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;rarr; MCUboot Serial Recovery flow on the nRF54L15.&lt;/p&gt;
&lt;h5 class="m_8a5d1357 mantine-Title-root" data-order="5"&gt;What fixed it&lt;/h5&gt;
&lt;p class="mantine-focus-auto m_b6d8b162 mantine-Text-root"&gt;Replacing&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;gpregret1&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;with a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;dedicated non-initialized RAM region&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;sram@2003FFFF&lt;/code&gt;) as the retention backend resolved the issue. This is the approach documented in the Zephyr retention subsystem. [&lt;a class="mantine-focus-auto m_849cf0da m_b6d8b162 mantine-Text-root mantine-Anchor-root" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/storage/retention/index.html#boot_mode" rel="noopener noreferrer" target="_blank" data-underline="hover"&gt;Boot mode docs&lt;/a&gt;]&lt;/p&gt;
&lt;h5 class="m_8a5d1357 mantine-Title-root" data-order="5"&gt;Key requirements for&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;bootmode_set()&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to work&lt;/h5&gt;
&lt;ol class="m_abbac491 mantine-List-root"&gt;
&lt;li class="m_abb6bec2 mantine-List-item"&gt;
&lt;div class="mantine-9whsf3 m_75cd9f71 mantine-List-itemWrapper"&gt;&lt;span class="mantine-9whsf3 mantine-List-itemLabel"&gt;&lt;strong&gt;Both the application and MCUboot&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;must define the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;same retention node&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(same RAM address and size) in their respective Devicetree overlays, and assign it to the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;zephyr,boot-mode&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;chosen node.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class="m_abb6bec2 mantine-List-item"&gt;
&lt;div class="mantine-9whsf3 m_75cd9f71 mantine-List-itemWrapper"&gt;&lt;span class="mantine-9whsf3 mantine-List-itemLabel"&gt;&lt;strong&gt;MCUboot&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;must have&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;CONFIG_BOOT_SERIAL_BOOT_MODE=y&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;enabled in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;mcuboot.conf&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to read the boot mode value on startup.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class="m_abb6bec2 mantine-List-item"&gt;
&lt;div class="mantine-9whsf3 m_75cd9f71 mantine-List-itemWrapper"&gt;&lt;span class="mantine-9whsf3 mantine-List-itemLabel"&gt;&lt;strong&gt;The application&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;must have&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;CONFIG_RETENTION_BOOT_MODE=y&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(and related options) enabled in&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;prj.conf&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to write the boot mode value.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class="m_abb6bec2 mantine-List-item"&gt;
&lt;div class="mantine-9whsf3 m_75cd9f71 mantine-List-itemWrapper"&gt;&lt;span class="mantine-9whsf3 mantine-List-itemLabel"&gt;The application must call&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;bootmode_set(BOOT_MODE_TYPE_BOOTLOADER)&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;followed by&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="m_b183c0a2 mantine-Code-root" dir="ltr"&gt;sys_reboot(0)&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;to trigger the transition into Serial Recovery mode.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Will sys_reboot(SYS_REBOOT_COLD) clear the flag bit set by bootmode_set(BOOT_MODE_TYPE_BOOTLOADER)? (Attempted in the DFU upgrade routine by pressing a key (l9_e1_sol).)</title><link>https://devzone.nordicsemi.com/thread/563170?ContentTypeID=1</link><pubDate>Fri, 13 Mar 2026 01:42:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:548d5a81-4644-4b66-a573-0a78cf7369e2</guid><dc:creator>bobo Chen</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2543.build.rar"&gt;devzone.nordicsemi.com/.../2543.build.rar&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hello,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It runs on the demo board, and the attachment is the build folder.&lt;br /&gt;&lt;br /&gt;thanks&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Will sys_reboot(SYS_REBOOT_COLD) clear the flag bit set by bootmode_set(BOOT_MODE_TYPE_BOOTLOADER)? (Attempted in the DFU upgrade routine by pressing a key (l9_e1_sol).)</title><link>https://devzone.nordicsemi.com/thread/563141?ContentTypeID=1</link><pubDate>Thu, 12 Mar 2026 14:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:790731aa-4217-4ab1-8909-334d7081b043</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sys_reboot(SYS_REBOOT_COLD)&lt;/code&gt; should not clear the boot mode flag set by &lt;code&gt;bootmode_set(BOOT_MODE_TYPE_BOOTLOADER)&lt;/code&gt;.&amp;nbsp;&lt;code&gt;bootmode_set()&lt;/code&gt; is to store the boot mode in a retained memory region so that the value survives after a reset. After reboot, MCUboot checks this value. If it detects &lt;code&gt;BOOT_MODE_TYPE_BOOTLOADER&lt;/code&gt;, it clears the flag and enters serial recovery mode. See the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/storage/retention/index.html#boot_mode"&gt;section bootmode&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Are you working with a custom board here? If possible, could you share the generated build folder?&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>