<?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 LPC845 : DMA : how to load next dma_descriptor_t before transfert completion? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC845-DMA-how-to-load-next-dma-descriptor-t-before-transfert/m-p/1075246#M41424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;configured the DMA to use a ping pong buffer. Using&amp;nbsp;DMA_GetRemainingBytes() I am able to get the transfer count. I want to manually switch the DMA to the other buffer without waiting for the DMA transfer completion. How can I do this?&lt;/P&gt;&lt;P&gt;And regarding to the context of this project, I am modifying the USART DMA example from the SDK of the LPC845 in order to add a timeout. The buffers are 50 bytes long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;while (1)&lt;BR /&gt; {&lt;BR /&gt; for(volatile int i =0; i &amp;lt;1000000; i ++)&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; PRINTF("\nloop\n");&lt;/P&gt;&lt;P&gt;DMA_DisableChannelInterrupts(EXAMPLE_USART_DMA_BASEADDR, USART_RX_DMA_CHANNEL);&lt;BR /&gt; uint32_t bytes_transfered = DMA_GetRemainingBytes(EXAMPLE_USART_DMA_BASEADDR, USART_RX_DMA_CHANNEL);&lt;/P&gt;&lt;P&gt;uint32_t inta = (EXAMPLE_USART_DMA_BASEADDR-&amp;gt;CHANNEL[USART_RX_DMA_CHANNEL].XFERCFG &amp;gt;&amp;gt; 4) &amp;amp; 1UL;&lt;BR /&gt; uint32_t intb = (EXAMPLE_USART_DMA_BASEADDR-&amp;gt;CHANNEL[USART_RX_DMA_CHANNEL].XFERCFG &amp;gt;&amp;gt; 5) &amp;amp; 1UL;&lt;/P&gt;&lt;P&gt;//CODE HERE TO SWITCH TO THE OTHER BUFFER&lt;/P&gt;&lt;P&gt;DMA_EnableChannelInterrupts(EXAMPLE_USART_DMA_BASEADDR, USART_RX_DMA_CHANNEL);&lt;/P&gt;&lt;P&gt;bytes_transfered = BUF_LEN - bytes_transfered;&lt;BR /&gt; PRINTF("bytes_transfered = %d, inta = %d, intb = %d",bytes_transfered,inta,intb);&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/109847iE9A90C12A4863DB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Aug 2020 16:25:12 GMT</pubDate>
    <dc:creator>v_canoz</dc:creator>
    <dc:date>2020-08-07T16:25:12Z</dc:date>
    <item>
      <title>LPC845 : DMA : how to load next dma_descriptor_t before transfert completion?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC845-DMA-how-to-load-next-dma-descriptor-t-before-transfert/m-p/1075246#M41424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have&amp;nbsp;configured the DMA to use a ping pong buffer. Using&amp;nbsp;DMA_GetRemainingBytes() I am able to get the transfer count. I want to manually switch the DMA to the other buffer without waiting for the DMA transfer completion. How can I do this?&lt;/P&gt;&lt;P&gt;And regarding to the context of this project, I am modifying the USART DMA example from the SDK of the LPC845 in order to add a timeout. The buffers are 50 bytes long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;while (1)&lt;BR /&gt; {&lt;BR /&gt; for(volatile int i =0; i &amp;lt;1000000; i ++)&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; PRINTF("\nloop\n");&lt;/P&gt;&lt;P&gt;DMA_DisableChannelInterrupts(EXAMPLE_USART_DMA_BASEADDR, USART_RX_DMA_CHANNEL);&lt;BR /&gt; uint32_t bytes_transfered = DMA_GetRemainingBytes(EXAMPLE_USART_DMA_BASEADDR, USART_RX_DMA_CHANNEL);&lt;/P&gt;&lt;P&gt;uint32_t inta = (EXAMPLE_USART_DMA_BASEADDR-&amp;gt;CHANNEL[USART_RX_DMA_CHANNEL].XFERCFG &amp;gt;&amp;gt; 4) &amp;amp; 1UL;&lt;BR /&gt; uint32_t intb = (EXAMPLE_USART_DMA_BASEADDR-&amp;gt;CHANNEL[USART_RX_DMA_CHANNEL].XFERCFG &amp;gt;&amp;gt; 5) &amp;amp; 1UL;&lt;/P&gt;&lt;P&gt;//CODE HERE TO SWITCH TO THE OTHER BUFFER&lt;/P&gt;&lt;P&gt;DMA_EnableChannelInterrupts(EXAMPLE_USART_DMA_BASEADDR, USART_RX_DMA_CHANNEL);&lt;/P&gt;&lt;P&gt;bytes_transfered = BUF_LEN - bytes_transfered;&lt;BR /&gt; PRINTF("bytes_transfered = %d, inta = %d, intb = %d",bytes_transfered,inta,intb);&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/109847iE9A90C12A4863DB3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2020 16:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC845-DMA-how-to-load-next-dma-descriptor-t-before-transfert/m-p/1075246#M41424</guid>
      <dc:creator>v_canoz</dc:creator>
      <dc:date>2020-08-07T16:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: LPC845 : DMA : how to load next dma_descriptor_t before transfert completion?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC845-DMA-how-to-load-next-dma-descriptor-t-before-transfert/m-p/1075247#M41425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A _jive_internal="true" class="" data-content-finding="Community" data-userid="350158" data-username="v.canoz@ikalogic.com" href="https://community.nxp.com/people/v.canoz@ikalogic.com"&gt;Victor Canoz&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"I want to manually switch the DMA to the other buffer without waiting for the DMA transfer completion. How can I do this?"&lt;/P&gt;&lt;P&gt;-&amp;gt; How about stop DMA and re-config it ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2020 08:38:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC845-DMA-how-to-load-next-dma-descriptor-t-before-transfert/m-p/1075247#M41425</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2020-08-11T08:38:53Z</dc:date>
    </item>
  </channel>
</rss>

