<?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>TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16060/twi-timeout---sdk11</link><description>Hi, 
 I&amp;#39;m using the nrf_drv_twi driver (master) to communicate with a number of IO components, such as LEDs, buttons etc. 
 If my IO component does not respond (why is not relevant to this question, but it does...), the code hangs (nrf_drv_twi.c, line</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 11 Mar 2018 11:42:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16060/twi-timeout---sdk11" /><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/123793?ContentTypeID=1</link><pubDate>Sun, 11 Mar 2018 11:42:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c106de6-0a68-4e69-997a-a61b1ad92952</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;seems like a good solution. The whole point of open source is to add/modify features to your liking, which you did :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/123546?ContentTypeID=1</link><pubDate>Fri, 09 Mar 2018 07:15:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a4fcd64-abf6-4a9e-b026-49c7b163fb3f</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;We ended up doing this (using embOS):&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;- in your read/write function ----------------------------------------&lt;/p&gt;
&lt;p&gt;if (nrf_drv_spi_transfer (&amp;amp;mSpi, setup, 3, NULL, 0) != NRF_SUCCESS)&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; nrf_gpio_pin_set (PIN_FRAM_CS);&lt;br /&gt;&amp;nbsp; &amp;nbsp; return (NRF_ERROR_INTERNAL);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;if (! transferCompleted (DEVICE_TIMEOUT))&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; nrf_gpio_pin_set (PIN_FRAM_CS);&lt;br /&gt;&amp;nbsp; &amp;nbsp; return (NRF_ERROR_TIMEOUT);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;- here is yout transferCompleted function -------------------------------&lt;/p&gt;
&lt;p&gt;static bool transferCompleted (int ms)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; bool tc = (OS_EVENT_WaitTimed (&amp;amp;mTCevent, ms) == 0);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; return (tc); /* Return true to indicate successful transfer */&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;- here is what the respective interrupt service routine does ----------&lt;/p&gt;
&lt;p&gt;static void onTransferComplete (nrf_drv_spi_evt_t const * p_event, void * p_context)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; OS_EVENT_Set (&amp;amp;mTCevent); /* All bytes transferred */&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* --&amp;gt; signal main thread */&lt;br /&gt;} /* (see transferCompleted ()) */&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/123348?ContentTypeID=1</link><pubDate>Thu, 08 Mar 2018 07:45:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c527536c-dba7-41b4-9ff0-9ca009f1ac6c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;so this problem is solved in the later SDK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/122335?ContentTypeID=1</link><pubDate>Wed, 28 Feb 2018 15:42:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94734969-c6bd-46ff-8e26-fe2944a5bd48</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;No, but in the mean time we have switched to a later SDK. Is seems to include code to guard against timeouts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/121745?ContentTypeID=1</link><pubDate>Fri, 23 Feb 2018 03:31:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e85dcf3-eebd-484c-99ee-7ee51cae56ff</guid><dc:creator>AndrewJ</dc:creator><description>&lt;p&gt;I&amp;#39;m experiencing hanging in the exact spot as the OP.&amp;nbsp; Was a solution ever found to this problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/61250?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 12:05:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:785a0d1a-4eee-4f8a-ad62-45664ba49730</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Thank you for your reply AlexV.&lt;/p&gt;
&lt;p&gt;If I choose Option 2 (non-blocking) which function do I use to cancel the pending write?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/61249?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 11:21:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a35b97c-945b-4b1f-a432-726a4af3bb92</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Simplest solution is to modify your current blocking functions but remember that if you update SDK you have to modify it again unless you create your own functions based on Nordic implementation. Non-blocking in your case is more safe for future but need to spend time now to implement it. I would not wait for option (3)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI timeout - SDK11</title><link>https://devzone.nordicsemi.com/thread/61248?ContentTypeID=1</link><pubDate>Mon, 29 Aug 2016 14:47:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd35b344-d052-4d9f-b60b-9761318cf1aa</guid><dc:creator>laurent</dc:creator><description>&lt;p&gt;Hi,
I can advise you to try making a simple read sequence first following the good sample (which works well): &lt;a href="https://devzone.nordicsemi.com/question/48894/hardware-twii2c-example/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;
This is helpful to check the communication beetween nRF and a twi slave.
laurent&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>