<?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>nrfx_ppi_channel_disable() sometimes returns NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47825/nrfx_ppi_channel_disable-sometimes-returns-nrfx_error_invalid_state</link><description>Hi, I have a particular issue that happens intermittently, I was hoping someone here has come across the same issue and possibly knows how to fix it. 
 My Setup: 
 
 Using nRF5_SDK_15.3.0_59ac345. 
 And the s140 v6.1.1 softdevice. 
 2x nRF52840&amp;#39;s, on</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 May 2019 08:51:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47825/nrfx_ppi_channel_disable-sometimes-returns-nrfx_error_invalid_state" /><item><title>RE: nrfx_ppi_channel_disable() sometimes returns NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/190210?ContentTypeID=1</link><pubDate>Fri, 31 May 2019 08:51:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f80da4f7-c4b1-4426-9e0c-5aa3b11be256</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you sure that the libuarte is initialized when this happens? Perhaps there is a problem with the logic in your application so that it is not called? Even if you have basic handling of this (which I don&amp;#39;t see any trace of in your code snippets), another explanation could be that since the call stack shows that everyting here happen in the SoftDevice interrupt handling, there could be that you started to initialize libuarte, but the BLE event came before it finished and interrupted the initialization procedure. Then the uninitialization happens before it is actually initialized, which in turn leads to this error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfx_ppi_channel_disable() sometimes returns NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/190017?ContentTypeID=1</link><pubDate>Thu, 30 May 2019 05:41:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:260bc27d-10df-4816-b9ff-a6bb02a8392a</guid><dc:creator>gordie</dc:creator><description>&lt;p&gt;Hi Einar, from what I&amp;#39;ve seen so far, it seems to happen when I start the bluetooth connection process on the peripheral device and then abruptly stop it by turning the central off. This then causes the code on the peripheral to hit the case statement:&amp;nbsp;BLE_GAP_EVT_DISCONNECTED where&amp;nbsp;nrf_libuarte_async_uninit(&amp;amp;libuarte); gets called.&lt;/p&gt;
&lt;p&gt;I have attached a screencap of the call stack, which is the same everytime (I&amp;#39;ve been able to reproduce it many times):&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1024x768/__key/communityserver-discussions-components-files/4/callstack1.JPG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfx_ppi_channel_disable() sometimes returns NRFX_ERROR_INVALID_STATE</title><link>https://devzone.nordicsemi.com/thread/189905?ContentTypeID=1</link><pubDate>Wed, 29 May 2019 13:38:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9017b2a-78f1-4aa8-84d1-993f6f31ef87</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This would happen if&amp;nbsp;nrfx_ppi_channel_free() has been called before&amp;nbsp;nrfx_ppi_channel_disable(), but that should not happen. Can you add some logging in nrfx_ppi.c and nrf_libuarte_async.c to get a good understanding of the program flow up to when this error occurs?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>