<?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>Understanding/debugging DFU?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66932/understanding-debugging-dfu</link><description>Hello, 
 I have added DFU to our project. In general it works, at least parts of it. 
 Assume I receive often/always NRF_DFU_EVT_DFU_FAILED, how do I find out, what is the reason for it? 
 Is there some documentation which handles these case? Perhaps</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Oct 2020 08:22:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66932/understanding-debugging-dfu" /><item><title>RE: Understanding/debugging DFU?</title><link>https://devzone.nordicsemi.com/thread/275785?ContentTypeID=1</link><pubDate>Tue, 20 Oct 2020 08:22:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fd9915d-3769-4120-a37e-1462fd41f6ba</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks. So it&amp;#39;s apparently failing on the bootloader version check. The bootloader version number must be incremented on every update. An update with the same version will not be accepted,&amp;nbsp; please refer to the NRF_DFU_APP_ACCEPT_SAME_VERSION config options for details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding/debugging DFU?</title><link>https://devzone.nordicsemi.com/thread/275554?ContentTypeID=1</link><pubDate>Mon, 19 Oct 2020 10:02:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4ead5ec-b012-4249-83a5-67a12f5bb68f</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;Many thanks for your hints!&lt;/p&gt;
&lt;p&gt;I have done debugging on this topic and I think, I know the check which is failing:&lt;/p&gt;
&lt;pre style="background-color:#ffffff;color:#080808;font-family:&amp;#39;JetBrains Mono&amp;#39;,monospace;font-size:9,8pt;"&gt;&lt;span style="color:#00627a;"&gt;fw_version_ok&lt;/span&gt; from components\libraries\bootloader\dfu\nrf_dfu_ver_validation.c&lt;/pre&gt;
&lt;pre style="background-color:#ffffff;color:#080808;font-family:&amp;#39;JetBrains Mono&amp;#39;,monospace;font-size:9,8pt;"&gt;&lt;span style="color:#00627a;"&gt;has the following check inside (almost at the end of the function):&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    else
    {
        return  (p_init-&amp;gt;fw_version &amp;gt; s_dfu_settings.bootloader_version);
    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Both version are 0x0001, so function returns false, because it is not greater.&lt;br /&gt;This gives me the above error.&lt;br /&gt;&lt;br /&gt;This is a text from sdk_config.h:&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;&lt;br /&gt;// &amp;lt;i&amp;gt; Whether to check the incoming version against the version of the existing app and/or&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; the incoming SoftDevice requirements against the existing SoftDevice.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; This applies to application updates, and possibly to SoftDevice updates.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; Disabling this causes the checks to always ignore the incoming firmware version and&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; to ignore the SoftDevice requirements if the first requirement is 0.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; This does not apply the bootloader updates. If the bootloader depends on the SoftDevice&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; e.g. for BLE transport, this does not apply to SoftDevice updates.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; See @ref lib_bootloader_dfu_validation for more information.&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;// &amp;lt;i&amp;gt; When signed updates are required, version checking should always be enabled.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have to use signed updates, so I must enable this.&lt;br /&gt;I do DFU via Bluetooth. I have a bit problems to understand what above means...&lt;br /&gt;What can stay at same version, what must be increased?&lt;br /&gt;I must always increase bootloader version?&lt;br /&gt;And when I update bootloader I can optionally update softdevice to a new version?&lt;br /&gt;Or update bootloader version with a downgrade of softdevice?&lt;br /&gt;But never downgrade bootloader?&lt;br /&gt;Is this right?&lt;br /&gt;Is there some document which helps me on this topic or even on other similar topics?&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;pre style="background-color:#ffffff;color:#080808;font-family:&amp;#39;JetBrains Mono&amp;#39;,monospace;font-size:9,8pt;"&gt;&lt;span style="color:#00627a;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding/debugging DFU?</title><link>https://devzone.nordicsemi.com/thread/274570?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 10:48:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4ba145e-4abe-446d-86a8-0741bc804ab7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The update should not be rejected because you upload the same Softdevice version. The downgrade prevention mechanism you mentioned applies to the app fw version.&lt;/p&gt;
&lt;p&gt;There is no logging enabled in this bootloader project you are building, so I suggest you debug the bootloader with GDB/Ozone or similar to help find out which step in nrf_dfu_ver_validation.c::nrf_dfu_ver_validation_check() is failing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding/debugging DFU?</title><link>https://devzone.nordicsemi.com/thread/274382?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 14:38:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5435c51a-7780-4b7e-83af-b9ed19ec8e0b</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;This is what I see in build log:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[100%] Generating xxx_bl_sd_app.zip&lt;br /&gt;cd /d C:\git\embedded_software\cmake-build-debug\src &amp;amp;&amp;amp; C:\Users\marie.maurer\AppData\Local\Programs\Python\Python38\Scripts\nrfutil.exe pkg generate --sd-req 0x0101 --hw-version 52 --application C:/git/embedded_software/cmake-build-debug/src/xxx.hex --application-version-string 1.0.0 --app-boot-validation NO_VALIDATION --key-file C:/git/embedded_software/src/../keys/dfu_private.key --sd-id 0x0101 --bootloader C:/git/embedded_software/toolchains/nRF5/nRF5_SDK_17.0.2_d674dde/examples/dfu/secure_bootloader/pca10040_s132_ble/armgcc/_build_xxx/bootloader.hex --bootloader-version 1 --softdevice C:/git/embedded_software/toolchains/nRF5/nRF5_SDK_17.0.2_d674dde/components/softdevice/s132/hex/s132_nrf52_7.2.0_softdevice.hex --sd-boot-validation NO_VALIDATION C:/git/embedded_software/cmake-build-debug/src/xxx_bl_sd_app.zip&lt;br /&gt;Zip created at C:/git/embedded_software/cmake-build-debug/src/xxx_bl_sd_app.zip&lt;br /&gt;mingw32-make.exe[3]: Leaving directory &amp;#39;C:/git/embedded_software/cmake-build-debug&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I use SD 7.2.0 and SDK 7.0.2. Bootloader also generated with these versions.&lt;/p&gt;
&lt;p&gt;Is update SD 7.2.0 to SD 7.2.0 a problem? I seem to remember there was a switch that prevents downgrade...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding/debugging DFU?</title><link>https://devzone.nordicsemi.com/thread/274341?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 13:22:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e306d10d-b5ca-4e59-959b-bab1794a1a51</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello Marie,&lt;/p&gt;
&lt;p&gt;The extended error range can be used to report any of the following error: &lt;a class="el" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/group__nrf__dfu__rescodes.html#ga50daf693717ee90d08614d2a337e2361"&gt;nrf_dfu_ext_error_code_t.&amp;nbsp;&amp;nbsp; &lt;/a&gt;In this case I suppose the extended error could be &lt;em&gt;NRF_DFU_EXT_ERROR_SD_VERSION_FAILURE&lt;/em&gt; considering you only get this for the Softdevice update. &lt;/p&gt;
&lt;p&gt;Did you add the FWID of the current Softdevice running on your device when you crated the DFU update package? The update will get rejected otherwie.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1602508785777v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I find the best way to debug the bootloader is to start with the debug configuration (pca10xxx_&amp;lt;softdevice&amp;gt;_&amp;lt;transport&amp;gt;&lt;strong&gt;_debug) &lt;/strong&gt;which has logging over RTT enabled by default. The log is quite verbose, and will usually print out the exact error when an update fails.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Understanding/debugging DFU?</title><link>https://devzone.nordicsemi.com/thread/274335?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 13:10:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb6369da-3d40-42d3-9d0b-875fe5a62c00</guid><dc:creator>MarieMaurer</dc:creator><description>&lt;p&gt;Concrete example: I seems to be able to update the app, but not the softdevice. It results in an error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;nrf_dfu_req_handler_req_process&lt;/p&gt;
&lt;p&gt;NRF_DFU_OP_OBJECT_EXECUTE&lt;/p&gt;
&lt;p&gt;response.result=0x000B&lt;/p&gt;
&lt;p&gt;NRF_DFU_EVT_DFU_FAILED&lt;/p&gt;
&lt;p&gt;NRF_DFU_EVT_TRANSPORT_DEACTIVATED&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Error seems to be 0x0B, which seems to be &amp;quot;&lt;span style="color:#871094;font-style:italic;"&gt;NRF_DFU_RES_CODE_EXT_ERROR&amp;quot;.&lt;br /&gt;According to explanation: &lt;/span&gt;&lt;span style="color:#8c8c8c;font-style:italic;"&gt;Extended error. The next byte of the response contains the error code of the extended error (see @ref nrf_dfu_ext_error_code_t.&lt;br /&gt;But how to get extended error code?&lt;br /&gt;&lt;br /&gt;Already with my minimal setup I reach maximum size which does not fit to limits of size of bootloader in flash.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#871094;font-style:italic;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>