<?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>Question about using the TWI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78161/question-about-using-the-twi</link><description>Hello, I am currently using the TWI in non-blocking mode, however I frequently run into the issue where the code gets stuck on nrf_drv_twi_tx. function at the return result statement. I can&amp;#39;t step in or out of the code. I have also encountered this intermittently</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Aug 2021 13:20:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78161/question-about-using-the-twi" /><item><title>RE: Question about using the TWI</title><link>https://devzone.nordicsemi.com/thread/323127?ContentTypeID=1</link><pubDate>Tue, 03 Aug 2021 13:20:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a97bf0e-3503-4ad1-9c58-2a8d93e5465a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I frequently run into the issue where the code gets stuck on&amp;nbsp;nrf_drv_twi_tx. function at the return result statement.[/quote]
&lt;p&gt;What do you mean by stuck? Do the function return a non-zero error code that puts the chip into the error handler?&lt;/p&gt;
&lt;p&gt;Can you post the code you used for initializing TWI and how you start and finish transfers?&lt;/p&gt;
&lt;p&gt;How do you ensure that the transfer is completed before starting a new transfer? In non-blocking mode, you need some synch method to make sure that no transfers are ongoing before starting a new transfer. If the application works as expected when stepping, this could indicate that the this allows enough time for the previous transfer to complete before a new transfer is stared.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>