<?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 Ioctl spi read issue in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Ioctl-spi-read-issue/m-p/1414126#M187048</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am using imx8m mini board.&lt;/P&gt;&lt;P&gt;&amp;nbsp; We are trying to read two different spi data at a same time. but whenever we are reading two &lt;STRONG&gt;ioctl&lt;/STRONG&gt; in two different thread. We are unable to read proper data.&lt;/P&gt;&lt;P&gt;&amp;nbsp; In one spi we need to read 13000 data per second and another spi we are reading 1000 data per second at a one second interval.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If we stop one thread and another thread is running means we can able to read proper spi data. If both are running unable to read this much data and data mismatch also is there.&lt;/P&gt;&lt;P&gt;SPI Dts Configuration:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;amp;ecspi2 {
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;0&amp;gt;;
        fsl,spi-num-chipselects = &amp;lt;1&amp;gt;;
        pinctrl-names = "default";
        pinctrl-0 = &amp;lt;&amp;amp;pinctrl_ecspi2 &amp;amp;pinctrl_ecspi2_cs&amp;gt;;    
        cs-gpios = &amp;lt;&amp;amp;gpio5 13 GPIO_ACTIVE_LOW&amp;gt;;
        status = "okay";

        spidev0: spi@0 {
          reg = &amp;lt;0&amp;gt;;
          compatible = "rohm,dh2228fv";
          spi-max-frequency = &amp;lt;5000000&amp;gt;;
        };
};

&amp;amp;ecspi1 {
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;0&amp;gt;;
        fsl,spi-num-chipselects = &amp;lt;1&amp;gt;;
        pinctrl-names = "default";
        pinctrl-0 = &amp;lt;&amp;amp;pinctrl_ecspi1 &amp;amp;pinctrl_ecspi1_cs&amp;gt;;    
        cs-gpios = &amp;lt;&amp;amp;gpio5 9 GPIO_ACTIVE_LOW&amp;gt;;
        status = "okay";

        spidev1: spi@0 {
          reg = &amp;lt;0&amp;gt;;
          compatible = "dh,dhcom-board";
          spi-max-frequency = &amp;lt;8000000&amp;gt;;
        };
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;User Space Code Thread 1:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	ioctl(g_adc_fd, SPI_IOC_MESSAGE(1), &amp;amp;pt_g_current_ltrans);&lt;/LI-CODE&gt;&lt;P&gt;User Space Code Thread 2:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;		ioctl(g_acc_fd, SPI_IOC_MESSAGE(1), &amp;amp;pt_accltrans);   // Kx134&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We had tried thread synchronization also but this will reducing the data read speed.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our solution if we write own device driver for particular sensor this issue will be resolve ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please help us to solve this issue.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vasu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Feb 2022 05:37:55 GMT</pubDate>
    <dc:creator>Dhevan</dc:creator>
    <dc:date>2022-02-16T05:37:55Z</dc:date>
    <item>
      <title>Ioctl spi read issue</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Ioctl-spi-read-issue/m-p/1414126#M187048</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am using imx8m mini board.&lt;/P&gt;&lt;P&gt;&amp;nbsp; We are trying to read two different spi data at a same time. but whenever we are reading two &lt;STRONG&gt;ioctl&lt;/STRONG&gt; in two different thread. We are unable to read proper data.&lt;/P&gt;&lt;P&gt;&amp;nbsp; In one spi we need to read 13000 data per second and another spi we are reading 1000 data per second at a one second interval.&lt;/P&gt;&lt;P&gt;&amp;nbsp; If we stop one thread and another thread is running means we can able to read proper spi data. If both are running unable to read this much data and data mismatch also is there.&lt;/P&gt;&lt;P&gt;SPI Dts Configuration:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;amp;ecspi2 {
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;0&amp;gt;;
        fsl,spi-num-chipselects = &amp;lt;1&amp;gt;;
        pinctrl-names = "default";
        pinctrl-0 = &amp;lt;&amp;amp;pinctrl_ecspi2 &amp;amp;pinctrl_ecspi2_cs&amp;gt;;    
        cs-gpios = &amp;lt;&amp;amp;gpio5 13 GPIO_ACTIVE_LOW&amp;gt;;
        status = "okay";

        spidev0: spi@0 {
          reg = &amp;lt;0&amp;gt;;
          compatible = "rohm,dh2228fv";
          spi-max-frequency = &amp;lt;5000000&amp;gt;;
        };
};

&amp;amp;ecspi1 {
        #address-cells = &amp;lt;1&amp;gt;;
        #size-cells = &amp;lt;0&amp;gt;;
        fsl,spi-num-chipselects = &amp;lt;1&amp;gt;;
        pinctrl-names = "default";
        pinctrl-0 = &amp;lt;&amp;amp;pinctrl_ecspi1 &amp;amp;pinctrl_ecspi1_cs&amp;gt;;    
        cs-gpios = &amp;lt;&amp;amp;gpio5 9 GPIO_ACTIVE_LOW&amp;gt;;
        status = "okay";

        spidev1: spi@0 {
          reg = &amp;lt;0&amp;gt;;
          compatible = "dh,dhcom-board";
          spi-max-frequency = &amp;lt;8000000&amp;gt;;
        };
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;User Space Code Thread 1:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	ioctl(g_adc_fd, SPI_IOC_MESSAGE(1), &amp;amp;pt_g_current_ltrans);&lt;/LI-CODE&gt;&lt;P&gt;User Space Code Thread 2:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;		ioctl(g_acc_fd, SPI_IOC_MESSAGE(1), &amp;amp;pt_accltrans);   // Kx134&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We had tried thread synchronization also but this will reducing the data read speed.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our solution if we write own device driver for particular sensor this issue will be resolve ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please help us to solve this issue.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vasu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Feb 2022 05:37:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Ioctl-spi-read-issue/m-p/1414126#M187048</guid>
      <dc:creator>Dhevan</dc:creator>
      <dc:date>2022-02-16T05:37:55Z</dc:date>
    </item>
  </channel>
</rss>

