<?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>How to implement FOTA in nRF52840 based systems</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100598/how-to-implement-fota-in-nrf52840-based-systems</link><description>Hi, 
 We have a CoAP server and set of sensors based on CoAP client. I want to investigate how to implement FOTA feature for them. I looked into NRF Cloud and its documentations, but I am afraid I would need something like an example project and simplified</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Jun 2023 10:19:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100598/how-to-implement-fota-in-nrf52840-based-systems" /><item><title>RE: How to implement FOTA in nRF52840 based systems</title><link>https://devzone.nordicsemi.com/thread/432487?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2023 10:19:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a06edee3-2d3c-42f0-98bd-99bb43d12f6e</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Thank you for expanding on this.&lt;/p&gt;
[quote user="kaushalyasat"]&lt;span&gt;Secure&amp;nbsp;&lt;/span&gt;&lt;span&gt;OTA&lt;/span&gt;&lt;span&gt;&amp;nbsp;DFU Example&amp;#39;&lt;/span&gt;&amp;nbsp;here at&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.threadsdk.v0.8.0%2Fgroup__diags.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.threadsdk.v0.8.0%2Fgroup__diags.html&lt;/a&gt;. But this seems to be using SDK5 tools(?)&amp;nbsp;[/quote]
&lt;p&gt;Going back to this question: Yes, this is for nRF5 SDK. Unfortunately we don&amp;#39;t have any solutions for &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/working_with_nrf/nrf52/developing.html#fota-over-thread"&gt;DFU over Thread&lt;/a&gt;&amp;nbsp;in NCS,&amp;nbsp;but there are other options such as BLE, and Cloud&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As you mentioned, it sounds to me that DFU over BLE or a solution based on &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/nrf_cloud_rest_fota/README.html"&gt;nRF Cloud REST FOTA&lt;/a&gt;&amp;nbsp;will be the best for in your project. The BLE method will have flash restrictions due to no external flash on your devices, so we will have to fix that with optimizing your application w.r.t. flash&lt;/p&gt;
&lt;p&gt;If you haven&amp;#39;t already seen this blogpost (&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/debunking-misconceptions-a-technical-analysis-of-nrf5-sdk-and-nrf-connect-sdk"&gt;Debunking misconceptions: A technical analysis of nRF5 SDK and nRF Connect SDK&lt;/a&gt;&amp;nbsp;) where Tiago shows some concepts for how to optimize the memory footprint in NCS applications, this might be helpful with finding some pointers to where you could fetch enough flash memory to fit a secondary application slot. Other than that, the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/machine_learning/README.html#nrf-machine-learning-app"&gt;nRF Machine learning sample&lt;/a&gt;&amp;nbsp;shows how you can optimize MCUboot aswell to shrink that partition further&lt;/p&gt;
[quote user="kaushalyasat"]Once we upgrade the Hub, we may use REST API to act as a border router between NRF cloud and the devices. But I cant see a way to add a WIFI device to the NRF cloud. So this is the last nail to the coffin of solving FOTA in our system, as I see.&amp;nbsp;Please correct me where I am wrong.[/quote]
&lt;p&gt;Yes, you can add wifi-devices to nRF Cloud, even non-Nordic devices are compatible. Here is an example for how to use wifi-locationing with nRF Cloud &lt;a href="https://docs.nrfcloud.com/LocationServices/Tutorials/WiFi/#setup"&gt;https://docs.nrfcloud.com/LocationServices/Tutorials/WiFi/#setup&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Since your device does not have a nRF91 on it, it is absolutely an option to add a similar approach based on your own solution for FOTA through nRF Cloud.&lt;/p&gt;
&lt;p&gt;To summarize this as an example from a relatively similar case:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Can I use nRF Cloud with non-Nordic devices, such as ESP32?
&lt;ol&gt;
&lt;li&gt;Yes&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;If yes, can I use the FOTA service for these devices?
&lt;ol&gt;
&lt;li&gt;Yes, there is nothing Nordic-specific about the FOTA procedure.&lt;/li&gt;
&lt;li&gt;Bootloader FOTA is geared toward MCUBoot, but it should work for other.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Application FOTA is agnostic and should work for anything&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Can I host update files, such as .hex and .bin on nRF Cloud?
&lt;ol&gt;
&lt;li&gt;Also yes, but it might be nRF Cloud membership dependent (need to verify)&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;If yes, can I get these files raw data via REST API?
&lt;ol&gt;
&lt;li&gt;yes, but only by deploying an update.&lt;/li&gt;
&lt;li&gt;Once a firmware bundle is uploaded using &lt;a href="https://api.nrfcloud.com/v1/#tag/Firmware-Bundles/operation/UploadFirmware"&gt;https://api.nrfcloud.com/v1/#tag/Firmware-Bundles/operation/UploadFirmware&lt;/a&gt;&amp;nbsp;the user must create and deploy an update. then the device or user can call &lt;a href="https://api.nrfcloud.com/v1/#tag/FOTA-Job-Executions/operation/FetchCurrentPendingFOTAJobExecution"&gt;https://api.nrfcloud.com/v1/#tag/FOTA-Job-Executions/operation/FetchCurrentPendingFOTAJobExecution&lt;/a&gt; to get the job information, which will contain the link of the update file.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are also other things that needs to be fixed, such as certificates which must be added to the device, but this is what I were able to dig up regarding that solution that is nRF Cloud based for now. If the cloud based solution is what you want to go for, then it might be beneficial for you to create a new ticket going forward with how to solve that problem (and refer to this ticket) as I am mostly not too familiar with cloud based solutions, but for now lets stick to this case and map out all your needs before we continue to development&lt;/p&gt;
[quote user="kaushalyasat"]Lastly we would need much Nordic support to do this. I have tried our FAE in Australia, yet to get connected. It would be really good to have him onboard as well, if possible.[/quote]
&lt;p&gt;Regarding this, as long as you create tickets on Devzone we will be here to support you through the process and we will assign your cases to application engineers with experience on the topics you&amp;#39;re working with. This is just a heads up that we&amp;#39;re heading into the main summer vacation period here in Norway, so throughout July-early August we will be somewhat reduced in staffing so there might be some increased response time due to that&lt;/p&gt;
&lt;p&gt;Do you have the contact information to the FAE in Australia? If not I&amp;#39;ll see if I can dig that up so you can reach out to them as well&lt;/p&gt;
&lt;p&gt;Please feel free to follow up with additional questions when and if you have any more and let me know if anything is unclear regarding the links and explanations provided&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement FOTA in nRF52840 based systems</title><link>https://devzone.nordicsemi.com/thread/431386?ContentTypeID=1</link><pubDate>Fri, 16 Jun 2023 00:19:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19bbab76-4eef-4e78-8c41-78ff335f36a5</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;Hi AHaug,&lt;/p&gt;
&lt;p&gt;No worries mate, thanks for keeping me in the loop.&lt;/p&gt;
&lt;p&gt;My setup is I have multiple SED devices and one host device. The SED devices uses modified CoAP client fw while the host is a modified CoAP server.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We also have two legacy Thread devices, one of which has a wifi connection, known as the Hub. But as we have not been successful in communicating with Thread 1.0 and OpenThread side, the WIFI device cannot for the time being work as a border router for us. We would upgrade these two devices to OpenThread very soon and then WIFI+OpenThread device (the Hub) can act as a border router for the entire system. But these legacy devices has their own OTA at the moment so the only OTA requirement is for the new OpenThread devices.&lt;/p&gt;
&lt;p&gt;This system is installed in houses of the end user.&amp;nbsp;We would like the FOTA process to be transparent to the end user, as that is how it is implemented for the legacy devices now. If not we can have a BLE solution as there are no UART or USB connections to the SED devices. I am yet to go in detail through the solution you suggested as I was also busy with something else. I will study that approach and come back to clear my questions.&lt;/p&gt;
&lt;p&gt;I have tried to build OpenThread+BLE and unfortunately the Flash footprint is more than 50% for the nRF52840. I done have an external Flash, so this solution is out I think. I have tried to add my phone to NRF cloud and pair the device to be OTAed to my phone. But was not successful downloading a new FW, may be due to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. the total available flash in the SED device is &amp;lt; 50%&lt;/p&gt;
&lt;p&gt;2. the SED device flash is not properly partitioned. I could only find a document for SDK5 I think on how to partition the flash, so I&amp;nbsp;need help here as well.&lt;/p&gt;
&lt;p&gt;3. Creation of release FW package may be faulty.&amp;nbsp; I followed &amp;#39;&lt;a href="https://api.nrfcloud.com/v1/#tag/Firmware-Bundles/operation/UploadFirmware&amp;#39;"&gt;api.nrfcloud.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think even if I dont have 50% empty flash, if we can implement 3 partitions like following, we should be able to implement a FOTA based on BLE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; 1. a 33% partition for the actual application+OpenThread stack&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; 2. a 20% partition for BLE&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; 3. remaining 47% for FOTA just for the first partition. No upgrade for the second BLE partition.&lt;/p&gt;
&lt;p&gt;Once we upgrade the Hub, we may use REST API to act as a border router between NRF cloud and the devices. But I cant see a way to add a WIFI device to the NRF cloud. So this is the last nail to the coffin of solving FOTA in our system, as I see.&amp;nbsp;Please correct me where I am wrong.&lt;/p&gt;
&lt;p&gt;Lastly we would need much Nordic support to do this. I have tried our FAE in Australia, yet to get connected. It would be really good to have him onboard as well, if possible.&lt;/p&gt;
&lt;p&gt;Thanks heaps,&lt;/p&gt;
&lt;p&gt;Kaushalya&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement FOTA in nRF52840 based systems</title><link>https://devzone.nordicsemi.com/thread/431334?ContentTypeID=1</link><pubDate>Thu, 15 Jun 2023 14:39:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bae2532f-5c9b-4da7-acc2-fa089dce6a26</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Apologies for the longer response time than usual, it&amp;#39;s been a busy week for me. I will do my best to prioritize you more in the coming week.&lt;/p&gt;
&lt;p&gt;It might be that I have misunderstood what you want to FOTA, could you explain some more about your setup?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Where does the Thread+BLE come in?&lt;/p&gt;
&lt;p&gt;When you say &amp;quot;52840 solo system&amp;quot;, where will you be getting the new firmware from? If it is either over UART, USB or BLE, then it is no problem implementing a solution that does not need the use of cloud, and for that I recommend once again the link to the gitrepo in my initial reply&lt;/p&gt;
&lt;p&gt;But if the case is that your devices is out in the field, far away from any users/owners of the firmware, then I understand the need for cloud.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement FOTA in nRF52840 based systems</title><link>https://devzone.nordicsemi.com/thread/430591?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 00:43:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0a9a594-ca44-4a26-bde6-30d9ac3dc1c1</guid><dc:creator>kaushalyasat</dc:creator><description>&lt;p&gt;Hi AHaug,&lt;/p&gt;
&lt;p&gt;Thanks. I have tried enabling multiprotocol in my app with Thread + BLE. But unfortunately to total image is about 52% of nRF52840. So I think, unless I do a hardware mod to have an additional Flash, this solution is not going to work for me.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To support the current hardware platform, which only uses a 33% Flash, I am looking into ways to talk to an OpenThread Boarder Router and do an update. I see the &amp;#39;&lt;span&gt;Thread Secure&amp;nbsp;&lt;/span&gt;&lt;span&gt;OTA&lt;/span&gt;&lt;span&gt;&amp;nbsp;DFU Example&amp;#39;&lt;/span&gt;&amp;nbsp;here at&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.threadsdk.v0.8.0%2Fgroup__diags.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.threadsdk.v0.8.0%2Fgroup__diags.html&lt;/a&gt;. But this seems to be using SDK5 tools(?)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there a way for me to implement this approach in a 52840 solo system?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Kaushalya&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement FOTA in nRF52840 based systems</title><link>https://devzone.nordicsemi.com/thread/430113?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 06:41:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69067ce9-f563-4e0d-a503-fcfb7e5613c7</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
[quote user="AHaug"]Currently we don&amp;#39;t have any out of the box solutions for this, so you will have to be looking at proprietary solutions for this. But in general this should be possible. The challenge comes with creating the procedure that distributes the firmware form the cellular/wifi-capable devices to the short range devices. I will see if I can find anything documented and/or any showcases for how to do this and I will get back to you if I find something early next week.&amp;nbsp;[/quote]
&lt;p&gt;This samples is the closest I could find:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/nrf_cloud_rest_fota/README.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/nrf_cloud_rest_fota/README.html&lt;/a&gt;. This sample showcases how to update a nRF91 device through nRFCloud.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You may use this as a base in your application, but it does however expect a nRF9160 device to work. You can modify the part where the firmware expects to update the nRF91 and change it to store it instead and to add functionality to initiate FOTA for the shortrange device&lt;/p&gt;
&lt;p&gt;It may look something like this: nRF Cloud -&amp;gt; Cellular to nRF9160 -&amp;gt; BLE/UART to nRF52&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to implement FOTA in nRF52840 based systems</title><link>https://devzone.nordicsemi.com/thread/430066?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2023 18:30:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d26b948-cc60-4b74-a6dd-eec896a3f573</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]We have a CoAP server and set of sensors based on CoAP client. I want to investigate how to implement FOTA feature for them. I looked into NRF Cloud and its documentations, but I am afraid I would need something like an example project and simplified how to document, as I have not done anything like it. Can someone shed some light to this?[/quote]
&lt;p&gt;Currently we don&amp;#39;t have any out of the box solutions for this, so you will have to be looking at proprietary solutions for this. But in general this should be possible. The challenge comes with creating the procedure that distributes the firmware form the cellular/wifi-capable devices to the short range devices. I will see if I can find anything documented and/or any showcases for how to do this and I will get back to you if I find something early next week.&amp;nbsp;&lt;/p&gt;
[quote user=""]Another possibility is to have both Thread and BLE stacks enabled, in case the wireless stacks + application FW takes less than 50% of Flash space of nRF52840. Then I can use a smart phone as a gateway to download FW to devices connected to the smart phone. Am I correct?[/quote]
&lt;p&gt;Yes, you are correct. And if your application + communication stacks takes up more than 50% of the Flash on the nRF52840, it is also an option to add an external NOR Flash to the product and have the secondary application slot (used for storing the new firmware image) on the external flash. Let me know if you want to know more about how to do the external flash solution and I&amp;#39;ll get back to you&lt;/p&gt;
[quote user=""]What would be the easiest way to get into NRF Cloud and FOTA for a newcomer?[/quote]
&lt;p&gt;You&amp;#39;ve probably seen the&amp;nbsp;&lt;a href="https://docs.nrfcloud.com/GettingStarted/"&gt;getting started on nRF Cloud&lt;/a&gt;&amp;nbsp;pages, but in case you haven&amp;#39;t I recommend you to have a look at this.&lt;/p&gt;
&lt;p&gt;Regarding FOTA, I typically recommend this github repository created by a colleague of mine:&amp;nbsp;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples&lt;/a&gt;. For beginners I recommend having a look here first before you move on to the second link (posted later in this section) due to the overview it gives before going on to the nitty gritties of how it works in NCS&lt;/p&gt;
&lt;p&gt;Here you will find some theory with links to our official documentation combined with minimal samples illustrating how to perform firmware updates over various means. Do however note that all of these samples are for short ranged devices (nRF52-, and nRF53-family devices), so there are no samples for cellular/wifi firmware update in that repo.&lt;/p&gt;
&lt;p&gt;After having a look that more hands on repository, I would recommend you to have a look at&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/bootloaders_and_dfu/index.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/bootloaders_and_dfu/index.html&lt;/a&gt;, which is a more detailed walkthrough of how to perform FOTA.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Let me know if this answers your questions for now, and feel free to ask follow up questions regarding this topic. I will as mentioned have a look at if I find anything regarding your first question, but it might take some time before I can get back to you.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>