<?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>nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104564/nrf-dfu-activated-by-bootloader-settings-page</link><description>hi. Is there a good sample for nrf52840 DFU on the &amp;quot;client side&amp;quot; meaning the one that causes the firmwre to be activaed ? Also if i update the bootloader alone, is there a way to ignore the version check and just install it ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Oct 2023 13:09:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104564/nrf-dfu-activated-by-bootloader-settings-page" /><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/450856?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2023 13:09:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14776fe3-cf38-42df-8304-4373c637cf6b</guid><dc:creator>Eyal_Gal</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static bool fw_version_ok(dfu_init_command_t const * p_init)
{
    ASSERT(p_init != NULL);
    ASSERT(p_init-&amp;gt;has_fw_version);

    if (  (p_init-&amp;gt;type == DFU_FW_TYPE_APPLICATION)
       || (p_init-&amp;gt;type == DFU_FW_TYPE_SOFTDEVICE))
    {
        return ((p_init-&amp;gt;fw_version &amp;gt;= s_dfu_settings.app_version) || !NRF_DFU_APP_DOWNGRADE_PREVENTION);
    }
    else
    {
        return  (p_init-&amp;gt;fw_version &amp;gt; s_dfu_settings.bootloader_version);
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This ctually explains it, for app and&amp;nbsp;softdevice the code allows same version if it&amp;#39;s allowed to downgrade, for bootloader it doesn&amp;#39;t. Unless i literally change the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/450802?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2023 10:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f7ef50a-8d91-4279-be12-19a43f5c8918</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again,&amp;nbsp;&lt;br /&gt;Thanks.&amp;nbsp;Yes it explains what you observed. &lt;br /&gt;The version check is&amp;nbsp;only performed if you do BLE DFU. The version check is a logic implemented in the bootloader.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/450759?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2023 08:06:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3a2ea03-53d0-4e59-934b-75959de4f985</guid><dc:creator>Eyal_Gal</dc:creator><description>&lt;p&gt;right you are, i&amp;#39;ll explain again and give some more context.&lt;br /&gt;writing the bootloader (only) code ourselves to a certain location and then setting the bootloader settings page with &amp;quot;valid_bl&amp;quot; works now, at least my POC(dind&amp;#39;t use OTA really , i wrote the binary using j-link `loadfile` on a dev board....).&lt;br /&gt;&lt;br /&gt;We have yet another method of performing&amp;nbsp;DFU, using the BLE method.&lt;br /&gt;I did the same actions as before, only i did not extract the binary from the .zip file and used the whole zip file. If i create a zip file of the APP only,even id i always use --application-version 1 the BLE DFU will work and upgrade, but for the bootloader it doesn&amp;#39;t. The DFU probably when getting the init_command[] array from the .dat file inside the zip sees the bootloader version and it can also read the current one from the settings, and it says in a log message it&amp;#39;s the same version and there for will not upgrade.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/450755?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2023 07:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e390b6f4-5209-4e2c-9e4a-aaa87bf121a1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eyal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not so sure what you meant by &amp;quot;&lt;span&gt;only BLE requires version change ?&amp;quot; is it Application or Bootloader or Softdevice ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The version verification is done&amp;nbsp;before the bootloader setting is written. So if you write directly to the bootloader setting there will be no version check. If you want to do the check you need to do that in the application when receiving the image.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/450677?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 18:59:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4f70b2e-3823-44cb-860d-c56736b0ddb3</guid><dc:creator>Eyal_Gal</dc:creator><description>&lt;p&gt;worked eventually, yes, with no change of version, so only BLE requires version change ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/450000?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 09:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c16e54c6-2539-468b-ab67-2206f8c8ebdd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eyal Gal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;OK. We will need to debug and check why bootloader can not be updated (but application can). I assume you have marked s_dfu_settings.bank_1 with&amp;nbsp;NRF_DFU_BANK_VALID_BL ? Have you stepped into&amp;nbsp;nrf_bootloader_fw_activate() ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If you have marked,&amp;nbsp;bl_activate() will be called. Inside that function we will check if the new bootloader has already replaced the old bootloader (memcmp) then we don&amp;#39;t need to do anything just return and remove the&amp;nbsp;&lt;span&gt;NRF_DFU_BANK_VALID_BL&amp;nbsp; on bank 1. If not we will&amp;nbsp;overwrite the bootloader using&amp;nbsp;nrf_dfu_mbr_copy_bl() . This function will use the MBR to replace the current bootloader and reset. The chip will boot into the new bootloader after that.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please let me know what you find when stepping into the code of the bootloader. Please try to compare to when you do the successful update with the app instead of the bootloader to see if there is any difference.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/449885?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 14:54:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ae8ec71-4dc6-4c4a-b71d-44a9954b6b08</guid><dc:creator>Eyal_Gal</dc:creator><description>&lt;p&gt;i don&amp;#39;t try to update the app and bootloader at the same time. Also note that i don&amp;#39;t need to recieve the image from anywhere , when the main.c code of the secure bootloader is run a flash area is already populated with the firmware and the settings page is already written with the right data.&lt;br /&gt;&lt;br /&gt;I do separate binaries and separate OTA for bootloader and app DFUs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/449884?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 14:50:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a4070ec-1aa9-49a1-a8bc-805cc5be0476</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eyal Gal,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think version check is performed after the bootloader receive new image. It&amp;#39;s done in&amp;nbsp;nrf_dfu_validation_prevalidate() before the image is received.&amp;nbsp;&lt;br /&gt;So I don&amp;#39;t think it is causing the problem. Could you try modifying&amp;nbsp;&lt;strong&gt;fw_version_ok() &lt;/strong&gt;to not check for the version to see if it make any difference.&lt;br /&gt;I think the problem here is that you can&amp;#39;t update app and bootloader at the same time. You can see the combination list here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/dfu_package_combinations.html?cp=11_8_3_0"&gt;https://infocenter.nordicsemi.com/topic/ug_nrfutil/UG/nrfutil/dfu_package_combinations.html?cp=11_8_3_0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You would need to do it one by one.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/449768?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 10:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5daed22e-3f07-438b-bae6-c4d4314b105f</guid><dc:creator>Eyal_Gal</dc:creator><description>&lt;p&gt;BTW if ignoring the version is a problem i understand i need to send new version using the init_command , any sample code for that because i didn&amp;#39;t find any, i assume the data that goes there is the one in the .dat file generated by nrfutil pkg generate command&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/449759?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 09:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b988931a-d017-4516-8b47-e007b03d1b16</guid><dc:creator>Eyal_Gal</dc:creator><description>&lt;p&gt;1. yes we are using nrf sdk 15.2&lt;br /&gt;2. we create a zip file for the app and bootloader (one for each) using the nrtutil.&lt;br /&gt;3. version number is 1 for app, 1 for 1 for bootloader all the time as it is saved internally in the binary.&lt;br /&gt;4. we download the .bin file inside the zip to the nordic using cellular and then update nrf_dfu_settings_t struct in the dfu settings page on the flash and restart. It works well for the app, not so much for the bootloader, so i wonder without changing the bootloader already installed in the field how can i force it to install and ignore the version &amp;quot;not changing&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf dfu activated by bootloader settings page</title><link>https://devzone.nordicsemi.com/thread/449756?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 09:43:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9fc2ca8-4d6a-40b4-a47f-5e7ced51fdec</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Eyal,&lt;/p&gt;
&lt;p&gt;I assume you are using nRF5 SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you please clarify you want to activate by a command from the &amp;quot;client side&amp;quot; /master side or you want to activate the firmware by bootloader setting&amp;nbsp; ? Could you give some more information on what you want to achieve ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Bootloader version check you can find at&amp;nbsp;&lt;strong&gt;fw_version_ok() &lt;/strong&gt;in nrf_dfu_ver_valication.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>