<?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>rtos task can not work when bluetooth connected.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47057/rtos-task-can-not-work-when-bluetooth-connected</link><description>Hi all, 
 
 I creat a main task to process events, when the bluetooth connected, this main task can not work, and the bluetooth can still work. 
 I try to add the main task&amp;#39;s priority, but it still unuseful. 
 below is my code: 
 the sdk is nRF5_SDK_15</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 May 2019 07:16:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47057/rtos-task-can-not-work-when-bluetooth-connected" /><item><title>RE: rtos task can not work when bluetooth connected.</title><link>https://devzone.nordicsemi.com/thread/186082?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 07:16:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbe57b31-2130-4019-bcca-db2c0285606d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you that the&amp;nbsp;user_common_task does not work, does it mean that it does not run? In other words, it does not get the common_irq_Semaphore semaphore from the&amp;nbsp;bsp_evt_handler? Can you debug and check in more detail what happens and explain here? For instance:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is&amp;nbsp;user_common_task() waiting in the call to&amp;nbsp;xSemaphoreTake ()?&lt;/li&gt;
&lt;li&gt;Does&amp;nbsp;bsp_evt_handler run and call&amp;nbsp;xSemaphoreGiveFromISR?&lt;/li&gt;
&lt;li&gt;Is the semaphore received in&amp;nbsp;user_common_task(), or does it wait&amp;nbsp;xSemaphoreTake() &amp;quot;forever&amp;quot;?&lt;/li&gt;
&lt;li&gt;What happens if you set a lower value for the second parameter,&amp;nbsp;xTicksToWait? In&amp;nbsp;your code it will just call&amp;nbsp;xSemaphoreTake() gain, but I want to know if the task ever has time to run. could it be that there is a problem that the SoftDevice task always runs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is difficult to get any overview of your code snippets in the question. For instance, I don&amp;#39;t see where&amp;nbsp;bsp_evt_handler is used, and I am having problems understanding your&amp;nbsp;softdevice_task(). This look similar to the implementation in&amp;nbsp; nrf_sdh_freertos.c, which is used when you call&amp;nbsp;nrf_sdh_freertos_init(), which you have also included. Can you provide more of y our code to make it easier to get an overview? Which SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: rtos task can not work when bluetooth connected.</title><link>https://devzone.nordicsemi.com/thread/186047?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 03:31:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fdbf61b-faf4-4b8b-b7a9-cccb36dfe3cd</guid><dc:creator>stone.xiang</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The bluetooth can still work,so i think the softdevice_task can still work, the main task(user_common_task) can not work when bluetooth connected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: rtos task can not work when bluetooth connected.</title><link>https://devzone.nordicsemi.com/thread/185969?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 12:40:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2399982d-71e3-40c0-8060-92da62c49625</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is it your&amp;nbsp;softdevice_task() that does not work? In what way does it not work? That said, I do not think you approach looks sensible. There is no need for you to call nrf_sdh_evts_poll() in the app, as that is handled by ble_app_hrs_freertos example, which&amp;nbsp;I see you use. I suggest you use the approach shown in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_hrs_freertos.html?cp=5_0_4_2_2_14"&gt;ble_app_hrs_freertos example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>