<?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>Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/113021/extremely-slow-and-unstable-fota-on-nrf5340-based-device-after-code-update-in-app</link><description>Hi, 
 I am developing a nrf5340 based device (no external memory) using FOTA to update the firmware. This process used to work quite well for a while now, but I ran into trouble recently, because to my surprise the update over the air does not work anymore</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Jul 2024 08:56:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/113021/extremely-slow-and-unstable-fota-on-nrf5340-based-device-after-code-update-in-app" /><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/496153?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2024 08:56:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ee2c120-ca4b-42b2-bd16-0c19644fa35d</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s good to hear that you found the root cause of the issue.&lt;/p&gt;
[quote user="nfbe"]Including usleep-calls, however, (slightly) slows down the operation of my application not only during FOTA, but always. Is there any way for&amp;nbsp;my application to detect that a FOTA process is active? Or the other way arround: is it possible to enable or disable FOTA-ability of my device at runtime of my application?[/quote]
&lt;p&gt;I am not completely sure about this approach as I have not tested it before, but you might consider monitoring the characteristics of the SMP service. Implement handlers to monitor SMP commands related to DFU. You can check for specific image management commands to set and clear the DFU flag. Then use the DFU flag in your main application loop to adjust behavior based on DFU status.&lt;/p&gt;
&lt;p&gt;You could also try using&lt;a href="https://docs.zephyrproject.org/latest/kernel/services/threads/index.html#c.k_msleep"&gt; &lt;code&gt;k_msleep&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://docs.zephyrproject.org/latest/kernel/services/threads/index.html#c.k_busy_wait"&gt;k_busy_wait&lt;/a&gt;&amp;nbsp;instead of &lt;code&gt;usleep&lt;/code&gt;. Let me know if that makes any difference in the performance.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/495871?ContentTypeID=1</link><pubDate>Sat, 27 Jul 2024 07:04:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50518c59-5c32-4038-9df3-cab9d9c15501</guid><dc:creator>nfbe</dc:creator><description>&lt;p&gt;Dear Abhijith,&lt;/p&gt;
&lt;p&gt;I finally found the reason for the difference in the FOTA behavior: It is a problem with thread handling. In my latest version I reduced/removed waiting times (usleep - calls) in my application. I found, that I can reproducibly &amp;quot;enable&amp;quot; stable FOTA by including sufficient calls to usleep and &amp;quot;disable&amp;quot; FOTA stability by removing them. It looks like my application has been &amp;quot;too dominant&amp;quot;.&lt;/p&gt;
&lt;p&gt;Including usleep-calls, however, (slightly) slows down the operation of my application not only during FOTA, but always. Is there any way for&amp;nbsp;my application to detect that a FOTA process is active? Or the other way arround: is it possible to enable or disable FOTA-ability of my device at runtime of my application?&lt;/p&gt;
&lt;p&gt;Thanks a lot for your advice.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/495700?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2024 19:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab333ef5-5278-4c27-8192-b11d622faac7</guid><dc:creator>nfbe</dc:creator><description>&lt;p&gt;Dear Abhijith,&lt;/p&gt;
&lt;p&gt;I checked again my configs and found the only difference in the versions to be the use of the FPU (deliberately set: CONFIG_FPU=y... with CONFIG generated because of that), which I had not considered to be of any influence on the FOTA operation and therefore not mentioned. This I switched off for my new version and with this reached an exactly equal configuration to the older version in which FOTA still works fine.&lt;br /&gt;=&amp;gt; Having the exact same config settings did not have any positive influence whatsoever&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I increased my CONFIG_MAIN_STACK_SIZE, because I saw, that the mcuboot configuration has a larger stack setting, than my old application. &lt;br /&gt;=&amp;gt; Unfortunately this did not change the behavior either - FOTA still does not work at all with the new version.&lt;br /&gt;&lt;br /&gt;Deceasing the RAM usage of my application does not seem to have any influence on the FOTA process.&lt;br /&gt;=&amp;gt; It still does not work.&lt;br /&gt;&lt;br /&gt;I still do not understand, how the FOTA-process cannot work at exactly the same configuration parameters - is that not the only influence I have as the programmer of the application using the boot loader provided as well as the network MCU provided as is just via configuration? Which &amp;quot;behavior&amp;quot; of my application e.g. on memory usage or use of the bluetooth interface may influence the FOTA behavior on the nRF5340?&lt;br /&gt;&lt;br /&gt;I am still puzzled by this - any enlightening thoughts on solving this mystery highly welcome.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/495300?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2024 19:40:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a4ff793-d4e0-4ebf-a877-65bf18a55264</guid><dc:creator>nfbe</dc:creator><description>&lt;p&gt;Dear Abhijith,&lt;/p&gt;
&lt;p&gt;I just tried it with the nrF Device Manager App - and the behavior is just the same. As long as my previous version of my firmware is on my nRF5340 is running, I can reproducibly do a FOTA update either with a just minutely changed previous version or with my new version... but if my new version is running, FOTA is not stable anymore - no matter, which version I try to upgrade to from there.&lt;/p&gt;
&lt;p&gt;Yesterday I also updated the iOSMCUManager Library to version from 1.6.0 to 1.7.0 in my own iPhone App, but I do not see any different behavior - other than a slightly different way I need to implement&amp;nbsp;upgrade process due to changes in the API, nothing in the behavior changed.&lt;/p&gt;
&lt;p&gt;As I stated before, from the flash size and file&amp;nbsp;size of the two versions there is only a very small difference. The newer version of my firmware, however, is using larger buffers and therefore needs significantly more RAM space (143kB instead of 106kB from what the build process tells me). Could this be the cause of the difference in the FOTA process - not enough RAM left for FOTA? How much free RAM space is required to do this FOTA update? Does the process try to store the entire image in RAM at any time?&lt;br /&gt;&lt;br /&gt;Any further hints are very much appreciated.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/495165?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2024 09:29:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:171e97b5-8f27-4698-b435-3c84eb2b7a18</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="nfbe"]&lt;p&gt;The main problem remains though: Why is the speed and stability of FOTA changing very significantly (from 3.6kb/s stable transmission to something completely unstable, lasting an hour for 200kb or longer, breaking down every now and then...) for just slightly modified code of the app-core with no obvious relation to&amp;nbsp;FOTA and using the exact same config parameters in both cases?&lt;/p&gt;
&lt;p&gt;I need to get this stable again soon! And I need to understand, why this gets unstable showing a speed of close to 0b/s in order to avoid this situation for future code and config.&lt;/p&gt;[/quote]
&lt;p&gt;That should not be happening, and it is a bit strange. Is this issue occurring only with the nRF Connect iOS app? Have you tried the&lt;a href="https://apps.apple.com/us/app/nrf-connect-device-manager/id1519423539"&gt; nRF Device Manager app&lt;/a&gt;? If so, does it exhibit the same behavior?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/494658?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2024 19:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7df97aa-8b26-401f-9018-24db69356d1c</guid><dc:creator>nfbe</dc:creator><description>&lt;p&gt;Hi Abhijith,&lt;/p&gt;
&lt;p&gt;I will follow your advice and set the BT_MAX_CONN to the same value everywhere (including the sample code delivered from nordic, that is used for the net core...), even though I would think, that it should not make any difference and only depend on the decisive one used by the system. Otherwise having configuration overlays would not make a lot of sense, would it?&lt;/p&gt;
&lt;p&gt;The main problem remains though: Why is the speed and stability of FOTA changing very significantly (from 3.6kb/s stable transmission to something completely unstable, lasting an hour for 200kb or longer, breaking down every now and then...) for just slightly modified code of the app-core with no obvious relation to&amp;nbsp;FOTA and using the exact same config parameters in both cases?&lt;/p&gt;
&lt;p&gt;I need to get this stable again soon! And I need to understand, why this gets unstable showing a speed of close to 0b/s in order to avoid this situation for future code and config.&lt;/p&gt;
&lt;p&gt;The bluetooth communication from my application to the same iPhone works perfectly fine, by the way - so generally a fast and efficient bluetooth communication is possible with this configuration.&lt;/p&gt;
&lt;p&gt;Any further help and ideas very much appreciated!&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/494499?ContentTypeID=1</link><pubDate>Thu, 18 Jul 2024 08:28:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec4e2e0b-eb54-4936-acf8-98b4b78b4b4d</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="nfbe"]&lt;br /&gt;Is it preferable to set&amp;nbsp;a certain (higher) number of connections allowed? I do have contradicting settings for BT_MAX_CONN in the different config files on the network core side - one file sets it to 16, another one to 10 and the third and decisive one sets this parameter to 2. Other than that conflict &amp;quot;imported&amp;quot; from the nordic samples, I do not see any problems in my configuration... and more importantly - I have not changed any of the bluetooth relevant configuration parameters compared to the old version that worked. I did not work terribly fast, but reproducibly at about 3.6 kb/s for a 200kb file - and, rolling back to that version (flashing it on the device and then updating it with one byte for build number changed via FOTA), still works at&amp;nbsp;that speed.[/quote]
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div dir="auto"&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p&gt;I recommend standardizing the &amp;quot;BT_MAX_CONN&amp;quot; value across all configuration files. Setting different values in various configurations can lead to inconsistencies in resource allocation (bandwidth and throughput) and performance. It&amp;#39;s advisable to assign the lowest possible value for &amp;quot;BT_MAX_CONN&amp;quot; to maintain consistency and optimize performance&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="nfbe"]I would really like to understand, what determines this speed and stability of the nordic FOTA update[/quote]
&lt;p&gt;I&amp;#39;m not certain, but I believe there isn&amp;#39;t an exact number for the transfer rate because it depends significantly on various factors such as Bluetooth connection parameters, MTU size, the type of radio used, and the environment in which you&amp;#39;re testing. Optimizing some of these parameters and conducting thorough testing under different conditions can increase the transfer rate to some extent.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/493988?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 19:30:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46fceed7-6c9f-46f6-9907-5e95fa4af87d</guid><dc:creator>nfbe</dc:creator><description>&lt;p&gt;Dear Abhijith,&lt;/p&gt;
&lt;p&gt;thank you very much for your reply. &lt;br /&gt;&lt;br /&gt;I already have set the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.4.0/page/kconfig/index.html#CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP"&gt;CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP&lt;/a&gt;&amp;nbsp;to yes. in my project.conf for the app core side. It is also set to yes in the rpms_child_image_overlay.conf on the network core&amp;nbsp;side, which is coming from the otp/nordic/ncs/v2.4.0/nrf/samples/common/mcumgr_bt_ota_dfu/ path.&lt;/p&gt;
&lt;p&gt;So, unfortunately, this is not the solution to my problem.&lt;br /&gt;&lt;br /&gt;Is it preferable to set&amp;nbsp;a certain (higher) number of connections allowed? I do have contradicting settings for BT_MAX_CONN in the different config files on the network core side - one file sets it to 16, another one to 10 and the third and decisive one sets this parameter to 2. Other than that conflict &amp;quot;imported&amp;quot; from the nordic samples, I do not see any problems in my configuration... and more importantly - I have not changed any of the bluetooth relevant configuration parameters compared to the old version that worked. I did not work terribly fast, but reproducibly at about 3.6 kb/s for a 200kb file - and, rolling back to that version (flashing it on the device and then updating it with one byte for build number changed via FOTA), still works at&amp;nbsp;that speed.&lt;/p&gt;
&lt;p&gt;This older version by the way contains the same conflicting settings for BT_MAX_CONN on the network core side - and just works.&lt;/p&gt;
&lt;p&gt;The app_update.bin file for the new version is 156 bytes&amp;nbsp;larger than the old one... but does FOTA somehow depend on the content itself?&lt;/p&gt;
&lt;p&gt;I would really like to understand, what determines this speed and stability of the nordic FOTA update.&lt;/p&gt;
&lt;p&gt;Any hints welcome to reliably solve this problem.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Jens&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extremely slow and unstable FOTA on nrf5340 based device after code update in app</title><link>https://devzone.nordicsemi.com/thread/493908?ContentTypeID=1</link><pubDate>Mon, 15 Jul 2024 12:59:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9edb2e11-982e-465e-8117-f22357214c92</guid><dc:creator>Menon</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Could you please try enabling the configuration &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.4.0/page/kconfig/index.html#CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP"&gt;CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU_SPEEDUP&lt;/a&gt; to expedite the OTA DFU transfer? &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/107766/dfu-upload-speed-through-bt-smp-is-slow?ReplyFilter=Answers&amp;amp;ReplySortBy=Answers&amp;amp;ReplySortOrder=Descending"&gt;There&amp;#39;s a thread discussing a workaround&lt;/a&gt; to enhance OTA DFU speed, although it&amp;#39;s Android-centric. Please let me know if this resolves the issue for you.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Abhijith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>