<?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/dfu on nRF5280 reverts back to previous install after power cycle</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82601/mcuboot-dfu-on-nrf5280-reverts-back-to-previous-install-after-power-cycle</link><description>Setup mcuboot and dfu to upgrade firmware on the nRF52840 of our board. Upgrading to new firmware works as expected and the new firmware is running after the install. If I power cycle the board, device come up in pervious version of firmware. Somehow</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Dec 2021 16:00:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82601/mcuboot-dfu-on-nrf5280-reverts-back-to-previous-install-after-power-cycle" /><item><title>RE: mcuboot/dfu on nRF5280 reverts back to previous install after power cycle</title><link>https://devzone.nordicsemi.com/thread/343256?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 16:00:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac85057e-d536-4e90-9e85-6952c0b4e706</guid><dc:creator>GameCodingNinja</dc:creator><description>&lt;p&gt;&lt;span&gt;Moved the boot_write_img_confirmed() to main and that seems to have solved the problem. I can power cycle or reboot and it doesn&amp;#39;t revert back to the prior firmware version.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mcuboot/dfu on nRF5280 reverts back to previous install after power cycle</title><link>https://devzone.nordicsemi.com/thread/342990?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 17:47:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdc3a74a-97c8-4f0e-8f27-73633377f71a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;&lt;span&gt;boot_write_img_confirmed() marks the currently running image as confirmed. I guess you are still running the &amp;quot;old image&amp;quot; in the case&amp;nbsp;EVENT_FIRMWARE_DONE ? Try calling boot_write_img_confirmed()&amp;nbsp;in main(), after you have done your application&amp;nbsp;initialization successfully&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: mcuboot/dfu on nRF5280 reverts back to previous install after power cycle</title><link>https://devzone.nordicsemi.com/thread/342978?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 15:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f07ee913-dece-4386-a7c9-a7c0db10a001</guid><dc:creator>GameCodingNinja</dc:creator><description>&lt;p&gt;boot_write_img_confirmed() returns 0.&lt;/p&gt;
&lt;p&gt;Below is the code that executes when the upgrade completes. After the sys_reboot(0), it will report the correct version number of what was installed. After a power cycle or another&amp;nbsp;&lt;span&gt;sys_reboot(0), it will revert to the previous firmware and report that version number.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Something is not saving that it needs to keep booting from the newly written to slot partition but yet the first sys_reboot(0) after the upgrade works as expected. Odd.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case EVENT_FIRMWARE_DONE:
{
    int err = dfu_target_done(true);
    if(err != 0) 
    {
        LOG_ERR(&amp;quot;FW update failed with error: %d. Device will resume operation.\n&amp;quot;, err);        
    }
    else
    {
        LOG_INF(&amp;quot;FW update was succesfull. System will now reset and reboot.\n&amp;quot;);
        k_sleep(K_SECONDS(2));

        // Reset the target
        err = dfu_target_reset();
        if(err != 0) 
        {
            LOG_ERR(&amp;quot;FW update target reset error: %d. Device will resume operation and not reboot.\n&amp;quot;, err);        
        }
        else
        {
            err = boot_write_img_confirmed();
            if(err != 0)
            {
                LOG_ERR(&amp;quot;Failed to confirm: %d&amp;quot;, err);
            }

            sys_reboot(0);
        }
    }

    break;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mcuboot/dfu on nRF5280 reverts back to previous install after power cycle</title><link>https://devzone.nordicsemi.com/thread/342906?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 12:02:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a196a75-a694-4199-a36b-2866c540add3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Try calling this in your application:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;&lt;span&gt;boot_write_img_confirmed&lt;/span&gt;&lt;/span&gt;&lt;span&gt;();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>