<?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>S32 SDKのトピックSPI MasterTransfer()  With DMA on MPC5744P Sending Problem</title>
    <link>https://community.nxp.com/t5/S32-SDK/SPI-MasterTransfer-With-DMA-on-MPC5744P-Sending-Problem/m-p/1719863#M3300</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone！&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;There are some problems with API DSPI_MasterTransfer() generated by SDK recently, SDK version 3.03, the MCU is MPC5744P: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;DSPI is configured as a DMA transmission mode, as shown in Figure 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="575693394_0-1694342456652.png" style="width: 334px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240288iEC420E633AB76304/image-dimensions/334x322?v=v2" width="334" height="322" role="button" title="575693394_0-1694342456652.png" alt="575693394_0-1694342456652.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;When using DSPI_MasterTransfer() to send and receive data, this API is called normally in the task, but when called in the interrupt function (PIT or ADC FIFO), it will stay stuck in DSPI_GetTransferStatus();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="575693394_1-1694342630195.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240289i595420E785FA28B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="575693394_1-1694342630195.png" alt="575693394_1-1694342630195.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;I found the reason why it was called in the interrupt function because the DMA transfer was not successfully launched after the interrupt callback function, that is, the function in the following figure 3 was not executed, which will cause the DSPI state can not be updated. I tried to change the interrupt priority higher, and the result was the same. Stay where the While() judgment is.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="575693394_2-1694342753761.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240290i50D1AAA56539BE7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="575693394_2-1694342753761.png" alt="575693394_2-1694342753761.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="575693394_3-1694342806987.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240291iA13E496FC0CE0DD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="575693394_3-1694342806987.png" alt="575693394_3-1694342806987.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 4&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;I did a comparison test, set the PIT 100us interrupt without SPI status judgment (i.e., without calling DSPI_GetTransferStatus()), and found that I could read the data, but when I switched to the PWM CTU_FIFO_OVERFLOW 100us interrupt,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt; The read data is a fixed value.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt; I don't know why. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;So is there someone know where the wrong is？ Thanks a lot！&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 10 Sep 2023 10:57:21 GMT</pubDate>
    <dc:creator>DOK</dc:creator>
    <dc:date>2023-09-10T10:57:21Z</dc:date>
    <item>
      <title>SPI MasterTransfer()  With DMA on MPC5744P Sending Problem</title>
      <link>https://community.nxp.com/t5/S32-SDK/SPI-MasterTransfer-With-DMA-on-MPC5744P-Sending-Problem/m-p/1719863#M3300</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone！&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;There are some problems with API DSPI_MasterTransfer() generated by SDK recently, SDK version 3.03, the MCU is MPC5744P: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;DSPI is configured as a DMA transmission mode, as shown in Figure 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="575693394_0-1694342456652.png" style="width: 334px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240288iEC420E633AB76304/image-dimensions/334x322?v=v2" width="334" height="322" role="button" title="575693394_0-1694342456652.png" alt="575693394_0-1694342456652.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 1&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;When using DSPI_MasterTransfer() to send and receive data, this API is called normally in the task, but when called in the interrupt function (PIT or ADC FIFO), it will stay stuck in DSPI_GetTransferStatus();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="575693394_1-1694342630195.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240289i595420E785FA28B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="575693394_1-1694342630195.png" alt="575693394_1-1694342630195.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 2&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;I found the reason why it was called in the interrupt function because the DMA transfer was not successfully launched after the interrupt callback function, that is, the function in the following figure 3 was not executed, which will cause the DSPI state can not be updated. I tried to change the interrupt priority higher, and the result was the same. Stay where the While() judgment is.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="575693394_2-1694342753761.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240290i50D1AAA56539BE7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="575693394_2-1694342753761.png" alt="575693394_2-1694342753761.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="575693394_3-1694342806987.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/240291iA13E496FC0CE0DD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="575693394_3-1694342806987.png" alt="575693394_3-1694342806987.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-center"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;Figure 4&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;I did a comparison test, set the PIT 100us interrupt without SPI status judgment (i.e., without calling DSPI_GetTransferStatus()), and found that I could read the data, but when I switched to the PWM CTU_FIFO_OVERFLOW 100us interrupt,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt; The read data is a fixed value.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt; I don't know why. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;So is there someone know where the wrong is？ Thanks a lot！&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2023 10:57:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/SPI-MasterTransfer-With-DMA-on-MPC5744P-Sending-Problem/m-p/1719863#M3300</guid>
      <dc:creator>DOK</dc:creator>
      <dc:date>2023-09-10T10:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: SPI MasterTransfer()  With DMA on MPC5744P Sending Problem</title>
      <link>https://community.nxp.com/t5/S32-SDK/SPI-MasterTransfer-With-DMA-on-MPC5744P-Sending-Problem/m-p/1724699#M3310</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;DSPI status is updated in&amp;nbsp;DSPI_DRV_MasterCompleteDMATransfer which is callback function for RX DMA channel. So if RX DMA transfer is completed, its interrupt should be called if interrupt priority is higher then interrupt from which transfer was started. Try to check priorities of used interrupt.&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 11:16:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/SPI-MasterTransfer-With-DMA-on-MPC5744P-Sending-Problem/m-p/1724699#M3310</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2023-09-18T11:16:05Z</dc:date>
    </item>
  </channel>
</rss>

