<?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>I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43931/i2c-stuck-on-twi-irq</link><description>I&amp;#39;m using nRF SDK 12.2.0 and the corresponding soft device. I control a I2C slave for which I use the TWI peripheral through the driver implemented in nrf_drv_twi.c. It happens some times that the device gets stuck on the TWI IRQ handler. Unfortunately</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 06 Jan 2022 07:32:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43931/i2c-stuck-on-twi-irq" /><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/346350?ContentTypeID=1</link><pubDate>Thu, 06 Jan 2022 07:32:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5f26ba7-51f2-4e12-ac29-9defa5775439</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;&lt;span&gt;This case is closing in on 2 years old, so I wouldn&amp;#39;t have my hopes up for a reply in this thread. If you have any specific questions, please create a ticket here on DevZone explaining your issue. Feel free to link to this thread if you find it relevant.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/346314?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 22:48:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8508fad-4708-4652-b810-38cbb1c7158c</guid><dc:creator>username99</dc:creator><description>&lt;p&gt;Any updates on this issue?&amp;nbsp; I believe I have the same problem.&amp;nbsp; My debugger leads me to the&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;twi_transfer() in&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;twi_irq_handler() and appears to hang there.&amp;nbsp; Not quite sure why it just gets stuck here and not sure what to look for.&amp;nbsp; Looks to be the beginning of a transfer but it won&amp;#39;t proceed or error out.&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/283955?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2020 07:33:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d477f8ab-53ea-494c-b2cb-489e1c9b4a70</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Robert&lt;/p&gt;
&lt;p&gt;This case is closing in on 2 years old, so I wouldn&amp;#39;t have my hopes up for a reply in this thread. If you have any specific questions, please create a ticket here on DevZone explaining your issue. I will of course keep this ticket open so &lt;a href="https://devzone.nordicsemi.com/members/genis.aguilar"&gt;genis&lt;/a&gt; can get back to you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/283920?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 22:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ac5be61-9abc-4541-aa5a-f9e87e9c19dd</guid><dc:creator>Robert Haddad</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/genis"&gt;genis&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Would it be possible to get the updated file you mentioned? I&amp;#39;m having a very similar issue and I&amp;#39;m interested to see if it would work for me. I&amp;#39;m using the SDK 12.3. Thank you in advance,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Robert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/180596?ContentTypeID=1</link><pubDate>Sat, 06 Apr 2019 14:09:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8b6adb4-abcd-492c-8f32-62abd5eb591c</guid><dc:creator>Nihal</dc:creator><description>&lt;p&gt;Hey,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m facing similar issue with I2C getting stuck sometimes. I&amp;#39;m using nRF52840 with TWI0 &amp;amp; softdevice enabled. Can you tell me what changes you did in the driver to fix this issue? If possible can you share me your re-written TWI driver?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Looking at your&amp;nbsp;posts, I think the following code should fix the problem.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if (do_stop_check || nrf_twi_event_check(p_twi, NRF_TWI_EVENT_STOPPED))
    {
        nrf_twi_event_clear(p_twi, NRF_TWI_EVENT_STOPPED);
        NRF_LOG_DEBUG(&amp;quot;TWI: Event: %s.\r\n&amp;quot;, (uint32_t)EVT_TO_STR_TWI(NRF_TWI_EVENT_STOPPED)); 
        return false;
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/172473?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 10:09:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ee89af3-7181-4d14-9be5-45180819a3dd</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Thank you for the suggestion! I will report this internally.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/172442?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 08:32:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c52bcb79-03ae-4727-bb12-f25f1f901d3b</guid><dc:creator>genis</dc:creator><description>&lt;p&gt;Anyway I suggest that the driver provided in the SDK at leasts clears TWI_EVENTS_STOPPED in any case to prevent the interrupt trigger all the time. Even if not expected that may happen due wrong usage of the driver by the developer (wrong calls, concurrent calls, etc.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/172422?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 06:33:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:124e784b-687a-4b47-980d-89c4de31860b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;I am glad you got it working!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/172353?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 16:17:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0001494b-a565-4212-8779-cd28f2aaabce</guid><dc:creator>genis</dc:creator><description>&lt;p&gt;I ended up by writing my own I2C driver and apparently the issue is not reproduced anymore. There were a couple of other fixes in theory not related to this. If I have some time I&amp;#39;ll&amp;nbsp; try to restore the I2C part and keep the rest of the fixes there and see if it reproduces again. However I&amp;#39;ll put that on hold for the next few days.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/172222?ContentTypeID=1</link><pubDate>Thu, 21 Feb 2019 06:59:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83df233c-4a28-47c3-9449-c8a3e0891769</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you gotten anywhere with the tests? I can&amp;#39;t find any other reasons for TWI_EVENTS_STOPPED to trigger except error/complete packet transmission.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/172127?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 13:32:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ad6f4b1-3f2b-4c4e-9b0b-33ff20c6cfb2</guid><dc:creator>genis</dc:creator><description>&lt;p&gt;I&amp;#39;m doing this kind of checks at the moment. Anyway, is there any reason why TWI.EVENTS_STOP may trigger other than an error or because the whole packet has been transmitted?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C Stuck on TWI IRQ</title><link>https://devzone.nordicsemi.com/thread/172126?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 13:30:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e724ff0-a8bc-418a-b44a-8f533ebe9375</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you tried this out with each of the tasks independently, to make sure you are looking at the right task, and that the mutex is working properly?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>