<?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>Information on how to perform a FOTA update on nRF52811</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96303/information-on-how-to-perform-a-fota-update-on-nrf52811</link><description>Hello, 
 I am looking for information on how to perform a FOTA update on our nRF52811 BLE chip. I have some information in general about some of the options on nRF52* but I haven&amp;#39;t seen anything specific to the 52811. 
 We have a board with the nRF9160</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Feb 2023 10:12:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96303/information-on-how-to-perform-a-fota-update-on-nrf52811" /><item><title>RE: Information on how to perform a FOTA update on nRF52811</title><link>https://devzone.nordicsemi.com/thread/408230?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2023 10:12:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20dc5e94-a732-4d14-869b-adc29db66bd7</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have an &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples"&gt;unofficial GitHub repo&lt;/a&gt; explaining bootloader concepts for MCUboot. Have l look at that to see which options for DFU you have in the nRF Connect SDK.&lt;/p&gt;
&lt;p&gt;You want to be able to update both the nRF52 and the nRF91. &lt;br /&gt;And you want to download the updates over Bluetooth Low Energy (LE) and/or LTE.&lt;/p&gt;
&lt;p&gt;So I do two things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Suggest another solution.&lt;/li&gt;
&lt;li&gt;Discuss your solution&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ultimately, it will be up to you to decide what you want to do.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:150%;"&gt;SMP Client on the nRF9160&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I think it makes sense to have 1 of the nRF microcontrollers be a &amp;quot;DFU host&amp;quot;.&lt;br /&gt;Then the other microcontroller just receives the DFU.&lt;/p&gt;
&lt;p&gt;As the nRF9160 has an external flash, I suggest that you use the nRF9160 as the DFU host.&lt;br /&gt;In that case, the flash layout would look like the following:&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/pastedimage1675672484279v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then you can run Serial Recovery on the nRF52. &lt;br /&gt;Since the nRF52811 has limited flash space available, I think Serial Recovery is a good idea.&lt;/p&gt;
&lt;p&gt;To write the updates from the nRF91 to the nRF52, you can run an SMP Client over UART on the nRF9160.&lt;br /&gt;The downside is that you have no official SMP Client over UART. &lt;br /&gt;you also do not have an unofficial SMP Client over UART yet. &lt;br /&gt;However, I am working on one at &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/client_smp/smp_client_uart"&gt;https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/client_smp/smp_client_uart&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Next up you need to download the updates.&lt;br /&gt;Since the nRF9160 is the host, you can download images over LTE and save them to its external flash.&lt;br /&gt;I do not have a lot of experience with LTE, so I can not say exactly how, but I guess it would be similar to our &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/FOTA_AT_commands.html"&gt;Serial LTE Modem (SLM) FOTA&lt;/a&gt;.&lt;br /&gt;Headsup: I think that the SLM use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/libraries/dfu/dfu_target.html"&gt;DFU Target&lt;/a&gt; library, which reads the header of a DFU package, and applies this to the application core if MCUboot is detected. You might need to implement something to make it detect MCUboot updates for the 52.&lt;/p&gt;
&lt;p&gt;To download packages over Bluetooth Low Energy (LE), you need some way to receive packages to the nRF91 via the nRF52.&lt;br /&gt;As with the LTE download, you also need a way to differentiate the 52 and 91 updates, and this might have to be handled by the application.&lt;br /&gt;The way I see it, you have two options for nRF52-applications:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Stand-alone application:&lt;br /&gt;You need some custom way to receive updates and forward them to the nRF91.&lt;br /&gt;Could be based on a &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp/mcuboot_smp_ble"&gt;SMP Server over Bluetooth LE&lt;/a&gt;. However, this will not forward images by default.&lt;/li&gt;
&lt;li&gt;hci_uart:&lt;br /&gt;By running the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/hci_uart/README.html"&gt;hci_uart&lt;/a&gt; on the nRF52, you can use it as a Bluetooth LE Controller, while having the Bluetooth LE Host running on the nRF91.&lt;br /&gt;Headsup: When I build this sample for the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_nrf52_features.html#supported-boards"&gt;nRF52840dk_nrf52811&lt;/a&gt;, I get errors due to too little flash. You likely have to do some &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_opt.html"&gt;Memory footprint optimization&lt;/a&gt; to make it work.&lt;br /&gt;But it would be a good idea to test this memory optimization before going for this solution&lt;br /&gt;In our &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/lte_ble_gateway/README.html"&gt;LTE Sensor Gateway sample&lt;/a&gt;, the nRF9160 runs as Bluetooth LE Host.&lt;br /&gt;Then you receive the DFU Image&amp;nbsp; &amp;quot;directly&amp;quot; to the nRF91.&lt;br /&gt;The downside here is that all your other Bluetooth LE operations also will have to use the nRF91 as a Bluetooth LE Host for all other Bluetooth LE operations, I think.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To sum it up, I will list the parts that you need.&lt;br /&gt;I will split the FOTA into two parts: Download Image and Perform Update.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download Image:
&lt;ul&gt;
&lt;li&gt;Bluetooth LE, either A or B:
&lt;ul&gt;
&lt;li&gt;A: Custom transfer application on both nRF91 and nRF52&lt;/li&gt;
&lt;li&gt;B:
&lt;ul&gt;
&lt;li&gt;nRF52: Bluetooth LE Controller (Example: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/hci_uart/README.html"&gt;hci_uart&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;nRF91: Bluetooth LE Host (Example: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/lte_ble_gateway/README.html"&gt;LTE Sensor Gateway&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;LTE, download images from LTE (Example: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/FOTA_AT_commands.html"&gt;SLM&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Perform Update:
&lt;ul&gt;
&lt;li&gt;nRF91:
&lt;ul&gt;
&lt;li&gt;MCUboot: Will swap nRF91 application if Secondary is tagged with &amp;quot;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp#test-or-confirm"&gt;test&lt;/a&gt;&amp;quot;&lt;/li&gt;
&lt;li&gt;SMP Client over UART: Will update nRF52. (Example: &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/client_smp/smp_client_uart"&gt;SMP Client over UART under construction&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;nRF52:
&lt;ul&gt;
&lt;li&gt;MCUboot with Serial Recovery: Can trigger Serial Recovery on boot. (Example: &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/serial_recovery"&gt;My unofficial Serial Recovery Samples&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-size:150%;"&gt;Shared External Flash&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Depending on how you design your project, using a shared external flash as you suggest may be easier and better than my solution above.&lt;br /&gt;The main downside is that it requires changes to hardware: You need to connect the external flash to the nRF52811.&lt;br /&gt;I talked to a colleague about this, and he reported to have found that the nRF52810 has too little RAM for use with External Flash.&lt;br /&gt;&lt;strong&gt;Before you go for this solution, make sure to test the nRF52811 with an external flash, to find out if it is even possible!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The software design is easier here, as MCUboot will have two slots for both the nRF52 and the nRF91: nRF52 Primary, nRF52 Secondary, nRF91 Primary and nRF91 Secondary: &lt;br /&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/pastedimage1675676467560v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;While booting, the respective nRFs will perform a software swap at startup if the secondary slots are tagged with &amp;quot;&lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp#test-or-confirm"&gt;test&lt;/a&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;To receive a DFU image on the nRF52, you can run an &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp/mcuboot_smp_ble"&gt;SMP Server feat Bluetooth Low Energy&lt;/a&gt;.&lt;br /&gt;Headsup: When I build this sample for the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_nrf52_features.html#supported-boards"&gt;nRF52840dk_nrf52811&lt;/a&gt;, I get errors due to too little flash. You likely have to do some &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_opt.html"&gt;Memory footprint optimization&lt;/a&gt; to make it work.&lt;br /&gt;But it would be a good idea to test this memory optimization before going for this solution.&lt;br /&gt;Images received in this way will be written to nRF52 secondary slot by default. Some custom handling is likely needed to make it write to nRF91 secondary slot instead.&lt;/p&gt;
&lt;p&gt;To receive a DFU image on the nRF91, I will say the same as for the other solution:&lt;br /&gt;I do not have a lot of experience with LTE, so I can not say exactly how, but I guess it would be similar to our &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/FOTA_AT_commands.html"&gt;Serial LTE Modem (SLM) FOTA&lt;/a&gt;.&lt;br /&gt;Headsup: I think that the SLM use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.2.0/nrf/libraries/dfu/dfu_target.html"&gt;DFU Target&lt;/a&gt; library, which reads the header of a DFU package, and applies this to the application core if MCUboot is detected. You might need to implement something to make it detect MCUboot updates for the 52.&lt;/p&gt;
&lt;p&gt;The last part here would be to handle the External flash communication.&lt;br /&gt;I asked a colleague if two chips can use the same external flash, and he said:&lt;br /&gt;&amp;quot;You need to manage access to the flash, akin to flow control in UART communication as the two micros will have to share a bus where both acts as masters. Static partitions are probably needed. &amp;quot;&lt;br /&gt;In other words, it seems possible, but you have to handle external flash access.&lt;br /&gt;This would be a generic microcontroller challenge, so I am sure that you can find a lot of designs on how to do this on the internet.&lt;/p&gt;
&lt;p&gt;To sum it up, I will list the parts that you need.&lt;br /&gt;I will split the FOTA into three parts: Download Image, Perform Update and Handle External Flash&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Download Image
&lt;ul&gt;
&lt;li&gt;Bluetooth LE: SMP Server over Bluetooth LE (Example: &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp/mcuboot_smp_ble"&gt;MCUboot SMP Sample feat Bluetooth Low Energy&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;LTE, download images from LTE (Example: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/FOTA_AT_commands.html"&gt;SLM&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Perform Update
&lt;ul&gt;
&lt;li&gt;Assuming the DFU image is written to the correct secondary slot, MCUboot will handle this automatically based on &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp#test-or-confirm"&gt;tag&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Handle External Flash
&lt;ul&gt;
&lt;li&gt;You need to handle flash access somehow.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Conclusion&lt;/p&gt;
&lt;p&gt;There are no right and wrong answers here, so it is up to you.&lt;br /&gt;Both solutions require that you do some of the work.&lt;br /&gt;Here are the biggest potential downsides with the solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SMP Client on the nRF9160:
&lt;ul&gt;
&lt;li&gt;The &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/smp#test-or-confirm"&gt;SMP Client over UART&lt;/a&gt; is not finished, you might have to write some of it yourself, depending on your timetables.&lt;/li&gt;
&lt;li&gt;hci_uart for the nRF52811 limits the nRF52811 functionality&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Shared External Flash:
&lt;ul&gt;
&lt;li&gt;The nRF52811 might not have enough RAM for External Flash&lt;/li&gt;
&lt;li&gt;The nRF52811 might not have enough RAM for the SMP Server, which would limit DFU over Bluetooth LE-&lt;/li&gt;
&lt;li&gt;The External flash needs to be routed in hardware&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope this was useful.&lt;br /&gt;Let me know if you have any questions about this.&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: Information on how to perform a FOTA update on nRF52811</title><link>https://devzone.nordicsemi.com/thread/408087?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 19:22:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80521c02-53a7-4f9e-b1f4-a005cffd8e92</guid><dc:creator>keegretupmoc</dc:creator><description>&lt;p&gt;Sigurd,&lt;/p&gt;
&lt;p&gt;They are connected by a UART. &amp;nbsp;On the 9160 it is UART1 and on the 52811 it&amp;#39;s UART0 I believe. &amp;nbsp;We have this working one way so far, from 9160 to BLE sending text.&lt;/p&gt;
&lt;p&gt;As far as how we would upgrade the FW on the 52811, I am looking for any and all ways, so it could be LTE and/or Bluetooth LE. &amp;nbsp;It would probably be better if it were&amp;nbsp;Bluetooth LE as we do have an iOS app that connects to us and there will be situations where the LTE is not activated.&lt;/p&gt;
&lt;p&gt;h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Information on how to perform a FOTA update on nRF52811</title><link>https://devzone.nordicsemi.com/thread/408016?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 13:32:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88596ae6-9c4a-410e-8bb9-92a29324fda8</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which interfaces connect the nRF52811 and the nRF9160?&lt;br /&gt;How will they communicate in normal operation?&lt;/p&gt;
&lt;p&gt;When you say FOTA: you mean over LTE and not over Bluetooth LE, right?&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>