<?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>Soft Device Freeze NUS, Scan, FreeRtos</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71798/soft-device-freeze-nus-scan-freertos</link><description>I have an application that is running the following setup as a multi-connection (peripheral and central) setup: 
 
 
 I am having an issue when a peripheral (NUS) is sending and receiving significant amounts of data over BLE I get the Soft Device locked</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 20 Feb 2021 23:38:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71798/soft-device-freeze-nus-scan-freertos" /><item><title>RE: Soft Device Freeze NUS, Scan, FreeRtos</title><link>https://devzone.nordicsemi.com/thread/295449?ContentTypeID=1</link><pubDate>Sat, 20 Feb 2021 23:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e7a550b-d37d-4ce2-8629-146a30eb76c7</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/lukecorb_4000_gmail.com"&gt;LukeC&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I am currently using FreeRTOS in that fashion and I haven&amp;rsquo;t had an issue.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device Freeze NUS, Scan, FreeRtos</title><link>https://devzone.nordicsemi.com/thread/295251?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2021 05:50:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cf623b9-b64f-4c40-93b0-1beda145d421</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;So, I found another thread that proposed removing the SDH task and using&amp;nbsp;the interrupt dispatch model.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Is there any extra risk from this approach?&lt;/strong&gt;&amp;nbsp; It seems to have fixed the issue, I can even push scanning to 20ms window / 10ms interval.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;i&amp;gt; NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context.
// &amp;lt;i&amp;gt; NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler.
// &amp;lt;i&amp;gt; NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually.
// &amp;lt;0=&amp;gt; NRF_SDH_DISPATCH_MODEL_INTERRUPT 
// &amp;lt;1=&amp;gt; NRF_SDH_DISPATCH_MODEL_APPSH 
// &amp;lt;2=&amp;gt; NRF_SDH_DISPATCH_MODEL_POLLING 

#ifndef NRF_SDH_DISPATCH_MODEL
#define NRF_SDH_DISPATCH_MODEL 0
#endif&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device Freeze NUS, Scan, FreeRtos</title><link>https://devzone.nordicsemi.com/thread/295249?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2021 05:38:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d39785f-d57f-46cc-b10f-9a03a66c301f</guid><dc:creator>LukeC</dc:creator><description>&lt;p&gt;I have been concerned about that as well, but I think I have the priorities set right.&lt;/p&gt;
&lt;p&gt;All of my tasks are either priority 0 or 1 while the SDH task is priority 2.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If I pause when the stack freezes, I see the IDLE task as the one executing, which indicates the BLE task is not blocking. It sure seems like it is the soft device locking up which runs at a higher priority than any of the FreeRtos tasks...&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/pastedimage1613713035347v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Soft Device Freeze NUS, Scan, FreeRtos</title><link>https://devzone.nordicsemi.com/thread/295244?ContentTypeID=1</link><pubDate>Fri, 19 Feb 2021 02:28:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86aed2c7-ab02-47ab-93af-908f866f312b</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/lukecorb_4000_gmail.com"&gt;LukeC&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What are the task priorities? &amp;nbsp;The BLE task should be high if not the highest. &amp;nbsp;Note that in FreeRTOS a high number means a higher priority.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>