<?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 I2C driver gives success code but no data is sent</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89529/twi-i2c-driver-gives-success-code-but-no-data-is-sent</link><description>I have been working on writing a basic TWI driver in order to use I2C on my nRF52810 DK. I have the TWI successfully initializing, and when I try to write a byte to a connected device I get a success code. However, when I connect those pins to a scope</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Jul 2022 11:55:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89529/twi-i2c-driver-gives-success-code-but-no-data-is-sent" /><item><title>RE: TWI I2C driver gives success code but no data is sent</title><link>https://devzone.nordicsemi.com/thread/375078?ContentTypeID=1</link><pubDate>Fri, 01 Jul 2022 11:55:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89a8f65e-1bd8-4ee3-95a7-7e0b2479c8cb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You will get&amp;nbsp;NRFX_ERROR_INVALID_STATE from&amp;nbsp;nrfx_twim_init() if it has already been initialized.&amp;nbsp;I see from an include that you are using Zephyr (so I assume via nRF Connect SDK?). In that case, if you have enabled TWI in the device tree, the driver will be initialized automatically by the zephyr kernel behind the scenes. So if you want to use only the nrfx driver directly you should disable i2c in the device tree, for instance with an overlay where you set the status for i2c0&amp;nbsp;to disabled or set CONFIG_I2C=n in your prj conf (I believe either one of those two should be enough). There are some considerations when using nrfx drivers directly, so I suggest you refer to the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.0.0/zephyr/samples/boards/nrf/nrfx/README.html"&gt;nrfx use example&lt;/a&gt;&amp;nbsp;if you want to do that (it is not specific for TWIM, though).&lt;/p&gt;
&lt;p&gt;That said, in most cases it would probably make more sense to use Zephyr&amp;#39;s I2C API. That is explained in &lt;a href="https://academy.nordicsemi.com/lessons/lesson-6-serial-com-i2c/"&gt;Lesson 6 – Serial communication (I2C&lt;/a&gt;) in the &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/"&gt;nRF Connect SDK Fundamentals&lt;/a&gt;&amp;nbsp;course.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI I2C driver gives success code but no data is sent</title><link>https://devzone.nordicsemi.com/thread/374982?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 21:25:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3efde7c-e592-4792-a2bc-4e4f2e280102</guid><dc:creator>EthanDP</dc:creator><description>&lt;p&gt;I have managed to narrow down the problem. When I am initializing TWI I am getting NRFX_ERROR_INVALID_STATE. As for how to resolve this I am unsure, but now I know the source of the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>