<?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>In SDK versions above 1.8.0, sleeping threads don&amp;#39;t wake when BT UART is connected in the nRF52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92407/in-sdk-versions-above-1-8-0-sleeping-threads-don-t-wake-when-bt-uart-is-connected-in-the-nrf52840</link><description>It appears that after a few seconds and sometimes after a few minutes sleeping threads do not wake up, even though the UART shell and BT NUS are working. The only service that the BT is advertising is the BT NUS. This problem occurs after the first time</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Oct 2022 22:52:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92407/in-sdk-versions-above-1-8-0-sleeping-threads-don-t-wake-when-bt-uart-is-connected-in-the-nrf52840" /><item><title>RE: In SDK versions above 1.8.0, sleeping threads don't wake when BT UART is connected in the nRF52840</title><link>https://devzone.nordicsemi.com/thread/390719?ContentTypeID=1</link><pubDate>Thu, 13 Oct 2022 22:52:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9586f76-8a3f-4e50-bfed-b3ab31332376</guid><dc:creator>mnor</dc:creator><description>&lt;p&gt;I&amp;#39;ve made some progress debugging this issue.&amp;nbsp;I started with version 2.1.0 of the SDK and a sample project from the same SDK called &amp;quot;shell_bt_nus&amp;quot;. This sample works fine.&lt;/p&gt;
&lt;p&gt;I then added some of our UART interface code to the shell_bt_nus sample. This code uses UART_1 and the UART asynchronous driver provided by Nordic. This caused the problem. Upon further investigation, I found that the issue is caused by using the UART asynchronous driver provided by Nordic in SDK version 2.1.0. When I changed the code to use the UART interrupt driven driver from the Nordic SDK then the problem did not occur.&lt;/p&gt;
&lt;p&gt;I still don&amp;#39;t know why this is happening with the UART asynchronous driver, but as least I&amp;#39;ve got a workaround by using a different version of the UART driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: In SDK versions above 1.8.0, sleeping threads don't wake when BT UART is connected in the nRF52840</title><link>https://devzone.nordicsemi.com/thread/389498?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2022 23:49:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:180c5a9d-cd33-47a6-b41d-12a097e0e068</guid><dc:creator>mnor</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks for the response. Sorry for the delay on my end, but things got busy. I will follow your advice and post my results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: In SDK versions above 1.8.0, sleeping threads don't wake when BT UART is connected in the nRF52840</title><link>https://devzone.nordicsemi.com/thread/388766?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 12:16:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dc8a034-6db3-4c0a-b14c-c9a3e02da786</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Mike,&lt;/p&gt;
&lt;p&gt;This seems very odd, but I have not been able to reproduce or find any other reports of this behavior. Can you provide detailed examples on how to reproduce? Some thing like:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;use specific sample from specific SDK release&lt;/li&gt;
&lt;li&gt;do these specific changes&lt;/li&gt;
&lt;li&gt;test in this specific way, and&lt;/li&gt;
&lt;li&gt;observe this specific result (failure)&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: In SDK versions above 1.8.0, sleeping threads don't wake when BT UART is connected in the nRF52840</title><link>https://devzone.nordicsemi.com/thread/388600?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 14:04:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d0e1df7-bf38-4796-a1ea-d9a94b6fab4d</guid><dc:creator>mnor</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;We&amp;#39;ve seen it in sample applications (&lt;span&gt;peripheral UART)&amp;nbsp;&lt;/span&gt;and in our own firmware. The threads that are not waking up have been put to sleep with &amp;quot;k_msleep()&amp;quot;. Threads that wait on OS mechanisms such as semaphores or queues appear to be waking up.&lt;/p&gt;
&lt;p&gt;The affected threads include &amp;quot;main&amp;quot;, which is in a simple loop toggling an LED every second. As I mentioned, it appears to only affect threads that have been put to sleep for a number of milliseconds.&lt;/p&gt;
&lt;p&gt;At some point, the threads that are asleep don&amp;#39;t wake up. The most obvious thread is &amp;quot;main&amp;quot; because the LED stops blinking. When I stop the processor, the firmware is in the idle code &amp;quot;cpu_idle.S&amp;quot;.&lt;/p&gt;
&lt;p&gt;This only occurs when BT NUS is enabled and connected. It can also take a minute to over 10 minutes to occur. If the nRF52840 is only advertising NUS, then the problem does not occur.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been working with the nRF5340 and not seen this problem. It seems to only affect the nRF52840, but in SDK versions above 1.8.0.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Mike Norton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: In SDK versions above 1.8.0, sleeping threads don't wake when BT UART is connected in the nRF52840</title><link>https://devzone.nordicsemi.com/thread/388535?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 10:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce412897-5952-4288-afdf-b31b969eaa0d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is this&amp;nbsp;something you see with a sample application or your own firmware? Which threads are not waking up, and what are they waiting for (what should wake them up)? What have you found by debugging?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>