<?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>nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123001/nrf54l15-fota-requires-delay</link><description>Hello Team, 
 I am currently using the nRF54L15 DK with NCS version 2.9.0 for development and compiling code for the nRF54L10 board. 
 I am trying to implement FOTA updates over BLE. To facilitate this, I have added the following lines to my configuration</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 18 Jul 2025 13:47:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123001/nrf54l15-fota-requires-delay" /><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542881?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2025 13:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:731b6192-65b2-45b7-97ce-f1b89a1c2f1f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You don&amp;#39;t have to use k_sleep() as I mentioned earlier, but you should implement a mechanism to prevent your loop from running unnecessarily. Otherwise, it will waste CPU cycles, prevent the device from entering sleep, and negatively affect system performance as you have experienced.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542879?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2025 13:35:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08107805-1517-472c-8b3c-1f9c7215bba5</guid><dc:creator>payalD</dc:creator><description>&lt;p&gt;Thanks for the quick reply.&lt;/p&gt;
&lt;p&gt;It seems I need to add the delay for FOTA to work successfully. But as I mentioned earlier, this delay is hampering the other functionality. Is there any way that I can identify if the FOTA has been initiated and is in progress so that I can halt the functionality that is getting affected due to this delay during the FOTA activity?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542872?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2025 12:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:625b373c-a7a5-450d-83d4-93030c40e073</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;An empty while(1) loop causes the thread to consume 100% of the CPU as long as it&amp;#39;s allowed to run by the scheduler. For your app it means it will prevent lower priority threads from running and&amp;nbsp;will block the system from entering the idle or logger thread. Some of this is covered by the devacademy course:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-7-multithreaded-applications/topic/scheduler/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-7-multithreaded-applications/topic/scheduler/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="payalD"]But if I add the delay of a minimum 200mSec as below, FOTA&amp;nbsp; process gets successfully completed[/quote]
&lt;p&gt;By calling k_msleep(200) you are effectively yielding the main thread and allowing the scheduler to run other threads for at least 200 ms.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542859?ContentTypeID=1</link><pubDate>Fri, 18 Jul 2025 11:52:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f52ab7cb-92d0-4ae0-a392-4d1884b07e0c</guid><dc:creator>payalD</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Apologies for the late reply.&lt;/p&gt;
&lt;p&gt;Please have a look at code below.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{	
    ble_adv_start();
	while(1)
	{
		//execute_main_apps();
	}
	return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This main loop is doing absolutely nothig as I commented the main app execution. When I flash this code on the nrf54l15 board and try to perform FOTA, the process aborts with &amp;quot;Request timed out&amp;quot; error displayed on the app.&lt;/p&gt;
&lt;p&gt;But if I add the delay of a minimum 200mSec as below, FOTA&amp;nbsp; process gets successfully completed&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int main(void)
{	
    ble_adv_start();
	while(1)
	{
		//execute_main_apps();
		k_sleep(K_MSEC(200));
	}
	return 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542670?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 15:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15bed013-ba4c-47f6-9859-9abd75e0275a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes the peripheral sample requires k_sleep() in the main loop because of the way it is implemented (the sleep duration effectively controls the sensor sample rate). Otherwise, it&amp;nbsp;would continuously try to send the notifications&amp;nbsp;and leave little to no time for other threads to execute. However, if you have some kind of &amp;quot;superloop&amp;quot;&amp;nbsp; in your main thread, it would&amp;nbsp;likely be better to look into using zephyr primitives such as semaphores or k_poll() than k_sleep().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542657?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 13:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:247c6349-a183-4fab-87a2-2c6275fa41e1</guid><dc:creator>payalD</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/123001/nrf54l15-fota-requires-delay/542637"]Are the tasks in this loop really that compute heavy and need to be blocking, or could the main loop perhaps yield more often?&amp;quot;[/quote]
&lt;p&gt;The application is non-blocking.&lt;/p&gt;
&lt;p&gt;We also tried to test the FOTA in the Bluetooth peripheral sample example, and there also we observed that the FOTA process requires a delay.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542637?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 12:03:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff461969-5217-49da-91c3-f318ef4ff668</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for confirming.&lt;/p&gt;
[quote userid="142658" url="~/f/nordic-q-a/123001/nrf54l15-fota-requires-delay/542636"]We have only a single main thread. If we don&amp;#39;t call k_sleep(), other tasks are working fine, but FOTA doesn&amp;#39;t work in this case.[/quote]
&lt;p&gt;Is still a multi threaded application. I think my comment in the linked ticket also applies here: &amp;quot;it sounds like your app spends most of its time processing tasks in the main loop, which also means the system isn&amp;rsquo;t able to spend much time in sleep. Are the tasks in this loop really that compute heavy and need to be blocking, or could the main loop perhaps yield more often?&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542636?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 12:00:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8d0d086-8431-49ce-b2ea-0b517ddd7edf</guid><dc:creator>payalD</dc:creator><description>&lt;p&gt;Hello Vidar,&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/123001/nrf54l15-fota-requires-delay/542633"]Is this while loop running in your main() thread?[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/123001/nrf54l15-fota-requires-delay/542633"]What happens if you don’t call k_sleep(), does the thread run indefinitely performing blocking tasks without ever yielding to other threads?&amp;nbsp;[/quote]
&lt;p&gt;We have only a single main thread. If we don&amp;#39;t call k_sleep(), other tasks are working fine, but FOTA doesn&amp;#39;t work in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542633?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 11:52:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:879824a2-c42d-48a0-a5e1-2d61ecb4e4a6</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is this while loop running in your main() thread? What happens if you don&amp;rsquo;t call k_sleep(), does the thread run indefinitely performing blocking tasks without ever yielding to other threads?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/122161/fota-speed/539424"&gt;RE: FOTA speed&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf54l15: FOTA requires delay</title><link>https://devzone.nordicsemi.com/thread/542623?ContentTypeID=1</link><pubDate>Wed, 16 Jul 2025 10:00:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06196a3e-a9a3-4213-8c68-9c7fed2251aa</guid><dc:creator>ryansmith532</dc:creator><description>&lt;p data-start="286" data-end="464"&gt;I&amp;rsquo;ve encountered a similar issue with FOTA on nRF devices where the process becomes unreliable unless some timing constraints are respected, especially during Bluetooth activity. &lt;span style="color:#ffffff;"&gt;&lt;a style="color:#ffffff;" href="https://horrorgames.io/"&gt;horror games&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p data-start="466" data-end="491"&gt;To answer your questions:&lt;/p&gt;
&lt;ol data-start="493" data-end="1633"&gt;
&lt;li data-start="493" data-end="933"&gt;
&lt;p data-start="496" data-end="933"&gt;&lt;strong data-start="496" data-end="526"&gt;Why is the delay required?&lt;/strong&gt;&lt;br data-start="526" data-end="529" /&gt; BLE-based FOTA relies on stable data transmission intervals. If your main application is heavily using the CPU or interfering with connection events (e.g., high-frequency logging, sensor polling, or interrupts), it might be blocking the SoftDevice or the BLE stack from maintaining the connection properly. The 200ms delay probably gives the stack enough breathing room to handle DFU packets reliably.&lt;/p&gt;
&lt;/li&gt;
&lt;li data-start="935" data-end="1311"&gt;
&lt;p data-start="938" data-end="1311"&gt;&lt;strong data-start="938" data-end="970"&gt;Can FOTA work without delay?&lt;/strong&gt;&lt;br data-start="970" data-end="973" /&gt; In theory, yes &amp;mdash; but only if your application is already yielding enough time or prioritizing BLE connection handling. You might want to review how cooperative your threads are and check if the main loop is allowing idle time. Consider using &lt;code data-start="1218" data-end="1229"&gt;k_sleep()&lt;/code&gt; or reviewing Zephyr&amp;#39;s thread priorities (especially for the DFU or mcumgr tasks).&lt;/p&gt;
&lt;/li&gt;
&lt;li data-start="1313" data-end="1633"&gt;
&lt;p data-start="1316" data-end="1633"&gt;&lt;strong data-start="1316" data-end="1350"&gt;Can I detect FOTA in progress?&lt;/strong&gt;&lt;br data-start="1350" data-end="1353" /&gt; Yes. You can hook into DFU start/end events using &lt;code data-start="1406" data-end="1414"&gt;mcumgr&lt;/code&gt; callbacks. A common method is to monitor &lt;code data-start="1456" data-end="1479"&gt;mcumgr_grp_register()&lt;/code&gt; with custom handlers or set flags when the DFU image upload begins. Once detected, you can throttle down or pause other time-sensitive tasks temporarily.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>