<?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: Free-Running RX eDMA on K22 using SDK 2.8.2 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194534#M59040</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've already tried with EDMA_Abort.. and EDMA_Stop.. they didn't work&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2020 08:12:29 GMT</pubDate>
    <dc:creator>whata</dc:creator>
    <dc:date>2020-12-07T08:12:29Z</dc:date>
    <item>
      <title>Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194102#M59031</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using MK22F51212 and just recently upgraded to a latest SDK 2.8.2 and I'm experiencing some issues with free-running rx dma on uart 0 where rx dma path &lt;SPAN&gt;seemingly does not abort currently running rx transfer when explicitly asked to do so. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The behavior I'm targeting is as follows:&lt;/P&gt;&lt;P&gt;My tx/rx function is as follows:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void uart_write (uint8_t uart, const uint8_t *str, size_t len)
{
    uart_transfer_t tx;

    uart_rx_start (uart, true);

    if (len &amp;gt; 0)
    {
        uarts[uart].txDone = false;
        tx.data = (uint8_t*)str;
        tx.dataSize = len;

        UART_SendEDMA(uartParams[uart].base, &amp;amp;uarts[uart].handle, &amp;amp;tx);
        while (!uarts[uart].txDone);
    }
}

static void uart_rx_start (uint8_t uart, bool clear)
{
    uart_transfer_t rx;

    UART_TransferAbortReceiveEDMA(uartParams[uart].base, &amp;amp;uarts[uart].handle);
    if (clear)
        memset (&amp;amp;uarts[uart].buffer[0], 0, UART_BUF_SIZE);
        
    rx.data = &amp;amp;uarts[uart].buffer[0];
    rx.dataSize = UART_BUF_SIZE;
    UART_ReceiveEDMA(uartParams[uart].base, &amp;amp;uarts[uart].handle, &amp;amp;rx);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basic premise is that every time I call uart_write, currently ongoing rx transfer should be terminated and restarted. So rx dma transfer ideally should start re-filling the same buffer from head. What happens is for every call to uart_write rx transfer never terminates so my buffer keeps on filling up.&lt;/P&gt;&lt;P&gt;I don't remember seeing this behavior on SDK 2.5.0 on a previous project so obviously something has changed (there I was targeting UART2).&lt;/P&gt;&lt;P&gt;To illustrate:&lt;/P&gt;&lt;P&gt;I'm sending a 9 byte command and expect ~31 bytes response ( command echo + response), so after very first call to uart_write the buffer looks like this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;2000041c = 61 74 2b 63 65 72 65 67 3f 0d 0d 0a 2b 43 45 52
2000042c = 45 47 3a 20 30 2c 30 0d 0a 0d 0a 4f 4b 0d 0a&lt;/LI-CODE&gt;&lt;P&gt;Second call to uart_write with the same command and results in the following buffer contents (ideally I would expect the same result as above):&lt;/P&gt;&lt;LI-CODE lang="c"&gt;2000041c = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2000042c = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 61
2000043c = 74 2b 63 65 72 65 67 3f 0d 0d 0a 2b 43 45 52 45
2000044c = 47 3a 20 30 2c 30 0d 0a 0d 0a 4f 4b 0d 0a&lt;/LI-CODE&gt;&lt;P&gt;But for some reason rx dma transfer thinks that I have recieved 62 bytes (I did, but I have terminated the transfer with a call to UART_TransferAbortReceiveEDMA and explicitly started a new transfer, so the new count should be 31) and new data must be placed at the beginning of the buffer.&lt;/P&gt;&lt;P&gt;So my question is why doesn't my call to UART_TransferAbortReceiveEDMA actually aborts an ongoing transfer? And what can be done to fix this?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2020 23:17:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194102#M59031</guid>
      <dc:creator>whata</dc:creator>
      <dc:date>2020-12-04T23:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194298#M59036</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can try this function,&amp;nbsp;EDMA_AbortTransfer.&lt;/P&gt;
&lt;P&gt;/*!&lt;BR /&gt;* brief eDMA aborts transfer.&lt;BR /&gt;*&lt;BR /&gt;* This function disables the channel request and clear transfer status bits.&lt;BR /&gt;* Users can submit another transfer after calling this API.&lt;BR /&gt;*&lt;BR /&gt;* param handle DMA handle pointer.&lt;BR /&gt;*/&lt;BR /&gt;void EDMA_AbortTransfer(edma_handle_t *handle)&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 days after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 01:29:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194298#M59036</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-12-07T01:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194534#M59040</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've already tried with EDMA_Abort.. and EDMA_Stop.. they didn't work&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 08:12:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194534#M59040</guid>
      <dc:creator>whata</dc:creator>
      <dc:date>2020-12-07T08:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194560#M59041</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If possible, I want to get your code to test.&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 days after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 08:55:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194560#M59041</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-12-07T08:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194569#M59042</link>
      <description>&lt;P&gt;Sent as PM&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 09:04:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1194569#M59042</guid>
      <dc:creator>whata</dc:creator>
      <dc:date>2020-12-07T09:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1195037#M59054</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Try this. In function&amp;nbsp;UART_SendEDMA, Add this code&amp;nbsp; after function&amp;nbsp;EDMA_SubmitTransfer.&lt;/P&gt;
&lt;P&gt;The code is 'DMA0-&amp;gt;TCD[Your tx channel].DLAST_SGA = -1 * (xfer-&amp;gt;dataSize);'&lt;/P&gt;
&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;
&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 days after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 01:38:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1195037#M59054</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-12-08T01:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1195087#M59058</link>
      <description>&lt;P&gt;Please see the PM.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 03:14:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1195087#M59058</guid>
      <dc:creator>nxf56274</dc:creator>
      <dc:date>2020-12-08T03:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Free-Running RX eDMA on K22 using SDK 2.8.2</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1195462#M59075</link>
      <description>&lt;P&gt;This did not work, I don't see any change.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 11:32:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Free-Running-RX-eDMA-on-K22-using-SDK-2-8-2/m-p/1195462#M59075</guid>
      <dc:creator>whata</dc:creator>
      <dc:date>2020-12-08T11:32:21Z</dc:date>
    </item>
  </channel>
</rss>

