<?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>Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98352/get-dfu-callback-in-the-applicaiton</link><description>Hello, 
 I&amp;#39;m trying to find a way to get an event or callback in the application when DFU start updating or downloading image using BLE. 
 so far I found CONFIG_MCUBOOT_ACTION_HOOKS but I&amp;#39;m now sure if this is the correct way, but anyway I added 
 
 CONFIG_MCUBOOT_ACTION_HOOKS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Aug 2023 06:49:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98352/get-dfu-callback-in-the-applicaiton" /><item><title>RE: Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/thread/442879?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2023 06:49:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0362810b-a733-4bf0-bc6c-d4d6e758569f</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Yes&lt;/p&gt;
&lt;p&gt;You can use this menu to check which versions it is supported for:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1692859754391v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/thread/442843?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 19:56:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27e55ade-0e1a-4717-9b02-57449e7aaa99</guid><dc:creator>Robert de Brum</dc:creator><description>&lt;p&gt;Is this supported in v2.3.0? or v2.4.0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/thread/418969?ContentTypeID=1</link><pubDate>Tue, 04 Apr 2023 08:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:881f6c08-24e1-488a-944a-e81fe466dc54</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, it looks like MCUmgr callbacks are not yet supported in 2.2.0.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/thread/418949?ContentTypeID=1</link><pubDate>Tue, 04 Apr 2023 07:28:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e382d9b9-bd32-4c45-aaa1-27383cb1e688</guid><dc:creator>Mustafa</dc:creator><description>&lt;p&gt;Thanks, Sigurd,&lt;/p&gt;
&lt;p&gt;I think that&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a class="reference external" title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS"&gt;&lt;code class="xref kconfig kconfig-option docutils literal notranslate"&gt;&lt;span class="pre"&gt;CONFIG_MCUMGR_MGMT_NOTIFICATION_HOOKS&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&amp;nbsp;is not supported in ncs2.2.0 right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;best regards!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/thread/418841?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2023 12:15:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12a38111-4875-448f-a7ab-7686ce21bfe8</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="Mustafaq"]* downloading image using BLE ( DFU callback)&amp;nbsp;[/quote]
&lt;p&gt;See &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/mcumgr_callbacks.html"&gt;MCUmgr Callbacks&lt;/a&gt;.&lt;br /&gt;You can see an example of this in our &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/d4f1fd447c515006a5485b57c61506695767cbf1/samples/matter/common/src/dfu_over_smp.cpp#L57"&gt;matter samples&lt;/a&gt;.&lt;/p&gt;
[quote user="Mustafaq"]prepare an application for a reboot&amp;nbsp;[/quote]
&lt;p&gt;If you are using the &amp;quot;os_mgmt&amp;quot; for reset, it should be similar to the above solution.&lt;/p&gt;
[quote user="Mustafaq"]and after that Callback in the bootloader level for swapping the image and upgrading the fw.&amp;nbsp;[/quote]
&lt;p&gt;In this case, &lt;span&gt;CONFIG_MCUBOOT_ACTION_HOOKS&lt;/span&gt; is the way to go.&lt;/p&gt;
&lt;p&gt;However, as far as I can find, you can not add these hooks from your project.&lt;br /&gt;I think that the easiest way to do this would be to add a &amp;quot;.c&amp;quot; file with your hooks to the bootloaders/mcuboot/boot/zephyr/&lt;/p&gt;
&lt;p&gt;Here is a sample showing one possible solution.&lt;br /&gt;It may not be the best solution, as the MCUboot project is not built for our multi-image build concept, but it seems to work as expected on my end. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/blob/main/bootloader_samples/custom_image_hooks/mcuboot_patch.diff"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/blob/main/bootloader_samples/custom_image_hooks/mcuboot_patch.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This code/configuration is not thoroughly tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/thread/418798?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2023 09:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e742fe34-f91c-4a24-89fd-69aa927fcaa5</guid><dc:creator>Mustafa</dc:creator><description>&lt;p&gt;Hi Sigurd,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Actually what I meant is that I would like to have a callback on the application level for the following events:&lt;/p&gt;
&lt;p&gt;* downloading image using BLE ( DFU callback)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;* prepare an application for a reboot&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and after that Callback in the bootloader level for swapping the image and upgrading the fw.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I aim to attach a led indication by every step to inform the user about the progress steps.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;for MCU bootloader&amp;nbsp; I&amp;#39;m using the zephyr device management&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1680513831044v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Mustafa&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get DFU callback in the applicaiton</title><link>https://devzone.nordicsemi.com/thread/418789?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2023 09:04:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a09213e-4238-4ae9-9091-2258ece4025d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is a difference between a Bootloader and Device Firmware Update (DFU).&lt;/p&gt;
&lt;p&gt;The Bootloader boots and swaps images.&lt;br /&gt;DFU transfers images to the device.&lt;/p&gt;
&lt;p&gt;When you are downloading a new image over Bluetooth Low Energy, this is DFU and is handled in the application. The Bootloader is not active during this.&lt;/p&gt;
&lt;p&gt;Are you using &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/device_mgmt/index.html#device-mgmt"&gt;Zephyr Device Management&lt;/a&gt; to perform DFU?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>