<?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 can&amp;#39;t transfer more than 2 bytes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74605/i2c-can-t-transfer-more-than-2-bytes</link><description>Hi, 
 I am using &amp;quot;TWI Sensor&amp;quot; example(SDK v17.0.2) as reference in our application. For multiple bytes transmission this is how I defined in &amp;quot;nrf_drv_twi_tx&amp;quot;. 
 
 Here is how the output data on the protocol analyser, first transaction contains all 5-bytes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Apr 2021 13:49:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74605/i2c-can-t-transfer-more-than-2-bytes" /><item><title>RE: I2C can't transfer more than 2 bytes</title><link>https://devzone.nordicsemi.com/thread/307517?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 13:49:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00e6ec7f-95e4-4c4f-a01b-9feb22e01db7</guid><dc:creator>Siva@Tsien</dc:creator><description>&lt;p&gt;Hi awneil,&lt;/p&gt;
&lt;p&gt;This is my main, I just managed to resolve the issue after I posted here.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();

    NRF_LOG_INFO(&amp;quot;\r\nTWI sensor example started.&amp;quot;);
    NRF_LOG_FLUSH();
    twi_init();
    
    read_chip_ID();
        
    while (true)
    {
        nrf_delay_ms(500);

        do
        {
            __WFE();
        }while (m_xfer_done == false);

        //read_sensor_data();
        read_chip_ID();
        NRF_LOG_FLUSH();
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Solution is I need to comment out &amp;quot;NRF_LOG_FLUSH();&amp;quot; in the while loop after &amp;quot;read_chip_ID();&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Siva&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C can't transfer more than 2 bytes</title><link>https://devzone.nordicsemi.com/thread/307512?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 13:41:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3895c8c-03af-4ec2-8bdb-1f66e3f8aa09</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;The code you&amp;#39;ve posted just shows a single transmission - please show how you&amp;#39;re doing the repeats...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>