<?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: Inconsistent SPI latencies in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1693810#M209756</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/220776"&gt;@asdaposdi&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I hope you are doing well.&lt;/P&gt;
&lt;P&gt;Could you please share the waveform, and device tree node for further debugging?&lt;/P&gt;
&lt;P&gt;Please mention how you are testing it in userspace&lt;/P&gt;
&lt;P&gt;The delay between two SPI bursts can be caused by dma limitations.&lt;/P&gt;
&lt;P&gt;It seems to be expected behavior.&lt;/P&gt;
&lt;P&gt;Yes, Moving&amp;nbsp;&lt;SPAN&gt;SPI interfacing to the Cortex-M core can show improvements.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2023 05:39:23 GMT</pubDate>
    <dc:creator>Dhruvit</dc:creator>
    <dc:date>2023-07-27T05:39:23Z</dc:date>
    <item>
      <title>Inconsistent SPI latencies</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1692521#M209679</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am running Linux (Yocto) on the Variscite VAR-SOM-MX8M-PLUS (iMX8MP).&lt;/P&gt;&lt;P&gt;I need to stream large amounts of data quickly over SPI, but the time each transfer takes is very inconsistent. In general, I see:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;a large delay when starting the transfer before the first clock edge (up to hundreds of microseconds),&lt;/LI&gt;&lt;LI&gt;a large delay after the last clock edge before returning from the transfer (up to hundreds of microseconds), and&lt;/LI&gt;&lt;LI&gt;an inconsistent delay between bursts in the same transfer.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;In practice, I see that a 2048 byte transfer at 10MHz can take between 2 and 8 ms, where it should take only 8*2048/10MHz = ~1.6ms.&lt;/P&gt;&lt;P&gt;I also occasionally get -ETIMEDOUT, which seems to be the DMA transfer timing out.&lt;/P&gt;&lt;P&gt;I found &lt;A href="https://community.toradex.com/t/imx6-linux-large-and-inconsistent-latency-when-issuing-an-irq-triggered-spi-read/4472" target="_self"&gt;this thread&lt;/A&gt; with similar problems to mine, which provided several solutions that have made some improvements, including isolating a CPU for SPI work.&lt;/P&gt;&lt;P&gt;Am I hitting a hardware limitation? Would moving my SPI interfacing to the Cortex-M core fix this?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 05:35:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1692521#M209679</guid>
      <dc:creator>asdaposdi</dc:creator>
      <dc:date>2023-07-26T05:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent SPI latencies</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1693810#M209756</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/220776"&gt;@asdaposdi&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I hope you are doing well.&lt;/P&gt;
&lt;P&gt;Could you please share the waveform, and device tree node for further debugging?&lt;/P&gt;
&lt;P&gt;Please mention how you are testing it in userspace&lt;/P&gt;
&lt;P&gt;The delay between two SPI bursts can be caused by dma limitations.&lt;/P&gt;
&lt;P&gt;It seems to be expected behavior.&lt;/P&gt;
&lt;P&gt;Yes, Moving&amp;nbsp;&lt;SPAN&gt;SPI interfacing to the Cortex-M core can show improvements.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 05:39:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1693810#M209756</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-07-27T05:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent SPI latencies</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1694455#M209823</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here's the device tree node:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include "imx8mp.dtsi"
&amp;amp;ecspi2 {
    pinctrl-names = "default";
    pinctrl-0 = &amp;lt;&amp;amp;pinctrl_ecspi2&amp;gt;;
    status = "okay";
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running a kernel module (calling spi_sync_transfer), but I've tested with spidev_test by sending data and measuring on a scope.&lt;/P&gt;&lt;P&gt;Each attachment is a single 2048 byte transfer at 10MHz, including a fast example and a slow example with increasing zoom. I'm just showing the clock so you can see how long the transfer takes.&lt;/P&gt;&lt;P&gt;In fast.png, the clock is continuous with small delays between each byte.&lt;/P&gt;&lt;P&gt;In slow.png, there are large delays every 32 bytes and significant delays between each byte.&lt;/P&gt;&lt;P&gt;Is this the DMA limitation? If so, would the Cortex-M not have the same issue?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 21:49:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1694455#M209823</guid>
      <dc:creator>asdaposdi</dc:creator>
      <dc:date>2023-07-27T21:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent SPI latencies</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1695814#M209950</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/220776"&gt;@asdaposdi&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I hope you are doing well.&lt;/P&gt;
&lt;P&gt;can you please share the waveform of the CS pin with SCLK.?&lt;/P&gt;
&lt;P&gt;Please also mention the kernel version used and chip select information &amp;amp; pinctl.&lt;/P&gt;
&lt;P&gt;In DMA mode burst length is limited to word size (32 bits.)&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2023 10:08:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/1695814#M209950</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-07-31T10:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent SPI latencies</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/2020140#M232440</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the i.MX8MP SoC and have configured the SPI frequency to 25 MHz and 1 am writing 24-bit data. However, I am observing an extended CS (Chip Select) low time of approximately 2.2 µs before the SCLK (Serial Clock) starts, as seen in the captured image.&lt;/P&gt;&lt;P&gt;What steps can I take to reduce the CS low time before the SCLK begins? Any guidance or suggestions&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cs_low_time_with_sclk.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/317517iC8F535773476FD9E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cs_low_time_with_sclk.png" alt="cs_low_time_with_sclk.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2024 05:25:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Inconsistent-SPI-latencies/m-p/2020140#M232440</guid>
      <dc:creator>mehul_dabhi</dc:creator>
      <dc:date>2024-12-28T05:25:23Z</dc:date>
    </item>
  </channel>
</rss>

