<?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>Is GPIOTE driver thread-safe ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39076/is-gpiote-driver-thread-safe</link><description>Dear Nordic experts, 
 While investigating some of my bugs, I had to look into the GPIOTE driver code, and I realized that it has some allocator for mapping GPIOTE channels to pins. 
 Because the GPIOTE driver connects the input buffer, I call it dynamically</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Oct 2018 13:05:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39076/is-gpiote-driver-thread-safe" /><item><title>RE: Is GPIOTE driver thread-safe ?</title><link>https://devzone.nordicsemi.com/thread/151456?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 13:05:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aba2280-4122-47d8-8b96-30d0736c8405</guid><dc:creator>Vincent Bela&amp;#239;che</dc:creator><description>&lt;p&gt;Thank you, this confirms what I anticipated from reading the code.&lt;/p&gt;
&lt;p&gt;I think that the driver documentation should be improved for the user to know which driver functions access shared variables, and as such should be protected somehow from thread interaction (by means of some protocol between OS tasks, or some mutex), and which do not need such care.&lt;/p&gt;
&lt;p&gt;This would be helpful to have this kind of info for each function that really needs protection to differentiate them from functions, like e.g. nrf_gpio_in_clear, which inherently are thread safe because registers are 32bits in an 32bit architecture, so as long as some GPIO is assigned to some OS Task there is no conflicts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is GPIOTE driver thread-safe ?</title><link>https://devzone.nordicsemi.com/thread/151401?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 11:38:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bd2f70f-ce3a-42f3-8f0e-fdb5f092a4ea</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Vincent,&lt;/p&gt;
&lt;p&gt;The drivers were not designed to be thread safe yet. While using in any RTOS, I normally protect any global member that is being accessed in multiple context by a mutex. I would recommend you to do the same to be sure of it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>