<?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>An OTA process on nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70739/an-ota-process-on-nrf52840</link><description>Hello Team, 
 I am new to the OTA process for nRF52840. Please help me with the below query. 
 1) Is it possible to perform the OTA over BLE and over thread network as well? 
 2) I have a setup like a border router(with NCP connected), two other end devices</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Jan 2021 15:01:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70739/an-ota-process-on-nrf52840" /><item><title>RE: An OTA process on nRF52840</title><link>https://devzone.nordicsemi.com/thread/291562?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 15:01:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0ae75c9-c867-44d6-b425-8c4b138d0c25</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Hardik Prajapati"]I have checked the document for OTA update from the below link, the total application area is 972KB only, so what if the current application acquires most of the area and the new firmware app is big in size so no room to fit in the app area. So in this case, a single bank concept will be used where it removes the existing app area in flash and copies the new firmware, right? And this all will be done by the DFU module which is incorporated already in the app running in the background, correct?[/quote]
&lt;p&gt;The application is running from flash. You cannot erase the currently running application to make room for a new application. The Thread stack needs to be available to maintain communication with the thread network, and receive the new firmware. Single-bank updates is possible in BLE applications, as the softdevice is a separate hex-file, which allows the bootloader to initialize and maintain the BLE connection used to receive the new firmware. There is no similar interface for OpenThread that allows you to separate the stack from the application. Including Thread support into the bootloader would require too much space to be feasible. The Thread DFU client functionality needs to be incorporated into your application to support DFU updates. The bootloader is also required to activate the new firmware.&lt;/p&gt;
[quote user="Hardik Prajapati"]&lt;p&gt;Also, please verify what I have understood from the nordic&amp;#39;s documents and from your comments:&lt;/p&gt;
&lt;p&gt;1) The DFU module which is running concurrently with an application will download the new firmware in the flash memory(whether using a single bank or dual bank concept).&lt;/p&gt;
&lt;p&gt;2) Once it is downloaded, the DFU module will update the bootloader settings that the new firmware is arrived and copied to the location.&lt;/p&gt;
&lt;p&gt;3) On the next reset cycle, the bootloader will read the settings first and get to know that the new FW is there.&lt;/p&gt;
&lt;p&gt;4) It will read and verify the init packet from the new package, once it is validated, it will boot from the new app.&lt;/p&gt;[/quote]
&lt;p&gt;Your understanding is correct, apart from the part about single-bank.&lt;/p&gt;
[quote user="Hardik Prajapati"]i) What if the validation failed, it will not be able to recover the old app (in single bank concept). I think then the bootloader will be in DFU mode only where it will expect the correct firmware.[/quote]
&lt;p&gt;Like I said above, single-bank is not possible.&lt;/p&gt;
[quote user="Hardik Prajapati"]ii) The DFU module will download the package and store the package, not the bootloader, right?[/quote]
&lt;p&gt;Correct, the Thread DFU Client libraries are incoporated into your application and allows the download to happen in the background while your application handels other tasks. The bootloader is only used to activate the new image.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An OTA process on nRF52840</title><link>https://devzone.nordicsemi.com/thread/291418?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 06:35:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32ec096a-2fba-4ea8-a6b2-087d8d962e15</guid><dc:creator>Hardik Prajapati</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
&lt;p&gt;Thanks for the details, it clears many confusions. I wonder about the application size, please clarify that as well.&lt;/p&gt;
&lt;p&gt;I have checked the document for OTA update from the below link, the total application area is 972KB only, so what if the current application acquires most of the area and the new firmware app is big in size so no room to fit in the app area. So in this case, a single bank concept will be used where it removes the existing app area in flash and copies the new firmware, right? And this all will be done by the DFU module which is incorporated already in the app running in the background, correct?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fthread_ot_secure_dfu.html&amp;amp;cp=7_3_2_8_2&amp;amp;anchor=thread_ot_secure_dfu_memory"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fthread_ot_secure_dfu.html&amp;amp;cp=7_3_2_8_2&amp;amp;anchor=thread_ot_secure_dfu_memory&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also, please verify what I have understood from the nordic&amp;#39;s documents and from your comments:&lt;/p&gt;
&lt;p&gt;1) The DFU module which is running concurrently with an application will download the new firmware in the flash memory(whether using a single bank or dual bank concept).&lt;/p&gt;
&lt;p&gt;2) Once it is downloaded, the DFU module will update the bootloader settings that the new firmware is arrived and copied to the location.&lt;/p&gt;
&lt;p&gt;3) On the next reset cycle, the bootloader will read the settings first and get to know that the new FW is there.&lt;/p&gt;
&lt;p&gt;4) It will read and verify the init packet from the new package, once it is validated, it will boot from the new app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Based on this process, I have a few more questions:&lt;/p&gt;
&lt;p&gt;i) What if the validation failed, it will not be able to recover the old app (in single bank concept). I think then the bootloader will be in DFU mode only where it will expect the correct firmware.&lt;/p&gt;
&lt;p&gt;ii) The DFU module will download the package and store the package, not the bootloader, right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance,&lt;/p&gt;
&lt;p&gt;Hardik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An OTA process on nRF52840</title><link>https://devzone.nordicsemi.com/thread/291337?ContentTypeID=1</link><pubDate>Tue, 26 Jan 2021 15:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66ba8208-a2bd-460d-89d4-2753878b8bf6</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Hardik Prajapati"]1) You have mentioned that the current solution does not allow to transfer of the DFU packets over the NCP device, what is the reason? The DFU package needs to be transferred once in a while, so is it possible to stop some NCP&amp;#39;s services, send packets and restart them again?[/quote]
&lt;p&gt;Bot wpantund (used for border router functionality) and nrfutil (used for DFU features) communicate with the NCP device using Spinel protocol over the serial interface. There is no support in either of these implementation for sharing the serial interface between DFU and border router functionality. If you stop wpantund, you can perform the DFU before restarting wpantund. Note that the DFU process uses CoAP packets, so it is possible to create your own solution in the border router that sends CoAP packets directly to the Thread devices through the NCP, using IPv6 packets. See for instance &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/40971/how-to-perform-dfu-using-existing-californium-coap-server-instead-of-ncp/228252#228252"&gt;this post&lt;/a&gt;.&lt;/p&gt;
[quote user="Hardik Prajapati"]2) Once my client device will download the OTA package while the app is running in parallel, then where it will store basically? What if there is no app space available?[/quote]
&lt;p&gt;Thread DFU requires dual-bank DFU, meaning that the application will be stored in a second slot in flash. This reduces the maximum space available for the application, as the maximum updatable application size will be&amp;nbsp; flash_size - bootloader_size - current_app_size. The size of the application will be sent in a special init-packet, which allows the device to determine if it has enough available flash before receiving the entire image.&lt;/p&gt;
[quote user="Hardik Prajapati"]3) Once the OTA package is downloaded and stored somewhere then how it will enter in DFU mode in bootloader runtime? I checked that there are 4 options to enter in DFU mode, which one it will use?[/quote]
&lt;p&gt;The application will not enter the bootloader in DFU mode. Once the transfer is completed, the application will store the settings of the new image to the bootloader setting page. On the next reset, the bootlaoder will detect a new image in the second slot, and copy this to the first slot, before booting the new application. The bootloader will always run first when the device boots, and start the application when no new updates are available.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An OTA process on nRF52840</title><link>https://devzone.nordicsemi.com/thread/291012?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 11:53:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:742b724e-4e4f-4935-9b86-2dfacaca8fc8</guid><dc:creator>Hardik Prajapati</dc:creator><description>&lt;p&gt;Hi Jorden,&lt;/p&gt;
&lt;p&gt;Thanks for the prompt response.&lt;/p&gt;
&lt;p&gt;I am more focused on the OTA process over the thread network. I understood that it is possible to upgrade all the end devices/routers at once using the multicast option. I have a couple of queries, please help me with that:&lt;/p&gt;
&lt;p&gt;1) You have mentioned that the current solution does not allow to transfer of the DFU packets over the NCP device, what is the reason? The DFU package needs to be transferred once in a while, so is it possible to stop some NCP&amp;#39;s services, send packets and restart them again?&lt;/p&gt;
&lt;p&gt;2) Once my client device will download the OTA package while the app is running in parallel, then where it will store basically? What if there is no app space available?&lt;/p&gt;
&lt;p&gt;3) Once the OTA package is downloaded and stored somewhere then how it will enter in DFU mode in bootloader runtime? I checked that there are 4 options to enter in DFU mode, which one it will use?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Hardik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: An OTA process on nRF52840</title><link>https://devzone.nordicsemi.com/thread/290453?ContentTypeID=1</link><pubDate>Thu, 21 Jan 2021 10:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:770b5502-fc3e-41bc-bad4-5deda3e3250f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Yes, we support DFU over BLE with our&amp;nbsp;&lt;a title="BLE Secure DFU Bootloader" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/ble_sdk_app_dfu_bootloader.html?cp=7_1_4_4_0"&gt;BLE Secure DFU Bootloader&lt;/a&gt;, and DFU over Thread with our&amp;nbsp;&lt;a title="Thread Secure DFU protocol" href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/thread_ot_secure_dfu.html?cp=7_3_2_8"&gt;Thread Secure DFU protocol&lt;/a&gt;&amp;nbsp;solutions. It is theoretically possible to support DFU over both BLE and Thread protocols using&amp;nbsp;&lt;a title="Multiprotocol support with BLE/Bluetooth" href="https://infocenter.nordicsemi.com/topic/sdk_tz_v4.1.0/ble_154_multiprotocol.html?cp=7_3_4_0"&gt;Multiprotocol support&lt;/a&gt;, but we do not provide any examples or bootloaders with support for this.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Yes, the Thread Secure DFU protocol allows you to update the end devices/routers over the Thread protocol. The solutions supports background DFU with multicast option, allowing you to update many devices at once, and allow the devices to continue to operate while receiving the update. Note that the current solution does not allow the DFU packets to be transferred over the NCP used in border router configuration simultaneously. Thread DFU can be done over a second NCP device, together with the nrfutil command line tool. If you have two NCP device connected to the border router, you should be able to operate both DFU and border router features concurrently.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>