<?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>Kinetis MicrocontrollersのトピックRe: UART0 to UART1 DMA transfer</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290047#M11501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Safwat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have your setup working on my dev. board. (UART0-UART1 w/ polling UART1_S1). I will look into why the polling is necessary, and if there is a way around it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jun 2013 20:27:27 GMT</pubDate>
    <dc:creator>martynhunt</dc:creator>
    <dc:date>2013-06-14T20:27:27Z</dc:date>
    <item>
      <title>UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290040#M11494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a KL15 device and one part of the end application requires the MCU to pass half/full duplex data between uart0 and uart1. The speed can go upto 500kbps. So I am trying to setup two DMA channels to do this. I have reused code from FRDM sample code package... specifically from the low power uart demo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is how my dma channels and UARTS are setup:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. DMA channel 0 is set up to transfer data from UART0_D to UART1_D.Cycle steal is on and triggering is done by UART0 byte receive event (UART0_C4-&amp;gt;RDMAE bit is set)&lt;/P&gt;&lt;P&gt;2. DMA channel 1 is set up to transfer data from UART1_D to UART0_D. Cycle steal is on and trigger is done by UART1 byte receive event (UART1_C5-&amp;gt; RDMAS bit and UART1_C2 -&amp;gt; RIE bit are set)&lt;/P&gt;&lt;P&gt;3. Both DMA channels are initially loaded with a BCR value of 0F_FFFFh to get lowest interrupts.&lt;/P&gt;&lt;P&gt;4. Both DMA transfer complete interrupts writes a 1 to the DONE bit and then reloads the BCR with 0F_FFFFh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get data from UART1 to UART0 without any problem or corruption. But I cannot get it the other way around. Data that streamed into UART0 does not get streamed out at UART1. If I configure the DMA0 to have UART0_D address for both source and destination, I get echos in my terminal as expected.&lt;/P&gt;&lt;P&gt;I cannot pinpoint the reason why the DMA isn't working when destination register is UART1. Both of the UART are at same baud rate(currently 9600) and same data format (8N1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if this is a normal use case for transferring data between uarts. I was thinking if its a good idea to use a internal buffer between the two uarts. Please advice if there are better or proper ways to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks to whoever reads and helps :smileyhappy:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 08:26:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290040#M11494</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2013-06-13T08:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290041#M11495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some questions, so I can get a better understanding of how you are setting up your DMA channels and UARTs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you mean UART0_C5-&amp;gt;RDMAE &amp;amp; UART1_C4-&amp;gt;RDMAS? Also, you should not have to enable HW interrupts on your UART1 while using DMA. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How are you configuring your DMA channels? Are you setting DMAMUX0_CHCFG0 to the correct source for transmit and receive?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 18:13:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290041#M11495</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-06-13T18:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290042#M11496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martyn, Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I do &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;mean UART0_C5-&amp;gt;RDMAE &amp;amp; UART1_C4-&amp;gt;RDMAS&lt;/SPAN&gt;. Mistakenly swapped the register names in the original post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The DMA_Init routine for UART0 to UART1 (not working data direction) is as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_13711738739143754 jive_text_macro jive_macro_code" jivemacro_uid="_13711738739143754"&gt;
