<?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>DFU over cellular internet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63399/dfu-over-cellular-internet</link><description>Hi, 
 This is actually a followup ticket based on this: https://devzone.nordicsemi.com/f/nordic-q-a/56228/fota-dfu-over-internet . 
 Now the situation is a bit more concrete (or at least how I imagine the situation): 
 
 I am using a cellular modem. This</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Aug 2020 09:32:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63399/dfu-over-cellular-internet" /><item><title>RE: DFU over cellular internet</title><link>https://devzone.nordicsemi.com/thread/264204?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2020 09:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:816c64cf-261a-449c-b565-824086284715</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I assume that your 3rd party AT command device is a passive device, meaning you will not be able to push UART packets from that one to the nRF, but that the nRF has to request it via AT commands, correct?&lt;/p&gt;
&lt;p&gt;If so, as I see it you have two options:&lt;/p&gt;
&lt;p&gt;1: Download the application in the background, just like it is done in the bootloader. Then enter the bootloader, and skip the whole transportation part, and move straight to the execution of the image.&lt;/p&gt;
&lt;p&gt;2: Modify the bootloader to ask for packets via AT commands instead of waiting for them to come by themselves.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Whatever way you want to go, I suggest that you study the&amp;nbsp; secure bootloader (uart) example. Preferably by using the pca10056_uart_debug example, enable logging, and see whats going on in a normal use case when you just use nrfutil. Look at what functions that are being called to store the data from the UART, and what functions that are used to execute the image when either the init packet or the application image is done. Also study the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/lib_dfu_transport_serial.html" rel="noopener noreferrer" target="_blank"&gt;message flow chart&lt;/a&gt;..&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you choose to transfer the data in the background of your application using alternative 1, I believe you would want to call nrf_dfu_validation_init_cmd_execute() (as used in nrf_dfu_req_handler,c) more or less immediately.&lt;/p&gt;
&lt;p&gt;Remember that you need to tell the bootloader when this is supposed to happen and not from the application. Please check how you can use the GPREGRET register from dfu_enter_check() in nrf_bootloader.c -&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    if (NRF_BL_DFU_ENTER_METHOD_GPREGRET &amp;amp;&amp;amp;
       (nrf_power_gpregret_get() &amp;amp; BOOTLOADER_DFU_START))
    {
        NRF_LOG_DEBUG(&amp;quot;DFU mode requested via GPREGRET.&amp;quot;);
        return true;
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Q1: Yes. It would make sense to look at the UART version of the secure bootloader.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q2: Are you using the same physical UART (I believe so). If so, you just need to filter out what UART messages that are intended for DFU and which ones that are not, then save only the application images to flash.&lt;/p&gt;
&lt;p&gt;Q3:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="TimA"]And to be clear, when we say &amp;quot;image&amp;quot;, we mean the DFU package created using &lt;strong&gt;nrfutil&lt;/strong&gt;, yes?[/quote]
&lt;p&gt;&amp;nbsp;Yes.&lt;/p&gt;
&lt;p&gt;Do you know the concept of dual bank vs single bank?&lt;/p&gt;
&lt;p&gt;Basically, you need some way of knowing where (what address) you want to put your new application. And the bootloader needs to be aware of this as well. The nrf_dfu_validation_init_cmd_execute() only takes a start_address and a firmware_size. If your bootloader uses dual bank, this means that it will set the start address = the start address of the second bank, but in your case, you just need to call it with the start address and size of your application image.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over cellular internet</title><link>https://devzone.nordicsemi.com/thread/264053?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 12:41:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4215d24-d618-4a2a-bf2d-36b56dc34dde</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;Fair enough. I&amp;#39;m having trouble deciding where to start (there&amp;#39;s quite a number of ways to go around this).&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s what I&amp;#39;ve gathered so far:&amp;nbsp;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I will be transferring the image from the modem to the nrf52840 mcu via UART (within the application context). Would it then make sense to look at the UART version of the secure bootloader to get inspiration on how the image transfer is made via UART?&lt;/li&gt;
&lt;li&gt;In my application project, I need to include the DFU library, and initialize my chosen transport mechanism (UART). Would this potentially create a&amp;nbsp; conflict since the UART instance is already being used by the modem? - If this is a problem, I&amp;#39;m thinking one way around it is to move the whole DFU process to the bootloader (the application gets a notification that an update is available, restarts in DFU mode, and the bootloader initializes the transport + modem, transfer the image, validate and activate).&lt;/li&gt;
&lt;li&gt;I&amp;#39;m a little fuzzy about the concept of putting an image in bank 1. How does one go about that from an application context? Any examples that show this? And to be clear, when we say &amp;quot;image&amp;quot;, we mean the DFU package created using &lt;strong&gt;nrfutil&lt;/strong&gt;, yes?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over cellular internet</title><link>https://devzone.nordicsemi.com/thread/263953?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2020 08:17:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89ca8d94-c66a-487a-947a-b2d93d99a83c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;It is experimental, and the IoT section was deprecated in the latest SDK (SDK17.0.0). It may work, but I am not familiar with it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over cellular internet</title><link>https://devzone.nordicsemi.com/thread/263908?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2020 18:30:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00612271-5ab7-473d-ad91-3241fc02a40f</guid><dc:creator>Tim Adu</dc:creator><description>&lt;p&gt;I recently bumped into &amp;quot;&lt;span&gt;Bootloader for background DFU&lt;/span&gt;&amp;quot; in the experimental IoT libraries section. Could this also be used, and since it&amp;#39;s experimental, how reliable is it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over cellular internet</title><link>https://devzone.nordicsemi.com/thread/258660?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 15:28:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18241070-147f-4851-bf5e-32785abbf77a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;1. It is possible, but it requires that you have space for the current application and the new application at the same time in your flash. If you intend to do a softdevice update as well, which typically requires a new bootloader update, you need to fit 2xBL + 2xSD + 2xAPP in flash.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. Yes, but it requires you to do some changes to the bootloader. You need to find what function is called when the transfer of the image in the bootloader is normally done, and call that directly when you enter bootloader mode (if there is a new image present). Essentially you will skip the transfer part in the bootloader, because it is already done from the application.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3. not necessarily. You transfer the image in the chunk size that you want to. You need to use your UART handler to stored the received chunks in the flash. It doesn&amp;#39;t really matter what UART buffer size you use. You can transfer 8 bytes at the time if you want to, or you can transfer 512 bytes at the time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU over cellular internet</title><link>https://devzone.nordicsemi.com/thread/258654?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 15:18:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dad428d-e7c9-42b9-b000-4f97e09f1694</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;NB: We are really short staffed due to Summer Holidays in Norway. You must expect some extra delay in technical questions these days, I am afraid. I am sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;I will get back to you as soon as I can, hopefully tomorrow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>