<?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>How to use I2C receive continue in Zephyr without restarting the transaction (without another start bit)?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119653/how-to-use-i2c-receive-continue-in-zephyr-without-restarting-the-transaction-without-another-start-bit</link><description>I was trying to receive some data using &amp;quot;i2c_transfer&amp;quot; then continue the receiving without starting a new transaction. 
 Stop bit was sent if I configured to use it or not. and if I try to continue the receiving the start bit and slave address will be</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Mar 2025 15:29:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119653/how-to-use-i2c-receive-continue-in-zephyr-without-restarting-the-transaction-without-another-start-bit" /><item><title>RE: How to use I2C receive continue in Zephyr without restarting the transaction (without another start bit)?</title><link>https://devzone.nordicsemi.com/thread/527231?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 15:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efc73719-ebc9-4632-a4de-2079223f5468</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My understanding is that if you don&amp;#39;t define&amp;nbsp;&lt;span&gt;I2C_MSG_STOP&lt;/span&gt;&lt;span&gt;&amp;nbsp;, then between the bytes it will not generate STOP but at the last byte it will generate a STOP. I think it&amp;#39;s mandated by the I2C Spec:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://www.nxp.com/docs/en/user-guide/UM10204.pdf"&gt;https://www.nxp.com/docs/en/user-guide/UM10204.pdf&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741879668249v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There is some ongoing discussion here, not 100% sure if it&amp;#39;s relevant to what you want to do though:&amp;nbsp;&lt;br /&gt;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/76660"&gt;github.com/.../76660&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C receive continue in Zephyr without restarting the transaction (without another start bit)?</title><link>https://devzone.nordicsemi.com/thread/527166?ContentTypeID=1</link><pubDate>Thu, 13 Mar 2025 12:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02af0f46-d3ed-46ab-8eca-5a2cca6dbd07</guid><dc:creator>Abdelrahman</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span&gt;There is my implementation&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gsi2c_msg&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;buf&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;char&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;pu8_buf&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;gsi2c_msg&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;uint32_t&lt;/span&gt;&lt;span&gt;) &lt;/span&gt;&lt;span&gt;u16_len&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;gsi2c_msg&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;flags&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;I2C_MSG_WRITE&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;b_stop&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;?&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;I2C_MSG_STOP&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;printf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;I2C Sending to 0x&lt;/span&gt;&lt;span&gt;%X&lt;/span&gt;&lt;span&gt;: &amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;u16_addr&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;for&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span&gt;uint16_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;u16_len&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;++&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;printf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;0x&lt;/span&gt;&lt;span&gt;%02X&lt;/span&gt;&lt;span&gt; &amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;pu8_buf&lt;/span&gt;&lt;span&gt;[&lt;/span&gt;&lt;span&gt;i&lt;/span&gt;&lt;span&gt;]);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;printf&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;s32_retval&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;i2c_transfer&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;gpstr_internal_i2c_dev&lt;/span&gt;&lt;span&gt; , &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;gsi2c_msg&lt;/span&gt;&lt;span&gt; , &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt; , &lt;/span&gt;&lt;span&gt;u16_addr&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;b_stop is used for choosing to send stop bit or not.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I sent the first byte with b_stop = 0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;then the second byte with b_stop = 1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;after the first byte the transaction stop:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741870410071v2.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I found this on the&amp;nbsp;&lt;a id="" href="https://docs.zephyrproject.org/latest/"&gt;https://docs.zephyrproject.org/latest/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1741870571342v3.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Is that mean &amp;quot;i2c_transfer&amp;quot; will always stop the transaction?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Is there any API I can use to&amp;nbsp;continue the receiving without starting a new transaction?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C receive continue in Zephyr without restarting the transaction (without another start bit)?</title><link>https://devzone.nordicsemi.com/thread/526718?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 10:04:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a522994f-28aa-472a-a79c-e9153d512a56</guid><dc:creator>morrison2</dc:creator><description>&lt;p&gt;Thanks for the clarification! I&amp;rsquo;d love to see how you implement the I2C_MSG_STOP flag in your code. A simple example would really help us troubleshoot! &lt;span style="color:#ffffff;"&gt;&lt;a style="color:#ffffff;" href="https://sprunkiphase-3.com"&gt;sprunki phase 3&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use I2C receive continue in Zephyr without restarting the transaction (without another start bit)?</title><link>https://devzone.nordicsemi.com/thread/526685?ContentTypeID=1</link><pubDate>Tue, 11 Mar 2025 08:27:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d2fd7b0-ccc8-4f75-b0ef-7dda2662fa45</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Abdelrahman,&amp;nbsp;&lt;br /&gt;In theory if you set the flag I2C_MSG_STOP it should therefore set the flag&amp;nbsp;NRFX_TWIM_FLAG_TX_NO_STOP in nrfx_twim driver. Then instead of connecting the SHORT LAST_TX to STOP task, it will connect the shot LAST_TX to SUSPEND task instead.&amp;nbsp;&lt;br /&gt;Could you show how you do it in the code ? Maybe provide us a simple application so we can try to reproduce the issue here.&amp;nbsp;&lt;br /&gt;Another option is to use nrfx driver directly, the samples can be found in&amp;nbsp;\modules\hal\nordic\nrfx\samples\src\nrfx_twim_twis&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>