<?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 Using ECSPI from the i.MX8MM Cortex-M4 in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1657702#M206561</link>
    <description>&lt;P&gt;I am having trouble using the ECSPI from the Cortex-M4 of the i.MX8MM with the functions available in fsl_ecspi.c.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eventually, I need to communicate with complex ADC and DAC devices.&amp;nbsp; To try and simplify things to prove the interface I have gone back to an SPI flash device and trying to read the manufacturer ID.&amp;nbsp; The flash data sheet shows the following diagram:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-25 at 14.05.00.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224870i59E8724B472A066A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-25 at 14.05.00.png" alt="Screenshot 2023-05-25 at 14.05.00.png" /&gt;&lt;/span&gt;Looking at the SPI bus on a logic analyser I don't ever seem to see any data coming from the device.&amp;nbsp; I appear to have 4 bytes being written to the slave device and the CS# going high then low between each byte being sent.&lt;/P&gt;&lt;P&gt;The setup of the ESCPI controller is as per the SDK sample:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;/* Master config:&lt;BR /&gt;* masterConfig.channel = kECSPI_Channel0;&lt;BR /&gt;* masterConfig.burstLength = 8;&lt;BR /&gt;* masterConfig.samplePeriodClock = kECSPI_spiClock;&lt;BR /&gt;* masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;&lt;BR /&gt;* masterConfig.chipSelectDelay = 0;&lt;BR /&gt;* masterConfig.samplePeriod = 0;&lt;BR /&gt;* masterConfig.txFifoThreshold = 1;&lt;BR /&gt;* masterConfig.rxFifoThreshold = 0;&lt;BR /&gt;*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;ECSPI_MasterGetDefaultConfig(&amp;amp;masterConfig);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;ECSPI_MasterInit(EXAMPLE_ECSPI_MASTER_BASEADDR, &amp;amp;masterConfig, ECSPI_MASTER_CLK_FREQ);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Anyone got any ideas how I make this work?&lt;/P&gt;&lt;P&gt;-Andy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 May 2023 13:15:26 GMT</pubDate>
    <dc:creator>wonk-andy</dc:creator>
    <dc:date>2023-05-25T13:15:26Z</dc:date>
    <item>
      <title>Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1657702#M206561</link>
      <description>&lt;P&gt;I am having trouble using the ECSPI from the Cortex-M4 of the i.MX8MM with the functions available in fsl_ecspi.c.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eventually, I need to communicate with complex ADC and DAC devices.&amp;nbsp; To try and simplify things to prove the interface I have gone back to an SPI flash device and trying to read the manufacturer ID.&amp;nbsp; The flash data sheet shows the following diagram:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-25 at 14.05.00.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224870i59E8724B472A066A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-25 at 14.05.00.png" alt="Screenshot 2023-05-25 at 14.05.00.png" /&gt;&lt;/span&gt;Looking at the SPI bus on a logic analyser I don't ever seem to see any data coming from the device.&amp;nbsp; I appear to have 4 bytes being written to the slave device and the CS# going high then low between each byte being sent.&lt;/P&gt;&lt;P&gt;The setup of the ESCPI controller is as per the SDK sample:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;/* Master config:&lt;BR /&gt;* masterConfig.channel = kECSPI_Channel0;&lt;BR /&gt;* masterConfig.burstLength = 8;&lt;BR /&gt;* masterConfig.samplePeriodClock = kECSPI_spiClock;&lt;BR /&gt;* masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;&lt;BR /&gt;* masterConfig.chipSelectDelay = 0;&lt;BR /&gt;* masterConfig.samplePeriod = 0;&lt;BR /&gt;* masterConfig.txFifoThreshold = 1;&lt;BR /&gt;* masterConfig.rxFifoThreshold = 0;&lt;BR /&gt;*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;ECSPI_MasterGetDefaultConfig(&amp;amp;masterConfig);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;ECSPI_MasterInit(EXAMPLE_ECSPI_MASTER_BASEADDR, &amp;amp;masterConfig, ECSPI_MASTER_CLK_FREQ);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Anyone got any ideas how I make this work?&lt;/P&gt;&lt;P&gt;-Andy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 13:15:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1657702#M206561</guid>
      <dc:creator>wonk-andy</dc:creator>
      <dc:date>2023-05-25T13:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1657955#M206589</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I do not understand clearly which part is not responding, I believe it is the slave right?&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I think it would be better to try an ECSPI example, i.e. b2b_transfer so you could see the SPI bus with you analyzer.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Aldo.&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 23:15:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1657955#M206589</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2023-05-25T23:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1658136#M206611</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/171173"&gt;@AldoG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me try to explain better...&lt;/P&gt;&lt;P&gt;The ECSPI interface is being configured as per the driver/ecspi/polling_b2b_transfer/master example in the SDK (I have SDK v2.11.0).&amp;nbsp; I then run the following code to try to query the SPI flash for it's manufacturer ID:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt; ulTxBuf[&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;] = { &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; };&amp;nbsp; // One byte to send for read ID&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;uint32_t&lt;/SPAN&gt;&lt;SPAN&gt; ulRxBuf[&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;] = { &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt; }; // Three bytes returned.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;ulTxBuf[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;] = &lt;/SPAN&gt;&lt;SPAN&gt;0x9f&lt;/SPAN&gt;&lt;SPAN&gt;; // Read ID cmd/&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;masterXfer.txData = ulTxBuf;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;masterXfer.rxData = ulRxBuf;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;masterXfer.dataSize = &lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;masterXfer.channel = kECSPI_Channel0;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;ECSPI_MasterTransferBlocking(ECSPI2, &amp;amp;masterXfer);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The output on the logic analyser shows:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-26 072333.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/224951i0D93733C79018779/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-26 072333.png" alt="Screenshot 2023-05-26 072333.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm seeing 4 bytes being sent on MOSI (the top trace) which is the correct 0x9f byte followed by three random values, nothing ever on MISO and the slave select / enable pin (channel 2) is transitioning high then low again after every byte sent.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;What I am expecting is the 0x9f being sent on MOSI, three bytes 0x1f, 0x45, and 0x01 being received on MISO and the enable pin to stay low the whole transfer.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-Andy.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-Andy.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 26 May 2023 06:41:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1658136#M206611</guid>
      <dc:creator>wonk-andy</dc:creator>
      <dc:date>2023-05-26T06:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1660209#M206824</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Thank you for sharing more information, from the piece of code you have shared and the analyzer image, it seems that the output you're seeing after 0x9f are random stuff because you have set a datasize of 4.&lt;BR /&gt;masterXfer.dataSize =&amp;nbsp;4;&lt;BR /&gt;&lt;BR /&gt;Since only the first byte have a value the other 3 bytes will be dummy data, and you could see this in the ecspi driver located at: SDK_2_11_0_EVK-MIMX8MM\devices\MIMX8MM6\drivers\fsl_ecspi.c&lt;BR /&gt;&lt;BR /&gt;while (xfer-&amp;gt;dataSize &amp;gt; 0UL)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* ECSPI will transmit and receive at the same time, if txData is NULL,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * instance will transmit dummy data, the dummy data can be set by user.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * if rxData is NULL, data will be read from RX FIFO buffer, but the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * data will be ignored by driver.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Note that, txData and rxData cannot be both NULL.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state = ECSPI_WriteBlocking(base, xfer-&amp;gt;txData, dataCounts);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (kStatus_Success != state)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return state;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (NULL != xfer-&amp;gt;txData)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xfer-&amp;gt;txData += dataCounts;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state = ECSPI_ReadBlocking(base, xfer-&amp;gt;rxData, dataCounts);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (kStatus_Success != state)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return state;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (NULL != xfer-&amp;gt;rxData)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xfer-&amp;gt;rxData += dataCounts;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xfer-&amp;gt;dataSize -= dataCounts;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;Also, if you need the SS to stay active, you'll need to have SS_CTL clear and after looking into the driver code this is not supported, but that does not mean it could not be added on your side, you may refer to the reference manual for more information on this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AldoG_1-1685480024190.png" style="width: 618px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/225492i0D2F74588967D321/image-dimensions/618x463?v=v2" width="618" height="463" role="button" title="AldoG_1-1685480024190.png" alt="AldoG_1-1685480024190.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please refer to the fsl_ecspi.c function:&lt;BR /&gt;void ECSPI_SetChannelConfig(ECSPI_Type *base, ecspi_channel_source_t channel, const ecspi_channel_config_t *config)&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Aldo.&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 20:55:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1660209#M206824</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2023-05-30T20:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1660882#M206877</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/171173"&gt;@AldoG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the additional information.&lt;/P&gt;&lt;P&gt;Can I just confirm that in order to keep the SS signal active I need to set the SS_CTL bit to be 0?&lt;/P&gt;&lt;P&gt;Looking at the Reference Manual and the source code for&amp;nbsp;&lt;SPAN&gt;ECSPI_MasterInit() then it looks like currently that bit is being ignored as the SMC bit in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ECSPI_CONREG is set to 1.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm guessing that means that I need to modify ECSPI_MasterInit() to make the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SMC bit configurable and if SMC bit is cleared then the transfers need to be initiated by setting the XCH bit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you confirm all of the above is correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Andy.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 14:32:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1660882#M206877</guid>
      <dc:creator>wonk-andy</dc:creator>
      <dc:date>2023-05-31T14:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1661151#M206888</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Yes, you're correct&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Aldo.&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 19:46:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1661151#M206888</guid>
      <dc:creator>AldoG</dc:creator>
      <dc:date>2023-05-31T19:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1665349#M207276</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/171173"&gt;@AldoG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for re-opening this but I have made all of the changes that I anticipated to the ECSPI functions in the SDK but I cannot get the SPI interface to work.&lt;/P&gt;&lt;P&gt;When I try to initiate the transfer, I am never seeing the slave select signal go low.&amp;nbsp; I have added some debug to&amp;nbsp;ECSPI_MasterTransferBlocking() to look at the contents of the SPI registers and they appear correct.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : In ECSPI_MasterTransferBlocking&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : Selected SPI channel 0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : burstLength = 8, dataCounts = 1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : CONREG = 0x00704511&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : CONFIGREG = 0x00010100&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : INTREG = 0x00000000&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : STATREG = 0x00000003&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;DEBUG : PERIODREG = 0x00000000&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Immediately after that debug is output I have the following added code:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; ((base-&amp;gt;CONREG &amp;amp; ECSPI_CONREG_SMC_MASK) == &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;base-&amp;gt;CONREG |= ECSPI_CONREG_XCH(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Any idea what I have missed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Andy.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 17:10:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1665349#M207276</guid>
      <dc:creator>wonk-andy</dc:creator>
      <dc:date>2023-06-07T17:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1694433#M209820</link>
      <description>&lt;P&gt;I am using i.MX8MP and Cortex M7 and I have the same issue that the SS is not going low for multiple bursts.&amp;nbsp; &amp;nbsp;The comments in fsl_ecspi.h&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;*! SS_CTL&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* 0b0000..In master mode - only one SPI burst will be transmitted.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* 0b0001..In master mode - Negate Chip Select (SS) signal between SPI bursts. Multiple SPI bursts will be&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* transmitted. The SPI transfer will automatically stop when the TXFIFO is empty.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* 0b0000..In slave mode - an SPI burst is completed when the number of bits received in the shift register is&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* equal to (BURST LENGTH + 1). Only the n least-significant bits (n = BURST LENGTH[4:0] + 1) of the first&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* received word are valid. All bits subsequent to the first received word in RXFIFO are valid.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;* 0b0001..Reserved&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Since my SPI is a master, it makes me think I need to set SS_CTL to 0x01, not zero, for multiple bursts.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My SPI CS is still low for each byte and not for the full data being sent.&amp;nbsp; So my slave doesnt see that as a full message.&amp;nbsp; Any help would be appreciated.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2023 20:06:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1694433#M209820</guid>
      <dc:creator>maryellenmclaug</dc:creator>
      <dc:date>2023-07-27T20:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1694760#M209843</link>
      <description>&lt;P&gt;I never did manage to get this to work properly using the chip select pin (SS0) configured as part of the ECSPI interface.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To work around it, I configure the pin as a GPIO:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;gpio_pin_config_t xGpioConfig = { kGPIO_DigitalOutput, 1, kGPIO_NoIntmode };

