<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1556476#M197704</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/205351"&gt;@ykrons&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;i2c-imx-lpi2c.c&lt;/STRONG&gt; driver supports &lt;STRONG&gt;DMA transfer&lt;/STRONG&gt; after the commit (&lt;WBR /&gt;f962f411ef638a6f57d4255223467c&lt;WBR /&gt;ffabb1787a) in &lt;STRONG&gt;if-5.15.52-2.1.0 Linux version :&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;"Add eDMA receive and send mode support.&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;STRONG&gt;Support to read and write data larger than 256 bytes in one frame."&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV&gt;Please upgrade to the latest Kernel version or try applying the patch from&amp;nbsp;&lt;STRONG&gt;nxp-imx&lt;/STRONG&gt; github.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;Dhruvit Vasavada&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Fri, 18 Nov 2022 12:42:03 GMT</pubDate>
    <dc:creator>Dhruvit</dc:creator>
    <dc:date>2022-11-18T12:42:03Z</dc:date>
    <item>
      <title>[iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1528633#M195663</link>
      <description>&lt;DIV class=""&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm working with a Toradex iMX8DX Colibri board and I have recently done some improvements to the lpi2c i2c driver.&lt;/P&gt;&lt;P&gt;Initially, the driver only supports reading frames smaller than 256 bytes and I have modified the driver to support any length.&lt;/P&gt;&lt;P&gt;The driver is working pretty well but it appears that sometime it is missing one byte.&lt;/P&gt;&lt;P&gt;All the bytes are properly handled at lower level: I can see good signal quality and the last byte of a frame is properly signaled with a NACK.&lt;/P&gt;&lt;P&gt;The RX FIFO size is of 16 words and the driver set RXWATER to 8 to avoid filling the FIFO. But in rare case, it seems there is a delay before the interrupt routine is triggered and when the driver read data, the FIFO is full. Usually data are read properly, but sometime one byte is missing between the chunk read from the full FIFO and the chunk read during the next interrupt.&lt;/P&gt;&lt;P&gt;As long as the frames are smaller than 256 bytes (only one read command written in the TX FIFO), no error is detected. It only appears for bigger frames (two or more read command written in the TX FIFO).&lt;/P&gt;&lt;P&gt;My questions:&lt;/P&gt;&lt;P&gt;* Is there know cases where one byte can not reach the RXFIFO? I'm expecting that the i2c bus is stalled when the FIFO is full according to Reference Manual and so no data lost.&lt;/P&gt;&lt;P&gt;* Is there know issue with the lpi2c module that can explain this behavior?&lt;/P&gt;&lt;P&gt;Find attached my patch of the current driver version.&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:57:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1528633#M195663</guid>
      <dc:creator>ykrons</dc:creator>
      <dc:date>2022-09-27T07:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1534803#M196154</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/205351"&gt;@ykrons&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;There is no known error of lpi2c as you mentioned.&lt;/P&gt;
&lt;P&gt;Could you please provide me with more information related to the issue?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Is there any particular case/scenario in which, you are facing this one-byte-related error?&lt;/LI&gt;
&lt;LI&gt;Could you please confirm if that 1 byte that is missing is lost or if you are receiving that byte in the next data transfer?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;BR /&gt;Best Regards,&lt;BR /&gt;Dhruvit.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 10:55:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1534803#M196154</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-10-10T10:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1534974#M196171</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;To reproduce the error, I'm reading in loop a big i2c command response.&lt;/P&gt;&lt;P&gt;The read frame size is of 2069 bytes, split in chunk of 256 bytes.&lt;/P&gt;&lt;P&gt;The occurrence rate is maybe 1/10000 but can vary. I have not identified what can increase or reduce it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;About the missing byte, it is lost. There are other bytes in the FIFO but not the one just after the previous data when the next ISR is triggered&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;If I spy the i2c bus I can see "0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x20" (all bytes are there)&lt;/P&gt;&lt;P&gt;and in parallel in the driver I have::&lt;/P&gt;&lt;P&gt;* Write Read command in the TXFIFO and set RXWATER to 7&lt;/P&gt;&lt;P&gt;* ISR called with "0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10" in the FIFO.&lt;/P&gt;&lt;P&gt;* Set RXWATER set to 7&lt;/P&gt;&lt;P&gt;* ISR called with "0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19" in the FIFO. Here byte 0x11 is missing at the beginning of the FIFO but was visible on i2c bus&lt;/P&gt;&lt;P&gt;* Set RXWATER to 7 to get remaining bytes as we are expecting to get 20 bytes&lt;/P&gt;&lt;P&gt;* ISR is never called because there is only 7 bytes in the FIFO&amp;nbsp; "0x1A 0x1B 0x1C 0x1D 0x1E 0x1F 0x20"&lt;/P&gt;&lt;P&gt;I have never seen it when I'm issuing a single read command and it seems to only appear when I'm queuing read commands in the TXFIFO to read more than 256 bytes. I'm only queuing a read command when more than 128 bytes of the previous read has been completed, so at worst there is one read command in the TXFIFO and one being processed.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:17:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1534974#M196171</guid>
      <dc:creator>ykrons</dc:creator>
      <dc:date>2022-10-10T15:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1541960#M196692</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/205351"&gt;@ykrons&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Could you please provide me with the steps which you followed to set the RXWATER?&lt;/P&gt;
&lt;P&gt;The &lt;EM&gt;RXWATER[16:17]&lt;/EM&gt; is a 2-bit field in the &lt;EM&gt;MFCR&lt;/EM&gt; register.&lt;BR /&gt;The Receive Data Flag will be set whenever the number of words in the receive FIFO is greater than the &lt;EM&gt;RXWATER&lt;/EM&gt; value.&lt;BR /&gt;The API "&lt;EM&gt;lpi2c_imx_set_rx_watermark&lt;/EM&gt;", either sets RXWATER to 2, or 0.&lt;BR /&gt;Kindly refer to section &lt;EM&gt;"15.7.3.1.15&amp;nbsp;Master FIFO Control Register (MFCR)"&lt;/EM&gt; in i.MX8X Applications Processor Reference Manual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;BR /&gt;Best regards,&lt;BR /&gt;Dhruvit.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 11:53:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1541960#M196692</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-10-21T11:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1541982#M196694</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I was also a bit surprised by those high values for the RXFIFO buffer size and so for RXWATER.&lt;/P&gt;&lt;P&gt;I have asked the question here: &lt;A href="https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-FIFO-buffer-sizes/m-p/1509522#M194117" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-FIFO-buffer-sizes/m-p/1509522#M194117&lt;/A&gt; and it seems another NXP support person was not so surprised.&lt;/P&gt;&lt;P&gt;So I have just supposed I'm missing some knowledge do understand some internal magic of the lpi2c block where we can extend the FIFO size ...&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 12:59:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1541982#M196694</guid>
      <dc:creator>ykrons</dc:creator>
      <dc:date>2022-10-21T12:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1545474#M196961</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/205351"&gt;@ykrons&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The &lt;EM&gt;PARAM&lt;/EM&gt; register contains parameter values that are implemented in the module.&lt;/P&gt;
&lt;P&gt;The &lt;EM&gt;MTXFIFO[3:0]&lt;/EM&gt; and &lt;EM&gt;MRXFIFO[8:11]&lt;/EM&gt; parameters are read-only parameters in the &lt;EM&gt;PARAM&lt;/EM&gt; register,&lt;BR /&gt;whose values are generally fixed at 2. which results in RXFIFO/TXFIFO size of 4 words.&lt;/P&gt;
&lt;P&gt;And that is calculated in the driver in the below part of the code.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;lpi2c_imx-&amp;gt;txfifosize = 1 &amp;lt;&amp;lt; (temp &amp;amp; 0x0f);
lpi2c_imx-&amp;gt;rxfifosize = 1 &amp;lt;&amp;lt; ((temp &amp;gt;&amp;gt; &lt;LI-EMOJI id="lia_smiling-face-with-sunglasses" title=":smiling_face_with_sunglasses:"&gt;&lt;/LI-EMOJI&gt; &amp;amp; 0x0f);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One can also use DMA if one wants to transfer more than 256 bytes of data.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can you please specify the BSP that you are using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 05:54:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1545474#M196961</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-10-28T05:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1555813#M197678</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Sorry for the delay.&lt;/P&gt;&lt;P&gt;Is there already an i2c driver available that is using DMA tranfer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using Toradex BSP 5 based on Yocto Dunfell.&lt;/P&gt;&lt;P&gt;Not sure what is the NXP BSP used.&lt;/P&gt;&lt;P&gt;Here are the refs:&lt;BR /&gt;meta-freescale = HEAD:3cb29cff92568ea835ef070490f185349d712837&lt;BR /&gt;meta-freescale-3rdparty = HEAD:c52f64973cd4043a5e8be1c7e29bb9690eb4c3e5&lt;BR /&gt;meta-freescale-distro = HEAD:5d882cdf079b3bde0bd9869ce3ca3db411acbf3b&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 12:50:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1555813#M197678</guid>
      <dc:creator>ykrons</dc:creator>
      <dc:date>2022-11-17T12:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: [iMX8X] lpi2c Sometime loose a byte when the RXFIFO is full</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1556476#M197704</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/205351"&gt;@ykrons&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;i2c-imx-lpi2c.c&lt;/STRONG&gt; driver supports &lt;STRONG&gt;DMA transfer&lt;/STRONG&gt; after the commit (&lt;WBR /&gt;f962f411ef638a6f57d4255223467c&lt;WBR /&gt;ffabb1787a) in &lt;STRONG&gt;if-5.15.52-2.1.0 Linux version :&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;"Add eDMA receive and send mode support.&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;STRONG&gt;Support to read and write data larger than 256 bytes in one frame."&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV&gt;Please upgrade to the latest Kernel version or try applying the patch from&amp;nbsp;&lt;STRONG&gt;nxp-imx&lt;/STRONG&gt; github.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;Dhruvit Vasavada&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 18 Nov 2022 12:42:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX8X-lpi2c-Sometime-loose-a-byte-when-the-RXFIFO-is-full/m-p/1556476#M197704</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2022-11-18T12:42:03Z</dc:date>
    </item>
  </channel>
</rss>

