<?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>S32K中的主题 Re: LPSPI RX DMA setup (non-PIT-triggered)</title>
    <link>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1769533#M29350</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;well, I overlooked that too, but it is stated within the RM, as you wrote. Answer can be simple... It is implemented this way.&lt;BR /&gt;A S32K344_DMAMUX.h should follow this. If not, user need to be care in using right register.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2023 07:15:39 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2023-12-06T07:15:39Z</dc:date>
    <item>
      <title>LPSPI RX DMA setup (non-PIT-triggered)</title>
      <link>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1761233#M28842</link>
      <description>&lt;P&gt;I'm using a S32K344 EVB and trying to setup the DMA to transfer from the LPSPI RX buffer, but not using the PIT-based trigger.&amp;nbsp; I am sending 1 command word to a sensor and receiving back at least 2 words of data, and I want to have these automatically transferred to memory whenever the transaction takes place (not periodically).&lt;/P&gt;&lt;P&gt;My understanding on how to enable DMA transfers from reading the Reference Manual:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Receive Data DMA Enable (LPSPI DER)&lt;/LI&gt;&lt;LI&gt;DMAMUX enabled with correct source (46 for LPSPI1)&lt;/LI&gt;&lt;LI&gt;TCD set with proper source and destination addresses, offset, etc.&lt;/LI&gt;&lt;LI&gt;Enable DMA Request (TCD_CH0_CSR, ERQ bit)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I'm assuming the LPSPI Status Register, (RDF bit) is the peripheral trigger to the DMAMUX, and that routes the request to the eDMA Engine, and this is what kicks off the data transfer.&amp;nbsp; Is that correct?&amp;nbsp; Is there any software intervention required, like an ISR needed to clear any flags?&amp;nbsp; Or does it transfer everytime the RDF flag is pulsed?&lt;/P&gt;&lt;P&gt;I verified the SPI is working as expected with a logic analyzer and am able to see the RDR register has data in it from my sensor and the RDF flag set, but I don't see any data in the destination memory location.&lt;/P&gt;&lt;P&gt;I have attached my code, for reference.&amp;nbsp; Please help to point out what I might have missed.&lt;/P&gt;&lt;P&gt;-Alex&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 21:49:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1761233#M28842</guid>
      <dc:creator>alex_baril</dc:creator>
      <dc:date>2023-11-21T21:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: LPSPI RX DMA setup (non-PIT-triggered)</title>
      <link>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1762606#M28923</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;your understanding is correct. the Receive Data Flag (SR[RDF]) is set when the number of words in the receive FIFO is greater than RXWATER. For default RXWATER=0 and your 48bit frame size there should be 2 words in RXFIFO so you should set DMA to read single word per DMA request, there should be 2 DMA requests from LPSPI. You should modify TCD little bit&lt;/P&gt;
&lt;P&gt;IP_TCD-&amp;gt;TCD0_DLAST_SGA = -8;&lt;BR /&gt;// Last destination address adjustment after a major loop&lt;/P&gt;
&lt;P&gt;IP_TCD-&amp;gt;NBYTES0.TCD0_NBYTES_MLOFFNO = 4;&lt;BR /&gt;// 12 bytes per a minor loop&lt;/P&gt;
&lt;P&gt;IP_TCD-&amp;gt;CITER0.TCD0_CITER_ELINKNO = 2;&lt;BR /&gt;IP_TCD-&amp;gt;BITER0.TCD0_BITER_ELINKNO = 2;&lt;BR /&gt;// 1 major/2 minor loop&lt;BR /&gt;&lt;BR /&gt;You can check within debugger if setting of TCD is really a desired one, then after transfer check if channel interrupt flag is set and DONE bit as well.&lt;/P&gt;
&lt;P&gt;Also cache enabled could be a reason you see no data in destination buffer, put buffer in noncacheable area&lt;BR /&gt;__attribute__(( aligned(32) )) uint32 RxMasterBuffer[20] __attribute__ ((section (".mcal_bss_no_cacheable")));&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 10:00:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1762606#M28923</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2023-11-23T10:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: LPSPI RX DMA setup (non-PIT-triggered)</title>
      <link>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1763506#M28984</link>
      <description>&lt;P&gt;Thanks for the reply, Petr.&amp;nbsp; I will try your suggestions and reply again with the results.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Nov 2023 01:02:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1763506#M28984</guid>
      <dc:creator>alex_baril</dc:creator>
      <dc:date>2023-11-25T01:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: LPSPI RX DMA setup (non-PIT-triggered)</title>
      <link>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1769159#M29329</link>
      <description>&lt;P&gt;Hi Petr,&lt;/P&gt;&lt;P&gt;Thanks again for the help.&amp;nbsp; I found the issue and I have the DMA working as expected, but I am hoping you can help me understand a little better.&amp;nbsp; Here is the change I made that enabled the DMA to work:&lt;/P&gt;&lt;P&gt;changed IP_DMAMUX_0-&amp;gt;CHCFG[&lt;STRONG&gt;0&lt;/STRONG&gt;] = 0xAE&amp;nbsp; &amp;nbsp; &amp;nbsp;to&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IP_DMAMUX_0-&amp;gt;CHCFG[&lt;STRONG&gt;3&lt;/STRONG&gt;] = 0xAE&lt;/P&gt;&lt;P&gt;I noticed in the "Watch registers" tab that CHCFG0 address is 0x4028000&lt;STRONG&gt;3&amp;nbsp;&lt;/STRONG&gt;while CHCFG3 address is 0x4028000&lt;STRONG&gt;0&lt;/STRONG&gt;.&amp;nbsp; After I noticed this and made the change, I also read in the datasheet the register address offset is the same as reflected above, so this was my fault for not noticing.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So then my questions is why is the address offset not lined up as CHCFG0 = 0, CHCFG1 = 1, etc.; and why is the S32K344_DMAMUX.h also not reflecting this same offset convention?&lt;/P&gt;&lt;P&gt;Thanks, -Alex&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 16:17:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1769159#M29329</guid>
      <dc:creator>alex_baril</dc:creator>
      <dc:date>2023-12-05T16:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: LPSPI RX DMA setup (non-PIT-triggered)</title>
      <link>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1769533#M29350</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;well, I overlooked that too, but it is stated within the RM, as you wrote. Answer can be simple... It is implemented this way.&lt;BR /&gt;A S32K344_DMAMUX.h should follow this. If not, user need to be care in using right register.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 07:15:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPSPI-RX-DMA-setup-non-PIT-triggered/m-p/1769533#M29350</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2023-12-06T07:15:39Z</dc:date>
    </item>
  </channel>
</rss>