IOMUXC_SetPinMux(IOMUXC_ECSPI1_MISO_ECSPI1_MISO, 0U);
IOMUXC_SetPinConfig(IOMUXC_ECSPI1_MISO_ECSPI1_MISO, 
                    IOMUXC_SW_PAD_CTL_PAD_DSE(6U) | 
                    IOMUXC_SW_PAD_CTL_PAD_HYS_MASK);

IOMUXC_SetPinMux(IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI, 0U);
IOMUXC_SetPinConfig(IOMUXC_ECSPI1_MOSI_ECSPI1_MOSI, 
                    IOMUXC_SW_PAD_CTL_PAD_DSE(6U) | 
                    IOMUXC_SW_PAD_CTL_PAD_HYS_MASK);

IOMUXC_SetPinMux(IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK, 0U);
IOMUXC_SetPinConfig(IOMUXC_ECSPI1_SCLK_ECSPI1_SCLK, 
                    IOMUXC_SW_PAD_CTL_PAD_DSE(6U) | 
                    IOMUXC_SW_PAD_CTL_PAD_HYS_MASK |
                    IOMUXC_SW_PAD_CTL_PAD_PE_MASK);

IOMUXC_SetPinMux(IOMUXC_ECSPI1_SS0_GPIO5_IO09, 0U);
GPIO_PinInit(GPIO3, 19, &amp;amp;xGpioConfig);&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have then written a wrapper function to handle the SPI &lt;FONT face="arial,helvetica,sans-serif"&gt;transfer&lt;/FONT&gt; which in effect does the following:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Set CS_GPIO low&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;Call ECSPI_MasterTransferBlocking() for the write part of the SPI transaction with a null rxData buffer&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;If needed, call&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;ECSPI_MasterTransferBlocking() for the read part of the SPI transaction with a null txData buffer&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;SPAN&gt;Set CS_GPIO high&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;-Andy,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jul 2023 07:01:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1694760#M209843</guid>
      <dc:creator>wonk-andy</dc:creator>
      <dc:date>2023-07-28T07:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1698423#M210202</link>
      <description>&lt;P&gt;I also have same issue on M4.&lt;/P&gt;&lt;P&gt;Any configurations are not effective I thought.&lt;/P&gt;&lt;P&gt;The best is configuring independent GPIO as Chip Select if possible.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 08:13:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1698423#M210202</guid>
      <dc:creator>gabper3x</dc:creator>
      <dc:date>2023-08-03T08:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using ECSPI from the i.MX8MM Cortex-M4</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1698602#M210219</link>
      <description>&lt;P&gt;Hi - I followed wonky-andy's advice and it worked.&amp;nbsp; To note, the 32 bit transfer, it only used the bottom byte of every 32bits. Also was not what I was expecting. But this has solved my issue.&amp;nbsp; Something wrong with their driver and their examples don't use the SPI interface fully so is decieving.&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2023 12:10:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-ECSPI-from-the-i-MX8MM-Cortex-M4/m-p/1698602#M210219</guid>
      <dc:creator>maryellenmclaug</dc:creator>
      <dc:date>2023-08-03T12:10:24Z</dc:date>
    </item>
  </channel>
</rss>