&lt;P&gt;void UART0to1_DMA_Init(){&lt;/P&gt;
&lt;P&gt;// Setting up the NVIC for DMA0 interrupt&lt;/P&gt;
&lt;P&gt;&amp;nbsp; NVIC_ICPR |= (0x01);&amp;nbsp;&amp;nbsp; // Clear any pending interrupt for DMA0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; NVIC_ISER |= (0x01);&amp;nbsp; // Enable the interrupt for DMA0 module&lt;/P&gt;
&lt;P&gt;&amp;nbsp; NVIC_IPR0 |= (0x02&amp;lt;&amp;lt;6); // Set the priority to be 2&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Enable the clock to DMA MUX and DMA */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SIM_SCGC6 |= SIM_SCGC6_DMAMUX_MASK;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SIM_SCGC7 |= SIM_SCGC7_DMA_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Disable the DMA0 channel&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = 0x00;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Clear pending errors or the done bit for channel 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if (((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_DONE_MASK) == DMA_DSR_BCR_DONE_MASK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | ((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_BES_MASK) == DMA_DSR_BCR_BES_MASK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | ((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_BED_MASK) == DMA_DSR_BCR_BED_MASK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | ((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_CE_MASK) == DMA_DSR_BCR_CE_MASK))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DMA_DSR_BCR0 |= DMA_DSR_BCR_DONE_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Set Source Address for DMA0&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_SAR0 = 0x4006A007;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Set DMA byte counter&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DSR_BCR0 = DMA_DSR_BCR_BCR(0xFFFFF);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Clear the bits config bits&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DCR0 &amp;amp;= ~(DMA_DCR_SSIZE_MASK| DMA_DCR_DSIZE_MASK);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Set the transfer attributes&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DCR0 |= (DMA_DCR_EINT_MASK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_SSIZE(1)&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_DSIZE(1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_CS_MASK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_ERQ_MASK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Set Destination Address&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DAR0 =&amp;nbsp; 0x4006B007;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Enables the DMA channel and select the DMA Channel Source&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = 0x02;&amp;nbsp; // Source set to uart0 receive&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 |= DMAMUX_CHCFG_ENBL_MASK;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The DMA interrupt handler is as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13711738738933896" jivemacro_uid="_13711738738933896"&gt;
&lt;P&gt;void DMA0_IRQHandler()&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Clear pending errors or the done bit&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if (((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_DONE_MASK) == DMA_DSR_BCR_DONE_MASK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | ((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_BES_MASK) == DMA_DSR_BCR_BES_MASK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | ((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_BED_MASK) == DMA_DSR_BCR_BED_MASK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | ((DMA_DSR_BCR0 &amp;amp; DMA_DSR_BCR_CE_MASK) == DMA_DSR_BCR_CE_MASK))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; DMA_DSR_BCR0 |= DMA_DSR_BCR_DONE_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; // Reload the BCR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; DMA_DSR_BCR0 = DMA_DSR_BCR_BCR(0xFFFFF);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;And finally the UART0 init (skipping the baud rate generation code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13711738738731554" jivemacro_uid="_13711738738731554"&gt;
&lt;P&gt;/* Selecting the clock source for the UART0. We are selecting the MCGFLLCLK, 24Mhz */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SIM_SOPT2 |= (0x1&amp;lt;&amp;lt;16); // Set PLLFLLSEL&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SIM_SOPT2 |= SIM_SOPT2_UART0SRC(0x01); // Set UART Source&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Enable the clock to UART0 */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SIM_SCGC4 |= SIM_SCGC4_UART0_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Enable the pins of UART output */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PORTA_PCR1 |= PORT_PCR_MUX(2); // Select the function of PTA1 to be UART0RX&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PORTA_PCR2 |= PORT_PCR_MUX(2); // Select the function of PTA2 to be UART0TX&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART0_C2 &amp;amp;= ~(UARTLP_C2_RE_MASK | UARTLP_C2_TE_MASK);&amp;nbsp;&amp;nbsp; // Turn off the receiver and transmitter&lt;/P&gt;
&lt;P&gt;/* set the baud rate registers&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART0_C2 |= (UARTLP_C2_RE_MASK | UARTLP_C2_TE_MASK); /* Enable the transmitter and receiver */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART0_C5 |= UARTLP_C5_RDMAE_MASK;&amp;nbsp;&amp;nbsp; // Turn on DMA request for UART0&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for UART1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13711738738328664" jivemacro_uid="_13711738738328664"&gt;
&lt;P&gt;/* Enable the clock to UART1 */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SIM_SCGC4 |= SIM_SCGC4_UART1_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Enable the pins of UART output */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PORTE_PCR0 |= PORT_PCR_MUX(3); // Select the function of PTE0 to be UART1TX&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PORTE_PCR1 |= PORT_PCR_MUX(3); // Select the function of PTE1 to be UART1RX&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Make sure that the Transmitter and Receiver is disabled */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART1_C2 &amp;amp;= ~(UART_C2_RE_MASK | UART_C2_TE_MASK);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART1_C1 = 0x0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set default settings&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Enable the interrupt and DMA request&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART1_C4 |= UART_C4_RDMAS_MASK; // Turning on receive DMA req&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // Enable the receive interrupt&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART1_C2 |= UART_C2_RIE_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Enable receiver and transmitter */&lt;/P&gt;
&lt;P&gt;&amp;nbsp; UART1_C2 |= (UART_C2_TE_MASK | UART_C2_RE_MASK );&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as for the requirement to turn on UART1 Receive interrupt, it is mentioned inside the RM for RDMAS:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;NOTE: If RIE is cleared, the RDRF DMA and RDRF interrupt request signals are not asserted when the&lt;/P&gt;
&lt;P&gt;RDRF flag is set, regardless of the state of RDMAS.&lt;/P&gt;
&lt;P&gt;0 If RIE is set and the RDRF flag is set, the RDRF interrupt request signal is asserted to request&lt;/P&gt;
&lt;P&gt;interrupt service.&lt;/P&gt;
&lt;P&gt;1 If RIE is set and the RDRF flag is set, the RDRF DMA request signal is asserted to request a DMA&lt;/P&gt;
&lt;P&gt;transfer.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="New Picture (3).bmp"&gt;&lt;IMG alt="New Picture (3).bmp" src="https://community.nxp.com/t5/image/serverpage/image-id/39316i983B9C046F2FBADB/image-size/large?v=v2&amp;amp;px=999" title="New Picture (3).bmp" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So to pass data from UART1 to UART0 using DMA triggered at UART1 receive (which is working) requires RIE to be set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:07:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290042#M11496</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2020-11-02T13:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290043#M11497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to add, my UARTs work in interrupt mode or polling mode, I can send and receive data through them. Its just that the interrupt overhead is high for handling data streams. All the port clocks are enabled in the MCU init code.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 01:54:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290043#M11497</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2013-06-14T01:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290044#M11498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay I have noticed something new. To debug the issue, I ripped out everything (The RTOS) from firmware and just kept the initialization listed above and a main function with a while loop. In the while loop I poll the UART1 TDRE flag to see if it ever negates. This way I would know that the DMA IS actually putting data in the UART1_D register. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Almost magically, the DMA starts working with this change. If I remove the checking of TDRE flag, it stops working. So it seems if I read the TDRE flag, the DMA is able to work. The confusing part is that I did not set up the DMA with the TDRE flag of UART1. It is triggered from the RDRF flag of UART0. Trying to find why the UART1 TDRE needs to be read for the DMA to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 04:23:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290044#M11498</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2013-06-14T04:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290045#M11499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Safwat, thanks for all the information. &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;So I have a few more questions to help me understand your setup.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Are you attempting this in full or half duplex mode? &lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;Do you also have UART0 transmitting, and UART1 receiving during this operation? (Are only UART0 RX and UART1 TX connected?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Also, how are you checking the TDRE flag (i.e. printf(), out_char())? What other flags are you seeing set at the same time? When you perform this operation in interrupt or polling mode (not DMA) what flags are you seeing when data is written to UART1_D?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 14:55:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290045#M11499</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-06-14T14:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290046#M11500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The intended end application will have full duplex operation. Meaning it will have the following operations working in parallel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[data in]--&amp;gt; UART0 --&amp;gt; DMA0 --&amp;gt; UART1 --&amp;gt; [data out] ....... This is NOT working properly&lt;/P&gt;&lt;P&gt;[data in]--&amp;gt; UART1 --&amp;gt; DMA1 --&amp;gt; UART0 --&amp;gt; [data out] ....... This is working properly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For debugging the issue I only set up the first direction of data flow utilizing DMA0. As I have mentioned before, In the main while loop I can just do a dummy read of UART1_S1 and the data will stream out of UART1_D. This is what I initially had in the main while loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13712239024409284 jive_macro_code" jivemacro_uid="_13712239024409284"&gt;
&lt;P&gt;while(1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if( UART1_S1 &amp;amp; UART_S1_TDRE_MASK)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uart0_putchar('E'); // Just send out something to the terminal&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where uart0_putchar is a polled send function for the uart0. I have later changed the code to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13712239024235272 jive_macro_code" jivemacro_uid="_13712239024235272"&gt;
&lt;P&gt;uint8_t Dummy;&lt;/P&gt;
&lt;P&gt;while(1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dummy = UART1_S1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which also works. I am not sure about the actual value of UART1_S1. I will check and post again. Would be great if you could create a simple setup between UART0 and UART1 and test if there is really any issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards. Safwat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 15:30:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290046#M11500</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2013-06-14T15:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290047#M11501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Safwat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have your setup working on my dev. board. (UART0-UART1 w/ polling UART1_S1). I will look into why the polling is necessary, and if there is a way around it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 20:27:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290047#M11501</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-06-14T20:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290048#M11502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So it looks like a possible work around is to reverse the DMA request, so that the UART1 TX channel drives the request. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13712499122266437" jivemacro_uid="_13712499122266437" modifiedtitle="true"&gt;
&lt;P&gt;DMAMUX0_CHCFG0 = 5;&amp;nbsp;&amp;nbsp; //Select UART1 TX&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_13712499619889969 jive_text_macro jive_macro_code" jivemacro_uid="_13712499619889969" modifiedtitle="true"&gt;
&lt;P&gt;UART1_C4 |= UART_C4_TDMAS_MASK; //Turn on TX DMA request&lt;/P&gt;
&lt;P&gt;UART1_C2 |= UART_C2_TIE_MASK; //Enable TX interrupts&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way UART1 is waiting for UART0. However, you would have to handle turning the TX on and off. It will transmit 0x00 if the UART0_D is empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2013 23:03:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290048#M11502</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-06-14T23:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290049#M11503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for testing my setup martyn. Good to know that I wasn't doing something wrong. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if polling is necessary to get this done, it kind of defeats the purpose of using the DMA right? Data transfer is not happening without CPU intervention. Hope you can help me find if this scenario is expected or its a bug of some sort. Does it happen in other parts with similar DMA+UART peripheral?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have thought of using your workaround method also. But I am trying to find the most efficient way to control turning on and off the TX DMA for UART1. My CPU has to do other things when data transfer is going on and cannot guarantee a constant monitoring loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jun 2013 01:38:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290049#M11503</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2013-06-15T01:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290050#M11504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martyn, I was thinking of using two linked DMA channels for achieving the transfer from UART0 to UART1. After each cycle steal operation (Minor loop) from UART0_D to some RAM buffer, the DMA0 channel will link/trigger another DMA channel to perform a transfer from that buffer to UART1_D. This way, the CPU does not need to monitor anything, given that this method functions correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One question, what should the "source slot number" be for the DMA channel which is linked? I could not find this information in the RM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Jun 2013 00:26:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290050#M11504</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2013-06-16T00:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290051#M11505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Safwat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the "source slot number" you would not have to assign any number. Linking DMA0 to DMAx (where x is any other channel number) would drive the DMA request for every cycle-steal or BCR = 0, depending on how you set up the DMA linking. I had this setup working in CS mode with a BCR of 1 for the second DMA channel, and reading the UART1_S1 in the second DMA channel ISR. I will look into it further to see if there is a pure DMA method of running this operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. I have tested UART1 to UART0 on my boards as well, and it also works for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 23:28:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290051#M11505</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-06-17T23:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290052#M11506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Safwat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have good news. While it turns out that the S1 register has to be read to transmit on UART1, there is a DMA method to move data from UART0 to UART1. You need two linked DMA channels. The first channel (DMA0) should be enabled as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13717373143924242" jivemacro_uid="_13717373143924242"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_SAR0 = DMA0_SOURCE_ADDR;&amp;nbsp;&amp;nbsp; //Set source address to UART1_S1, to read S1 register after every UART0 DMA request&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DSR_BCR0 = DMA_DSR_BCR_BCR(TRANSFER_LENGTH);&amp;nbsp;&amp;nbsp; //Set BCR to know how many bytes to transfer&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DCR0 &amp;amp;= ~(DMA_DCR_SSIZE_MASK | DMA_DCR_DSIZE_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Clear source size and dstination size fields&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; /* Set DMA as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Source size is 8-bit size&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Destination size is 8-bit size&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cycle steal mode&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; External requests are enabled&lt;/P&gt;
&lt;P&gt;Interrupt on completion of transfer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Link DMA0 to DMA1, performing DMA requests every cycle-steal&lt;/P&gt;
&lt;P&gt;&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DCR0 |= (DMA_DCR_SSIZE(1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_DSIZE(1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_CS_MASK &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_ERQ_MASK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_EINT_MASK&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_LINKCC(0x2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | DMA_DCR_LCH1(0x01));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMA_DAR0 = DMA0_DESTINATION];&amp;nbsp; //Set destination address to a memory location&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 = 2;&amp;nbsp;&amp;nbsp; //Select UART0 RX as channel source&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DMAMUX0_CHCFG0 |= DMAMUX_CHCFG_ENBL_MASK;&amp;nbsp;&amp;nbsp; //Enable the DMA MUX channel&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second channel should be set up as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13717373143465741" jivemacro_uid="_13717373143465741" modifiedtitle="true"&gt;
&lt;P&gt;DMA_SAR1 = DMA1_SOURCE_ADDR;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Set source address to UART0_D register&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DMA_DSR_BCR1 = DMA_DSR_BCR_BCR(TRANSFER_LENGTH);&amp;nbsp;&amp;nbsp; //Set BCR to know how many bytes to transfer&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DMA_DCR1 &amp;amp;= ~(DMA_DCR_SSIZE_MASK | DMA_DCR_DSIZE_MASK);&amp;nbsp;&amp;nbsp;&amp;nbsp; //Clear source size and dstination size fields&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;/* Set DMA as follows:&lt;/P&gt;
&lt;P&gt;Source size is 8-bit size&lt;/P&gt;
&lt;P&gt;Destination size is 8-bit size&lt;/P&gt;
&lt;P&gt;Cycle steal mode&lt;/P&gt;
&lt;P&gt;Interrupt on completion of transfer&lt;/P&gt;
&lt;P&gt;*/&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DMA_DCR1 |= (DMA_DCR_SSIZE(1)&lt;/P&gt;
&lt;P&gt;| DMA_DCR_DSIZE(1)&lt;/P&gt;
&lt;P&gt;| DMA_DCR_CS_MASK&lt;/P&gt;
&lt;P&gt;| DMA_DCR_EINT_MASK);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DMA_DAR1 = DMA1_DESTINATION; //Set destination to UART1_D register&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DMAMUX0_CHCFG1 |= DMAMUX_CHCFG_ENBL_MASK;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your DMA interrupt handlers need only clear the "Done" bit and reset the BCR values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this works for you. Let me know if you have any questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 18:18:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290052#M11506</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-06-18T18:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290053#M11507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martyn, Sorry I could not reply earlier, was caught up with something.&lt;/P&gt;&lt;P&gt;The solution you have suggested works for me too. Even though its &lt;EM&gt;almost&lt;/EM&gt; a pure DMA operation but it still has the overhead of an interrupt at each byte which is exactly the situation I was trying to avoid in the first place. But your solution still has some benefits as the CPU does not have to poll anything and everything is automated. I have marked it as a helpful answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will you be documenting this in the errata? Or update the manual to indicate the behavior perhaps? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 03:03:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290053#M11507</guid>
      <dc:creator>Safwat</dc:creator>
      <dc:date>2013-06-20T03:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290054#M11508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Safwat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm glad that the solution will work for you. However, the most recent solution does not require an interrupt every byte.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A received character on UART0 trigers a read of UART1_S1. The contents of UART1_S1 is written to a memory location, this DMA transfer triggers a DMA request in the linked channel. The linked channel them reads UART0_D and writes it to UART1_D to transmit data. No CPU involvement using cycle steal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have it running with a BCR much greater than 1. The DMA interrupts would only occur after the BCR has been reduced to 0. There should be no CPU involvement until the BCR values have reached 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are still deciding the appropriate way to document this behavior.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martyn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 14:08:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290054#M11508</guid>
      <dc:creator>martynhunt</dc:creator>
      <dc:date>2013-06-20T14:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 to UART1 DMA transfer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290055#M11509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'trebuchet ms', geneva; color: #3a0699;"&gt;Can you folks, please post the final working code ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'trebuchet ms', geneva; color: #3a0699;"&gt;It will be helpful to the community and especially me who is trying to do this same thing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'trebuchet ms', geneva; color: #3a0699;"&gt;Thanks and Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'trebuchet ms', geneva; color: #3a0699;"&gt;Nitin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Dec 2015 22:56:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART0-to-UART1-DMA-transfer/m-p/290055#M11509</guid>
      <dc:creator>nitinharish</dc:creator>
      <dc:date>2015-12-08T22:56:11Z</dc:date>
    </item>
  </channel>
</rss>

