<?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>DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74659/dfu-over-usb---nrf52840-running-zephyr</link><description>Hello, gentleman! 
 
 We are developing our nRF52840-based application using nRF Connect SDK v1.4.2. I know there is a NCS v1.5.1 already available, we plan to switch to that version pretty soon. 
 We would like to have the ability to update nRF52840</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 May 2021 08:50:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74659/dfu-over-usb---nrf52840-running-zephyr" /><item><title>RE: DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/thread/308476?ContentTypeID=1</link><pubDate>Thu, 06 May 2021 08:50:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17973118-82f5-4c08-9aa1-6d1b36994525</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hey, Einar.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I already shared how I write to &lt;strong&gt;&lt;span style="background-color:#ccffff;color:#000000;"&gt;GPREGRET/GPREGRET2&lt;/span&gt;&lt;/strong&gt; registers in one of my above messages. Now, when I compare that with the code you shared, I am realizing I did it wrong. I did not use &lt;span style="background-color:#ff99cc;"&gt;&lt;strong&gt;NRF_POWER&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;as a function argument, that was my mistake.&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f926_2D00_1f3fb.svg" title="Face palm tone1"&gt;&amp;#x1f926;&amp;#x1f3fb;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I confirm that both&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffff;color:#000000;"&gt;GPREGRET/GPREGRET2&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&amp;nbsp;registers are keeping the value written to them before a soft restart with &lt;strong&gt;&lt;em&gt;&lt;span style="background-color:#ccffcc;"&gt;NVIC_SystemReset()&lt;/span&gt;&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;function. Consequently, I was able to enter DFU mode without pressing any button (butonless DFU)! Thanks for bearing with me!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;One more observation I wanted to share with you... because of the following piece of code inside MCUBoot bootloader (&lt;span style="background-color:#ff99cc;"&gt;&lt;strong&gt;&lt;em&gt;bootloader\mcuboot\boot\zephyr\main.c&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifdef CONFIG_MCUBOOT_SERIAL

    struct device const *detect_port;
    uint32_t detect_value = !CONFIG_BOOT_SERIAL_DETECT_PIN_VAL;

    detect_port = device_get_binding(CONFIG_BOOT_SERIAL_DETECT_PORT);
    __ASSERT(detect_port, &amp;quot;Error: Bad port for boot serial detection.\n&amp;quot;);

    /* The default presence value is 0 which would normally be
     * active-low, but historically the raw value was checked so we&amp;#39;ll
     * use the raw interface.
     */
    rc = gpio_pin_configure(detect_port, CONFIG_BOOT_SERIAL_DETECT_PIN,
#ifdef GPIO_INPUT
                            GPIO_INPUT | GPIO_PULL_UP
#else
                            GPIO_DIR_IN | GPIO_PUD_PULL_UP
#endif
           );
    __ASSERT(rc == 0, &amp;quot;Error of boot detect pin initialization.\n&amp;quot;);

#ifdef GPIO_INPUT
    rc = gpio_pin_get_raw(detect_port, CONFIG_BOOT_SERIAL_DETECT_PIN);
    detect_value = rc;
#else
    rc = gpio_pin_read(detect_port, CONFIG_BOOT_SERIAL_DETECT_PIN,
                       &amp;amp;detect_value);
#endif
    __ASSERT(rc &amp;gt;= 0, &amp;quot;Error of the reading the detect pin.\n&amp;quot;);
    if (detect_value == CONFIG_BOOT_SERIAL_DETECT_PIN_VAL &amp;amp;&amp;amp;
        !boot_skip_serial_recovery()) {
        BOOT_LOG_INF(&amp;quot;Enter the serial recovery mode&amp;quot;);
        rc = boot_console_init();
        __ASSERT(rc == 0, &amp;quot;Error initializing boot console.\n&amp;quot;);
        boot_serial_start(&amp;amp;boot_funcs);
        __ASSERT(0, &amp;quot;Bootloader serial process was terminated unexpectedly.\n&amp;quot;);
    }
