<?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: SPI Read Not Working in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597752#M89690</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;Raymundo Velarde&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;I think your right. To Read the data from slave, I need sent the dummy data to slave.&lt;/P&gt;&lt;P&gt;I use the SPI_IOC_MESSAGE(1) ,&amp;nbsp;and fill the tx_buf with "0", then the clock is generated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 09 Oct 2016 04:42:15 GMT</pubDate>
    <dc:creator>jiehunt</dc:creator>
    <dc:date>2016-10-09T04:42:15Z</dc:date>
    <item>
      <title>SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597746#M89684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use the i.mx sabreauto board to communicate to the other board with SPI interface.&lt;/P&gt;&lt;P&gt;But, I cannot get the data from SPI Interface.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the&amp;nbsp;oscilloscope to check the CLK signal, and the write operation can generate&amp;nbsp;the CLK signal,&lt;/P&gt;&lt;P&gt;but the read one cannot.&lt;/P&gt;&lt;P&gt;Linux version is&amp;nbsp;Linux version 4.1.15-1.1.1&lt;/P&gt;&lt;P&gt;CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7)&lt;/P&gt;&lt;P&gt;Please, give some hint about this issue. Thank you.&lt;/P&gt;&lt;P&gt;The test source and log is&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #ffffff; font-size: 13px;"&gt;attached.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336006"&gt;teraterm20190929182.log.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336006"&gt;spitester.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 06:51:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597746#M89684</guid>
      <dc:creator>jiehunt</dc:creator>
      <dc:date>2016-09-30T06:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597747#M89685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is correct, in master mode processor generates clock during write,&lt;/P&gt;&lt;P&gt;please check Chapter 21 Enhanced Configurable SPI (ECSPI)&lt;/P&gt;&lt;P&gt;i.MX6DQ Reference Manual &lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf"&gt;http://cache.freescale.com/files/32bit/doc/ref_manual/IMX6DQRM.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Spi test can be found in imx-test package (folder mxc_spi_test)&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.4.tar.gz" target="test_blank"&gt;www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.4.tar.gz&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 23:44:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597747#M89685</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-09-30T23:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597748#M89686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;igorpadykov,&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;I checked the document IMX6DQRM.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;21.4.4.1 Typical Master Mode&lt;/P&gt;&lt;P&gt;****&lt;BR /&gt;When the ECSPI is in Master mode the SS, SCLK, and MOSI are output signals, and the MISO signal is an input.&lt;/P&gt;&lt;P&gt;****&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It means in Master mode When&amp;nbsp;i use the READ command , the SCLK signals should be generated.&lt;/P&gt;&lt;P&gt;But in my case , the SCLK has no signals when i use the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retSize = read (fd, &amp;amp;data, sizeof(data));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also run the&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;imx-test package mxc_spi_test, and i get the error below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;./spitester_mxc -D 0 -s 1000000 -b 8&amp;nbsp;&lt;/P&gt;&lt;P&gt;Execute data transfer test: 0 1 8&lt;BR /&gt;spi mode: 0&lt;BR /&gt;bits per word: 8&lt;BR /&gt;max speed: 1000000 Hz (1000 KHz)&lt;BR /&gt;can't send spi messageCorrupted data at 0 wbuf = 56 rbuf = 0&lt;BR /&gt;Data sent : 8&lt;BR /&gt;Data received : &lt;BR /&gt;Test FAILED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;./spitester_mxc -D 0 -s 1000000 -b 8 0BFD01000000&lt;BR /&gt;Execute data transfer test: 0 &lt;STRONG&gt;12 0BFD01000000&lt;/STRONG&gt;&lt;BR /&gt;spi mode: 0&lt;BR /&gt;bits per word: 8&lt;BR /&gt;max speed: 1000000 Hz (1000 KHz)&lt;BR /&gt;Corrupted data at 0 wbuf = 48 rbuf = 0&lt;BR /&gt;Corrupted data at 1 wbuf = 66 rbuf = 0&lt;BR /&gt;Corrupted data at 2 wbuf = 70 rbuf = 0&lt;BR /&gt;Corrupted data at 3 wbuf = 68 rbuf = 0&lt;BR /&gt;Corrupted data at 4 wbuf = 48 rbuf = 0&lt;BR /&gt;Corrupted data at 5 wbuf = 49 rbuf = 0&lt;BR /&gt;Corrupted data at 6 wbuf = 48 rbuf = 0&lt;BR /&gt;Corrupted data at 7 wbuf = 48 rbuf = 0&lt;BR /&gt;Corrupted data at 8 wbuf = 48 rbuf = 0&lt;BR /&gt;Corrupted data at 9 wbuf = 48 rbuf = 0&lt;BR /&gt;Corrupted data at 10 wbuf = 48 rbuf = 0&lt;BR /&gt;Corrupted data at 11 wbuf = 48 rbuf = 0&lt;BR /&gt;Data sent : 0BFD01000000&lt;BR /&gt;Data received : &lt;BR /&gt;Test FAILED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to send 6byte to the slave and there is 12Byte.&lt;/P&gt;&lt;P&gt;and the wbuf is corrupted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls help me to resolve this problem.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 03:28:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597748#M89686</guid>
      <dc:creator>jiehunt</dc:creator>
      <dc:date>2016-10-03T03:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597749#M89687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please check for example&lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.corelis.com%2Feducation%2FSPI_Tutorial.htm" rel="nofollow" target="_blank"&gt;http://www.corelis.com/education/SPI_Tutorial.htm&lt;/A&gt;&lt;BR /&gt;"Simple SPI Read Transaction" :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This sequence is really a single-byte write followed by a two byte read;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 05:29:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597749#M89687</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2016-10-03T05:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597750#M89688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Hi&amp;nbsp;igorpadykov,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Thank you for your answer.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I checked the doc&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;A data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.corelis.com%2Feducation%2FSPI_Tutorial.htm" rel="nofollow" style="color: #5e89c1; border: 0px; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;http://www.corelis.com/education/SPI_Tutorial.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;"Simple SPI Read Transaction"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN&gt;But,&amp;nbsp;&lt;/SPAN&gt;I still think the driver(or hardware) is weird.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Because i&amp;nbsp;use the same example&amp;nbsp;&lt;A _jive_internal="true" href="https://community.nxp.com/servlet/JiveServlet/download/435794-1-393742/spitester.c.zip"&gt;spitester.c.zip&lt;/A&gt;&amp;nbsp;i attached before,It works on&amp;nbsp;raspberrypi.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Both of write/read operation and&amp;nbsp;spi_ioc_massage(2)(read after write) operation can give the right response from slave device.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Oct 2016 10:29:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597750#M89688</guid>
      <dc:creator>jiehunt</dc:creator>
      <dc:date>2016-10-03T10:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597751#M89689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In 3-wire (clk, tx, rx) spi protocol a read is done during the write.&lt;/P&gt;&lt;P&gt;The read function (Chip_SSP_ReceiveFrame() or Chip_SPI_ReceiveFrame())call just returns the data that went in the fifo during the last write.&lt;/P&gt;&lt;P&gt;If you need to read after sending&amp;nbsp;a command (reading spi flash for example ), you will need to write "dummy" data to clock out the data from the slave. Look at function (Chip_SSP_ReadFrames_Blocking() or Chip_SPI_ReadFrames_Blocking()) for reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2016 13:16:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597751#M89689</guid>
      <dc:creator>Ray_V</dc:creator>
      <dc:date>2016-10-07T13:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597752#M89690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;Raymundo Velarde&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;I think your right. To Read the data from slave, I need sent the dummy data to slave.&lt;/P&gt;&lt;P&gt;I use the SPI_IOC_MESSAGE(1) ,&amp;nbsp;and fill the tx_buf with "0", then the clock is generated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Oct 2016 04:42:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/597752#M89690</guid>
      <dc:creator>jiehunt</dc:creator>
      <dc:date>2016-10-09T04:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: SPI Read Not Working</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/1154205#M161942</link>
      <description>&lt;P&gt;Fifo during the last write it's good way in this topic and the crucial thing &lt;A href="https://911electronic.com/spi-communication-how-spi-works/" target="_self"&gt;how spi works&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 13:22:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/SPI-Read-Not-Working/m-p/1154205#M161942</guid>
      <dc:creator>Galeom12</dc:creator>
      <dc:date>2020-09-16T13:22:14Z</dc:date>
    </item>
  </channel>
</rss>

