<?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>Saving a fota progress is in case the device resets mid-process,</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96017/saving-a-fota-progress-is-in-case-the-device-resets-mid-process</link><description>Hi 
 I am working on FOTA on the nrf9160dk board with ncs2.2.0 and started with the application_update example then I also tried it on the AT2 app. I tested some cases and noticed that a fota process can continue downloading after lte connection break</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Jan 2023 17:13:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96017/saving-a-fota-progress-is-in-case-the-device-resets-mid-process" /><item><title>RE: Saving a fota progress is in case the device resets mid-process,</title><link>https://devzone.nordicsemi.com/thread/407174?ContentTypeID=1</link><pubDate>Mon, 30 Jan 2023 17:13:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb34beaa-4279-4029-91b2-590ca1bd66af</guid><dc:creator>brandon_ask_questions</dc:creator><description>&lt;p&gt;I just came accross this Kconfig option.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Go check out.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/kconfig/CONFIG_DFU_TARGET_STREAM_SAVE_PROGRESS.html#std-kconfig-CONFIG_DFU_TARGET_STREAM_SAVE_PROGRESS"&gt;developer.nordicsemi.com/.../CONFIG_DFU_TARGET_STREAM_SAVE_PROGRESS.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving a fota progress is in case the device resets mid-process,</title><link>https://devzone.nordicsemi.com/thread/406505?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 15:14:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce9182ab-9979-4e1d-a052-e22400918f0c</guid><dc:creator>brandon_ask_questions</dc:creator><description>[quote userid="117272" url="~/f/nordic-q-a/96017/saving-a-fota-progress-is-in-case-the-device-resets-mid-process/406457"]&lt;p&gt;Please correct me if I am wrong. It seems fota_lib provides an interface to start a download at an offset. here please have a look at.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/fota_download/src/fota_download.c#L153"&gt;In fota_download.c. &lt;/a&gt;After initializing dfu_target_init, checking if there is an offset or not. So if there is an offset, the app aborts&lt;span&gt;&amp;nbsp;the download requests and&amp;nbsp;&lt;/span&gt;&lt;span&gt;schedules a new download from the offset.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="quote-header"&gt;&lt;/div&gt;&lt;blockquote class="quote"&gt;&lt;div class="quote-user"&gt;&lt;/div&gt;&lt;/blockquote&gt;[/quote]
&lt;p&gt;Yes I think you are correct actually but that offset&amp;nbsp;logic is only if the&amp;nbsp;download stops and then is restarted during the same session (e.g. no reboot occurs). E.g.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/fota_download/src/fota_download.c#L448"&gt;fota_download_init&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/fota_download/src/fota_download.c#L299"&gt;fota_download_start&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;* You download some chunks *&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/fota_download/src/fota_download.c#L486"&gt;fota_download_cancel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/fota_download/src/fota_download.c#L299"&gt;fota_download_start&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The way the fota_lib uses the dfu_target stuff makes it really hard to do what you are trying. It relies on metadata from the current session to know where to flash the downloaded chunk.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving a fota progress is in case the device resets mid-process,</title><link>https://devzone.nordicsemi.com/thread/406457?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 12:45:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b227174-6053-4b83-95dc-343a6cc5f83e</guid><dc:creator>zsn</dc:creator><description>[quote userid="122792" url="~/f/nordic-q-a/96017/saving-a-fota-progress-is-in-case-the-device-resets-mid-process/406365"]The fota_download library does not provide an interface to start a download at a offset.[/quote]
&lt;p&gt;I am not sure about this. I think there is an inconsistency between your comment and the app&amp;#39;s behaviour. Please correct me if I am wrong. It seems fota_lib provides an interface to start a download at an offset. here please have a look at.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/net/lib/fota_download/src/fota_download.c#L153"&gt;In fota_download.c. &lt;/a&gt;After initializing dfu_target_init, checking if there is an offset or not. So if there is an offset, the app aborts&lt;span&gt;&amp;nbsp;the download requests and&amp;nbsp;&lt;/span&gt;&lt;span&gt;schedules a new download from the offset.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="122792" url="~/f/nordic-q-a/96017/saving-a-fota-progress-is-in-case-the-device-resets-mid-process/406365"]You could use the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/include/net/download_client.h#L228"&gt;download_client library for&lt;/a&gt; this purpose, but you would need to handle writing the chunks to flash.[/quote]
&lt;p&gt;&lt;span&gt;Thanks for this point. I need to look at this how I can use and implement this into my app.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote userid="122792" url="~/f/nordic-q-a/96017/saving-a-fota-progress-is-in-case-the-device-resets-mid-process/406365"] this is in RAM and is lost on reset.&amp;nbsp;[/quote]
&lt;p&gt;yes, I agree, I think this may reason why the device cannot continue downloading process from an offset val after rebooting.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was thinking&amp;nbsp;if I can find a way to store all these data which are necessary to continue from an offset into flash memory. Then after booting up, I can bring all these data for dfu_target_offset_get.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Saving a fota progress is in case the device resets mid-process,</title><link>https://devzone.nordicsemi.com/thread/406365?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 01:34:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b8e42e9-f491-441c-abfb-d9e4528de66f</guid><dc:creator>brandon_ask_questions</dc:creator><description>&lt;p&gt;The fota_download library does not provide an interface to start a download at a offset. You could use the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/include/net/download_client.h#L228"&gt;download_client library for&lt;/a&gt; this purpose, but you would need to handle writing the chunks to flash.&lt;br /&gt;&lt;br /&gt;The &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/include/dfu/dfu_target.h#L110"&gt;dfu_target_offset_get &lt;/a&gt;returns the value from the &lt;a href="https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/storage/stream_flash.h#L96"&gt;current flash stream context&lt;/a&gt;, this is in RAM and is lost on reset.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>