<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-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 update over USB fails because the old application starts during update</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/88539/dfu-update-over-usb-fails-because-the-old-application-starts-during-update</link><description>We are using nrfutil 6.1.3 on Ubuntu 20.04LTS and nRF5 SDK 17.0.2 We&amp;#39;re using a copy of the dfu/secure_bootloader as the bootloader. We&amp;#39;ve changed NRF_BL_DFU_INACTIVITY_TIMEOUT_MS to 0 and added our own keys. On the device we already have a softdevice</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Fri, 03 Jun 2022 09:20:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/88539/dfu-update-over-usb-fails-because-the-old-application-starts-during-update" /><item><title>RE: DFU update over USB fails because the old application starts during update</title><link>https://test-devzone.nordicsemi.com/thread/370830?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 09:20:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e99bbf4c-34ae-467b-9e29-7f98a164cd35</guid><dc:creator>user26071</dc:creator><description>&lt;p&gt;Alternatively, you can skip the APP+SD update, and jump straight to BL+APP+SD update. It is up to you how many steps you want to include in the procedure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU update over USB fails because the old application starts during update</title><link>https://test-devzone.nordicsemi.com/thread/370829?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 09:19:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a743998-2454-43c7-815e-ee17574cf540</guid><dc:creator>user26071</dc:creator><description>[quote user="SebastianA"]No, when I know the device contains the right softdevice I don&amp;#39;t need to include the softdevice, but I want to create a dfu package that also works with devices with older versions of the softdevice so we don&amp;#39;t have to create many different versions.[/quote]
&lt;p&gt;That is true, but please remember that if you change the major version of the softdevice then you need to update the bootloader as well, so you don&amp;#39;t end up with a bootloader and a softdevice that doesn&amp;#39;t work together, in which case you will get a bricked device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Exactly how this is typically done in field, I am not sure. One approach would be to create an application-only image which requires a certain softdevice. If that softdevice isn&amp;#39;t present, then you would send the image with the SD+app. If the But then you need to make sure that bootloader will still work with the new softdevice.&amp;nbsp;If that is also rejected due to it being a major SD update, then you can create a 3rd image containing BL+SD+app. That should be accepted.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU update over USB fails because the old application starts during update</title><link>https://test-devzone.nordicsemi.com/thread/370796?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2022 06:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7b964f5-3318-4b77-b9d0-93021675dfb5</guid><dc:creator>user89430</dc:creator><description>&lt;p style="margin:0px;text-indent:0px;"&gt;No, when I know the device contains the right softdevice I don&amp;#39;t need to include the softdevice, but I want to create a dfu package that also works with devices with older versions of the softdevice so we don&amp;#39;t have to create many different versions. If I understand the documentation correctly that should be a valid use case.&lt;br /&gt;&lt;br /&gt;Renaming the file did not help, but good call with the logging.&lt;br /&gt;&lt;br /&gt;With logging turned on, I get this log:&lt;br /&gt;[... logs for the first startup and update of the softdevice]&lt;br /&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:06:50:315] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0xFE000.␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:06:50:413] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; app: Entering DFU mode.␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:06:50:427] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; nrf_dfu_serial_usb: USB power detected␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:06:50:427] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; nrf_dfu_serial_usb: USB ready␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:07:00:373] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; app: Inactivity timeout.␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:07:00:377] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0xFE000.␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:07:00:394] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; app: Inside main␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:07:00:394] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0xFE000.␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:07:00:404] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; app: No firmware to activate.␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:07:00:863] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;warning&amp;gt; nrf_dfu_settings: No additional data erased␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;&lt;span style="color:#78b4c8;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;[08:07:00:879] &lt;/span&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;&amp;lt;info&amp;gt; nrf_dfu_settings: Backing up settings page to address 0xFE000.␍␍␊&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;text-indent:0px;"&gt;After that the application starts.&lt;br /&gt;&lt;br /&gt;It seems the default value of NRF_BL_DFU_CONTINUATION_TIMEOUT_MS (which is 10000 in the example) is too little for the current nrfutils on my computer. Changing that value to 40000, then the update process worked fine.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;font-family:&amp;#39;DejaVu Sans&amp;#39;;font-size:10pt;"&gt;It seems to take almost 30 seconds from the device turning on USB to the nrfutil starting to send the next&amp;nbsp; image.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU update over USB fails because the old application starts during update</title><link>https://test-devzone.nordicsemi.com/thread/370707?ContentTypeID=1</link><pubDate>Thu, 02 Jun 2022 13:04:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ebb2b45-b8ae-47e4-8288-ae0912703c38</guid><dc:creator>user26071</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you are updating to the exact same softdevice as you had, you don&amp;#39;t need to include the softdevice in the DFU image. Also, the DFU images are typically .zip. Can you try to use&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfutil pkg generate \
    --softdevice sd.hex \
    --application app.hex \
    --key-file priv.pem \
    --hw-version 52 \
    --application-version 1654161769 \
    --sd-req 0 \
    --sd-id 0x100 \
    pkg.zip&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Just to see whether it matters.&lt;/p&gt;
&lt;p&gt;If that doesn&amp;#39;t do the trick, I would suggest you try to compile the _debug bootloader instead of the normal, and monitor the log from the bootloader. On every bootup it should say something about whether or not it should enter DFU mode or jump to the application, and what that decides that option.&lt;/p&gt;
&lt;p&gt;What does the log say?&lt;/p&gt;
&lt;p&gt;If you are not able to figure it out, is there some way for me to reproduce this with a DK? If so, can you upload the bootloader and application that you are using to reproduce this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>