<?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>Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119790/custom-dfu-imlementation</link><description>I am implementing DFU using my own transport to retrieve the binary image from AWS. 
 I&amp;#39;m developing in 2.6.0. 
 I am using the DFU TARGET libraries. 
 When I start my download I look at the first 512 byte block with 
 i = dfu_target_img_type ( buffer2</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Mar 2025 13:19:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119790/custom-dfu-imlementation" /><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/529816?ContentTypeID=1</link><pubDate>Mon, 31 Mar 2025 13:19:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ec495ee-c7a1-4b98-bf8d-b78bcd269cec</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Glad to hear that your issue has been resolved.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/529764?ContentTypeID=1</link><pubDate>Mon, 31 Mar 2025 11:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f3a114b-7a45-42ef-bd9b-e431b18832f9</guid><dc:creator>KentOverton</dc:creator><description>&lt;p&gt;I&amp;nbsp; removed the three lines in prj.conf that enabled DFU vie Bluetoot (using Android NRF CONNECT).&lt;/p&gt;
&lt;p&gt;The update now works, I can download a new app_update.bin, reboot, see that the new app_update.bin is running, reboot again and see that it&amp;#39;s the same new firmware.&lt;/p&gt;
&lt;p&gt;Note that I don&amp;#39;t have to do a b oot_write_img_confired().&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure why this worked - it woud be convienient to be able to use both the Bluetooth DFU update and my custom dfu_update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/529482?ContentTypeID=1</link><pubDate>Fri, 28 Mar 2025 11:01:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ddd182f-6fb4-4e00-917d-002370f2a315</guid><dc:creator>KentOverton</dc:creator><description>&lt;p&gt;&lt;span&gt;Abhijith&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure how to use the &amp;#39;Insert Tab&amp;#39; to paste a log&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve copied the build log to my google drive at&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/file/d/1lNcQtgqpXq1MvOrlFGtU_-Y1Mu6NSRTr/view?usp=sharing"&gt;https://drive.google.com/file/d/1lNcQtgqpXq1MvOrlFGtU_-Y1Mu6NSRTr/view?usp=sharing&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve copied my prj.conf to my googled drive at&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/file/d/1og7hsGK8A5sq-NTyEQYt3sUoY5zYObPK/view?usp=sharing"&gt;https://drive.google.com/file/d/1og7hsGK8A5sq-NTyEQYt3sUoY5zYObPK/view?usp=sharing&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have no mcuboot.conf&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/529372?ContentTypeID=1</link><pubDate>Thu, 27 Mar 2025 18:32:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f38b04ab-9282-44e1-be82-04ed69fb8f6c</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Could you share the complete build log, &lt;code&gt;prj.conf&lt;/code&gt;, and &lt;code&gt;mcuboot.conf&lt;/code&gt; files here? Please use the Insert tab to paste the full log.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt; Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/528921?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2025 18:39:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b116a8d1-6792-4341-a2e1-64810d361776</guid><dc:creator>KentOverton</dc:creator><description>&lt;p&gt;They are already enabled.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/528911?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2025 17:02:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24bde78a-d5e2-4dc4-a4b4-ffdcfefd9cad</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Try enabling the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_MCUBOOT_IMG_MANAGER"&gt;CONFIG_MCUBOOT_IMG_MANAGER&lt;/a&gt; and this will select the BOOTUTIL_LIB.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_FLASH_MAP=y
CONFIG_MCUBOOT_IMG_MANAGER=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/528725?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2025 23:00:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73be3987-efe8-4830-80e6-a043771551b3</guid><dc:creator>KentOverton</dc:creator><description>&lt;p&gt;I tried it.&amp;nbsp;My&amp;nbsp; main()starts&lt;/p&gt;
&lt;p&gt;err=boot_write_img_confirmed();&lt;br /&gt; sprintf(buff,&amp;quot;Err=%d&amp;quot;,err);&lt;/p&gt;
&lt;p&gt;Err is a 0 - but the device reverted to the previosus version on the next boot.&lt;/p&gt;
&lt;p&gt;Are tjhere reuired CONFIG.... lines in prj.conf?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/528682?ContentTypeID=1</link><pubDate>Mon, 24 Mar 2025 15:48:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34c9932f-e07b-40a2-a6cd-3ae1764d018f</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You can make use of the function&lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/group_mcuboot_api.html#ga95ccc9e1c7460fec16b9ce9ac8ad7a72:~:text=%E2%97%86-,boot_write_img_confirmed(),-int%20boot_write_img_confirmed"&gt; boot_write_image_confirmed&lt;/a&gt;, which marks the currently running firmware image as confirmed and prevents MCUboot from reverting to an older image at the next reset. Take a look at &lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/group_mcuboot_api.html"&gt;MCUboot image control APIs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;br /&gt; Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/528511?ContentTypeID=1</link><pubDate>Sun, 23 Mar 2025 17:17:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c7b6720-540d-4570-a714-98ebe1cd3428</guid><dc:creator>KentOverton</dc:creator><description>&lt;p&gt;Menon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sorry to be such a bother - burt I still have an issue.&lt;/p&gt;
&lt;p&gt;My DFU logic woeks perfectly. I can download an update, load it inti the secondary slot and when I reboot the new firmware runs.&lt;/p&gt;
&lt;p&gt;When I reboot a second time the firmware reverts to the old version.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am sure that the mechanism is fully documented documented - but I have spent more than a little time serchig for a clear description of how to confirm the download.&lt;/p&gt;
&lt;p&gt;We are akready using FOTA over BLE, using an Android phone and nRF Connect&lt;/p&gt;
&lt;p&gt;I want to do the equivalent of TEST and CONFIRM in nRF Connect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you could point me at an example - or documentation - of how to implement this I would greatly appreciate it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/527900?ContentTypeID=1</link><pubDate>Tue, 18 Mar 2025 16:56:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbb9b5d8-51b1-44bf-af02-0bbb6a011845</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Good to hear that you were able to make the DFU work.&lt;/p&gt;
&lt;p&gt;This makes sense because if you look at &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/537254070971157a07c35300be3cb4621c7a58cf/subsys/dfu/dfu_target/src/dfu_target_mcuboot.c#L116"&gt;dfu_target_mcuboot_init()&lt;/a&gt;, you can see that if no buffer is assigned using &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/537254070971157a07c35300be3cb4621c7a58cf/subsys/dfu/dfu_target/src/dfu_target_mcuboot.c#L100"&gt;dfu_target_mcuboot_set_buf()&lt;/a&gt;, the initialization will fail, and the error message you are seeing is &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/537254070971157a07c35300be3cb4621c7a58cf/subsys/dfu/dfu_target/src/dfu_target_mcuboot.c#L126"&gt;generated from here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I think the appropriate buffer size depends on the flash page size. Since you are working with the nRF52840, I recommend at least 4096 bytes (or try 8192 bytes).&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt; Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/527666?ContentTypeID=1</link><pubDate>Mon, 17 Mar 2025 14:00:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54383865-1acb-4f68-86d5-0453f0083fad</guid><dc:creator>KentOverton</dc:creator><description>&lt;p&gt;I&amp;#39;ve done some more research and testing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After looking at aother post here&amp;nbsp;I added&amp;nbsp;&lt;/p&gt;
&lt;p&gt;buffer4[1024] to line 44 of dfutest.c, giving&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;uint8_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;buffer&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;1200&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;span&gt;buffer2&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;1200&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;span&gt;buffer3&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;100&lt;/span&gt;&lt;span&gt;],&lt;/span&gt;&lt;span&gt;buffer4&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;1024&lt;/span&gt;&lt;span&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I added&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;dfu_target_mcuboot_set_buf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;buffer4&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;sizeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;buffer4&lt;/span&gt;&lt;span&gt;)); at line 140 of dfutest.c.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;dfu_target_init(...) now returns 0.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;After just a little bit of playing around my firmwar now does the complete DFU update.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Could you please&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1. tell me why this worked&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 2. tell me an appropriate size for the buffer in&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dfu_target_mcuboot_set_buf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/527485?ContentTypeID=1</link><pubDate>Sun, 16 Mar 2025 22:32:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb080a0a-c615-435b-b83c-0a2aafaa0e7c</guid><dc:creator>KentOverton</dc:creator><description>&lt;p&gt;It.s&amp;nbsp; a NRF52840-CKAA-R7.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m developing under 2.6.0.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a Custom Configuration -&amp;nbsp;I&amp;#39;ve attached a version of my firmware to this note. You will see&amp;nbsp; boards directory in the project.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/DFUTEST_5F00_NORDIC.zip"&gt;devzone.nordicsemi.com/.../DFUTEST_5F00_NORDIC.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve modified&amp;nbsp;my project,&amp;nbsp;- isolating the failing code in src/dfutest.c&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In my production code there&amp;#39;s a lot of stuff surrounding this code, A connection is made to my AWS server, a firmwaere download is requeted, the firmare downloads blocks of code from the server and processes these blocks.&lt;/p&gt;
&lt;p&gt;dfutest.c has an image of the first block of code I get from the server.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;main.c loops at the very top, continuously running the test.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU imlementation</title><link>https://devzone.nordicsemi.com/thread/527415?ContentTypeID=1</link><pubDate>Fri, 14 Mar 2025 15:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f27aec83-c5aa-46c9-bc9f-0266242ab76b</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Which Nordic chip or DK are you using here? What build configuration did you use for building the application?&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;pm_static&lt;/code&gt; file, &lt;code&gt;mcuboot_primary&lt;/code&gt; seems to overlap with &lt;code&gt;mcuboot_pad&lt;/code&gt;. Try shifting &lt;code&gt;mcuboot_primary&lt;/code&gt; to avoid potential conflicts.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt; Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>