<?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: EDMA with UART5 on Tower K64 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/EDMA-with-UART5-on-Tower-K64/m-p/802014#M48762</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kenny&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The K64 UARTs 4 and 5 have a single DMA channel and so one can use either Rx DMA or Tx DMA on each but not both at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Dec 2018 04:18:10 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2018-12-15T04:18:10Z</dc:date>
    <item>
      <title>EDMA with UART5 on Tower K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/EDMA-with-UART5-on-Tower-K64/m-p/802013#M48761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the Tower system with a K64 and serial board. Starting with the EDMA UART example that comes with SDK 2.4.2 I modified the defines to use UART5 (the UART that connects to the serial board RS-232 level shifter). I simplified the body of the example in the following way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;UART_ReceiveEDMA(DEMO_UART, &amp;amp;g_uartEdmaHandle, &amp;amp;receiveXfer);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;U32 count = ~0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;while (1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; U32 subcount;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; UART_TransferGetReceiveCountEDMA(DEMO_UART, &amp;amp;g_uartEdmaHandle, &amp;amp;subcount);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; if (subcount != count)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count = subcount;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf("Count: %d\n", count);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; sleep(10);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, sans-serif;"&gt;When I connect to a terminal emulator I can see the message sent using UART_SendEDMA (not shown).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, sans-serif;"&gt;If I press a key once I can see that the receive DMA buffer is immediately filled with that single character and the callback occurs. The count reported by the task remains at zero.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, sans-serif;"&gt;Is there a problem with using UART5? I noticed that there are not separate&amp;nbsp;enumerations for RX and TX in the DMA MUX definition as there are for some UARTs but only kDmaRequestMux0UART5.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="color: #bbbbbb; background-color: #002b36; font-weight: normal; font-size: 12px;"&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;DEMO_UART&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; UART5&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;DEMO_UART_CLKSRC&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #cb4b16;"&gt;kCLOCK_BusClk&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;DEMO_UART_CLK_FREQ&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d33682;"&gt;60'000'000&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;UART_TX_DMA_CHANNEL&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d33682;"&gt;0U&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;UART_RX_DMA_CHANNEL&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d33682;"&gt;1U&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;EXAMPLE_UART_DMAMUX_BASEADDR&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; DMAMUX0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;EXAMPLE_UART_DMA_BASEADDR&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; DMA0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;UART_TX_DMA_REQUEST&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #cb4b16;"&gt;kDmaRequestMux0UART5&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;UART_RX_DMA_REQUEST&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #cb4b16;"&gt;kDmaRequestMux0UART5&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #859900;"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #268bd2;"&gt;ECHO_BUFFER_LENGTH&lt;/SPAN&gt;&lt;SPAN style="color: #b58900;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #d33682;"&gt;8&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, helvetica, sans-serif;"&gt;Reading elsewhere it seems that there is no way to pull data from the receive buffer until the exact number is specified. I found this surprising as very often the number of bytes is unknown. For example, I am reading from a bar code scanner and the code ends with a carriage return. So I need the ability to pull data out of the buffer until I see that character.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Dec 2018 00:39:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/EDMA-with-UART5-on-Tower-K64/m-p/802013#M48761</guid>
      <dc:creator>razed11</dc:creator>
      <dc:date>2018-12-15T00:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: EDMA with UART5 on Tower K64</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/EDMA-with-UART5-on-Tower-K64/m-p/802014#M48762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kenny&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The K64 UARTs 4 and 5 have a single DMA channel and so one can use either Rx DMA or Tx DMA on each but not both at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Dec 2018 04:18:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/EDMA-with-UART5-on-Tower-K64/m-p/802014#M48762</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-12-15T04:18:10Z</dc:date>
    </item>
  </channel>
</rss>

