<?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>FreeRTOS BLE architecture questions - SDK 14.0.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32538/freertos-ble-architecture-questions---sdk-14-0-0</link><description>Hi All, 
 I have a general question about the FreeRTOS implementation for SDK 14.0.0. 
 I&amp;#39;ve added FreeRTOS onto a basic UART BLE peripheral example that I wrote. I referenced the HRS FreeRTOS example that comes with the SDK in order to add FreeRTOS to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Mar 2018 22:37:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32538/freertos-ble-architecture-questions---sdk-14-0-0" /><item><title>RE: FreeRTOS BLE architecture questions - SDK 14.0.0</title><link>https://devzone.nordicsemi.com/thread/125617?ContentTypeID=1</link><pubDate>Thu, 22 Mar 2018 22:37:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0296c145-35ea-4e08-831a-033bd124c536</guid><dc:creator>leonhart88</dc:creator><description>&lt;p&gt;OK thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS BLE architecture questions - SDK 14.0.0</title><link>https://devzone.nordicsemi.com/thread/125410?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 16:35:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5fd90b6-006f-436d-b087-1ae952d72bf5</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You are correct about the BLE task.&lt;/p&gt;
&lt;p&gt;set might be atomic for boolean but check is definitely not as it needs atleast two instructions. (one for loading the value in register and the other for comparing)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS BLE architecture questions - SDK 14.0.0</title><link>https://devzone.nordicsemi.com/thread/125406?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 16:21:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d8b7c4a-9e55-4e50-ad30-0d684f6f217c</guid><dc:creator>leonhart88</dc:creator><description>&lt;p&gt;Thanks Aryan.&amp;nbsp; So all the BLE events &amp;amp; handlers are executed in the BLE task that is created, correct?&lt;br /&gt;&lt;br /&gt;And in reference to the flags, I agree that I might as well use semaphores since I have that ability.&amp;nbsp; However, are set and check operations of boolean flags atomic in the system?&amp;nbsp; Just curious if they are inherently thread safe or not.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS BLE architecture questions - SDK 14.0.0</title><link>https://devzone.nordicsemi.com/thread/125355?ContentTypeID=1</link><pubDate>Wed, 21 Mar 2018 12:58:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99e4e10b-ed24-4f9a-ad43-d278051d8c52</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Philip,&lt;/p&gt;
&lt;p&gt;Using FreeRTOS with BLE is a special case. Our softdevice will always run with highest priority. Which means that the FreeRTOS kernel is running as an application on top of softdevice. The task that you mention is created for BLE activity in the example is to process the BLE events. Since softdevice runs out of FreeRTOS scope. Which means that FreeRTOS does not have any clue about the softdevice activity, since softdevice runs not as a FreeRTOS thread, but within its own interrupt context.&lt;/p&gt;
&lt;p&gt;This might be little confusing to digest at the first, but please ask me more questions if this is the case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;About the flags, Yes, trying to communicate between threads, using semaphores will be a good way instead of using a global flags. When you have inherited the nicer features by using an RTOS then use those features instead of the basic flag. With flags, you need to add the complexity of protecting it in multicontext, with semaphores, you do not need to worry about that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>