#endif&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;CPU were entering DFU mode every time the board is power-cycled. Not only when &lt;em&gt;Button 1&lt;/em&gt; is&amp;nbsp;held down while &lt;em&gt;Reset&lt;/em&gt; button is pressed but every time the board is power-cycled. I disabled that piece of code and I am now entering DFU mode only through the&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffff;color:#000000;"&gt;GPREGRET2&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;register.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As a cherry on the top, it remains to replace the .pem key that comes with the MCUBoot bootloader with our own public/private keypair. I will feel free to create a new ticket if I face any difficulty there.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;One more time, thanks for your great support!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f37b.svg" title="Beers"&gt;&amp;#x1f37b;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bojan.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/thread/308323?ContentTypeID=1</link><pubDate>Wed, 05 May 2021 10:42:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6669b6b-e015-4a53-bf3a-de58ba80ad36</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That is odd. I have not found any code in NCS that write to GPREGRET2. Also, I did a very quick test using the basic blinky sample from Zephyr in NCS 1.5.1 where I just added&amp;nbsp;&lt;code&gt;CONFIG_BOOTLOADER_MCUBOOT=y&lt;/code&gt; in prj.conf and read and updated GPREGRET2 before doing a soft reset repeatedly, and that works as expected as you can see here:&lt;/p&gt;
&lt;p&gt;Code:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/4454.main.c"&gt;devzone.nordicsemi.com/.../4454.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Log:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.4.99-ncs2  ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0xc000
*** Booting Zephyr OS build v2.4.99-ncs2  ***
Started...
GPREGRET2 value: 0x00
*** Booting Zephyr OS build v2.4.99-ncs2  ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0xc000
*** Booting Zephyr OS build v2.4.99-ncs2  ***
Started...
GPREGRET2 value: 0x01
*** Booting Zephyr OS build v2.4.99-ncs2  ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0xc000
*** Booting Zephyr OS build v2.4.99-ncs2  ***
Started...
GPREGRET2 value: 0x02&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Can you share how you read and write to GPREGRET2 in your app and in MCUBoot?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/thread/308292?ContentTypeID=1</link><pubDate>Wed, 05 May 2021 07:54:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a683c3a3-74cc-49e5-aebd-5345bd5d8e17</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;I tried the same thing with the latest NCS v1.5.1 as well. Again,&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET/GPREGRET2&lt;/span&gt;&amp;nbsp;&lt;/strong&gt;&lt;span&gt;registers have some constant value after soft reset no matter what I write into them before the soft reset. In the case of NCS v1.5.1 the value of those registers differ compared to the v1.4.2:&lt;/span&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h3 id="mcetoc_1f4to8j310"&gt;v1.4.2&lt;/h3&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Button has changed. State: 1
Button 1 pressed
Setting GPREGRET/GPREGRET2 registers...
Before soft reset. GPREGRET: 86
Before soft reset. GPREGRET2: 172
*** Booting Zephyr OS build v2.4.0-ncs2  ***
[00:00:00.254,730] &amp;lt;inf&amp;gt; mcuboot: Starting bootloader. Test!
[00:00:00.254,760] &amp;lt;inf&amp;gt; mcuboot: Checking GPREGRET/GPREGRET2 registers...
[00:00:00.254,760] &amp;lt;inf&amp;gt; mcuboot: System booting. GPREGRET: 195
[00:00:00.254,760] &amp;lt;inf&amp;gt; mcuboot: System booting. GPREGRET2: 246
[00:00:00.255,249] &amp;lt;inf&amp;gt; mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[00:00:00.255,249] &amp;lt;inf&amp;gt; mcuboot: Boot source: none
[00:00:00.255,371] &amp;lt;inf&amp;gt; mcuboot: Swap type: none
*** Booting Zephyr OS build v2.4.0-ncs2  ***&lt;/pre&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h3 id="mcetoc_1f4to9s9g1"&gt;v1.5.1&lt;/h3&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Button has changed. State: 1
Button 1 pressed
Setting GPREGRET/GPREGRET2 registers...
Before soft reset. GPREGRET: 86
Before soft reset. GPREGRET2: 172
*** Booting Zephyr OS build v2.4.99-ncs2  ***
I: Starting bootloader
I: Checking GPREGRET/GPREGRET2 registers...
I: System booting. GPREGRET: 88
I: System booting. GPREGRET2: 191
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x10000
*** Booting Zephyr OS build v2.4.99-ncs2  ***&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/thread/308278?ContentTypeID=1</link><pubDate>Wed, 05 May 2021 06:59:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43e61ce4-613f-43cd-bf7d-a631c5e032db</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, Einar.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried the same thing with&amp;nbsp;&lt;strong&gt;&lt;span&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET2&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;register but the same thing happens. No matter what I write into&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET/GPREGRET2&lt;/span&gt;&amp;nbsp;&lt;/strong&gt;registers, I always read &lt;em&gt;&lt;strong&gt;0xC3&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;0xF6&lt;/strong&gt;&lt;/em&gt;, respectively, after soft resetting the CPU with&amp;nbsp;&lt;span style="background-color:#ccffcc;"&gt;&lt;strong&gt;&lt;em&gt;NVIC_SystemReset()&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;function.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/thread/308186?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 12:56:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d7bcb29-fe34-4a07-8ad1-5c226a885880</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;The retention registers are retained during a soft reset (NVIC_SystemReset()) but not during a pin reset.&amp;nbsp;I did not think about that.&amp;nbsp;GPREGRET is allready in use by&amp;nbsp;sys_arch_reboot() implementatino for nRF52 in&amp;nbsp;zephyr\soc\arm\nordic_nrf\nrf52\soc.c, which is called by&amp;nbsp;sys_reboot(). But GPREGRET2 seems to be unused, so if you use that instead I think you should be good.&lt;/p&gt;
&lt;p&gt;The retention register is not cleared automatically, so you you want to clear it once you have read it in MCUboot and decided to enter DFU mode so that it does not repeat again on next reset and so on.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/thread/308153?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 11:41:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0c723dc-7109-4da3-9775-9d15a0c49fda</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, Einar.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your explanations!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can report that resetting nRF via &lt;em&gt;mcumgr&lt;/em&gt;&amp;nbsp; using:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;mcumgr --conntype=serial --connstring=&amp;lt;USB Serial Device&amp;gt; reset&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;after binary file is transferred over USB works fine!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Concerning the first question (entering DFU by &lt;span style="background-color:#ccffff;"&gt;&lt;strong&gt;GPREGRET&lt;/strong&gt;&lt;/span&gt;), I tried what you suggested. Inside the application code, I tried to write the &lt;em&gt;&lt;strong&gt;0xB1&lt;/strong&gt;&lt;/em&gt; value into &lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET&lt;/span&gt;&amp;nbsp;&lt;/strong&gt;register and restart the board after that with the following piece of code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void reboot_into_bootloader(void) {  
  #define BOOTLOADER_DFU_GPREGRET_MASK            (0xB0)      
  #define BOOTLOADER_DFU_START_BIT_MASK           (0x01)  
  #define BOOTLOADER_DFU_START    (BOOTLOADER_DFU_GPREGRET_MASK | BOOTLOADER_DFU_START_BIT_MASK)
  NRF_POWER_Type gp_reg_ret;
  nrf_power_gpregret_set((NRF_POWER_Type *)&amp;amp;gp_reg_ret, BOOTLOADER_DFU_START);
  k_msleep(1500);
  uint8_t gp_reg;
  gp_reg = nrf_power_gpregret_get(&amp;amp;gp_reg_ret);
  printk(&amp;quot;System resetting. GPREGRET: %d\n&amp;quot;, gp_reg_ret.GPREGRET);
  printk(&amp;quot;System resetting. GPREGRET: %d\n&amp;quot;, gp_reg);
  NVIC_SystemReset();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;On the other side, inside &lt;em&gt;main.c&lt;/em&gt; file located at&amp;nbsp;&lt;span&gt;&lt;strong&gt;&lt;span style="background-color:#ff99cc;"&gt;&lt;em&gt;bootloader\mcuboot\boot\zephyr\main.c&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;, I tried to read the content of&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;register during the boot process with the following piece of code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;BOOT_LOG_INF(&amp;quot;Checking GPREGRET register...&amp;quot;);
NRF_POWER_Type gp_reg_ret;
uint8_t gp_reg;
gp_reg = nrf_power_gpregret_get(&amp;amp;gp_reg_ret);
BOOT_LOG_INF(&amp;quot;System booting. GPREGRET: %d\n&amp;quot;, (gp_reg_ret.GPREGRET &amp;amp; 0xFF));
BOOT_LOG_INF(&amp;quot;System booting. GPREGRET: %d\n&amp;quot;, gp_reg);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The content of &lt;span&gt;&lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span&gt;register after restart is equal to &lt;em&gt;&lt;strong&gt;0xC3&lt;/strong&gt;&lt;/em&gt;!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any idea why those two values differ? According to some threads (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/1935/definitive-information-on-gpregret-register" rel="noopener noreferrer" target="_blank"&gt;link&lt;/a&gt;),&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;register is a RAM mapped retained register which will lose it&amp;#39;s content after power-cycle. However, it keeps its content after a wakeup from SYSTEMOFF mode. I was using&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;NVIC_SystemReset()&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt; function to reset the CPU. Could it be that the register lost its value because of the way CPU is restarted?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, should I clear the&amp;nbsp;&lt;strong&gt;&lt;span style="background-color:#ccffff;"&gt;GPREGRET&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;register before writing any value there? nRF SDK has a function for that (&lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;sd_power_gpregret_clr()&lt;/em&gt;&lt;/span&gt;) but I was unable to find anything similar in &lt;strong&gt;&lt;em&gt;&amp;lt;hal/nrf_power.h&amp;gt;&lt;/em&gt;&lt;/strong&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bojan.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over USB - nRF52840 running Zephyr</title><link>https://devzone.nordicsemi.com/thread/308005?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 18:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:315074ac-d041-4be7-9362-7edfae1e074b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Bojan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The guide you refer to demonstrates the serial recovery feature of MCUBoot, where the DFU process is handled entirely in the bootloader. There is no option to enter DFU by GPREGret there, but you can add it yourself by modifying MCUBoot to check for a magic word in the retention register that you set in your application before resetting. In that case you could look at how this is handled in main() in&amp;nbsp;bootloader\mcuboot\boot\zephyr\main.c and add your logic there.&lt;/p&gt;
&lt;p&gt;Regarding the second question, you can reset via mcumgr using &amp;quot;mcumgr reset&amp;quot;.&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>