<?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 UART with DMA going to Standby mode in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570827#M4081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use UART with DMA here, however I'm having some problems when I'm going to standby mode: it wouldn't go to standby.&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what I found was that if I enable DMA in my init procedure:&lt;/P&gt;&lt;P&gt;LINFlexD_0.DMATXE.R = 0xFFFF; /* enable DMA */&lt;BR /&gt; LINFlexD_0.DMARXE.R = &lt;SPAN&gt;0xFFFF&lt;/SPAN&gt;; /* enable DMA */&lt;/P&gt;&lt;P&gt;(and after that I'm not even doing anything with the actual DMA module)&lt;/P&gt;&lt;P&gt;and disable them in my prepare to go to standby procedure:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LINFlexD_0.DMATXE.R = 0; /* disable DMA */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LINFlexD_0.DMARXE.R = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;; /* disable DMA */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will NOT&amp;nbsp;be able to go to standby. If I check the registers of TXE and RXE, after the disabling, they are both 0.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, if I don't enable it from the beginning, it WILL&amp;nbsp;go to standby.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea if I'm disabling this in the wrong way?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338427"&gt;main.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Aug 2016 22:57:21 GMT</pubDate>
    <dc:creator>shijiaguo</dc:creator>
    <dc:date>2016-08-29T22:57:21Z</dc:date>
    <item>
      <title>UART with DMA going to Standby mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570827#M4081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use UART with DMA here, however I'm having some problems when I'm going to standby mode: it wouldn't go to standby.&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what I found was that if I enable DMA in my init procedure:&lt;/P&gt;&lt;P&gt;LINFlexD_0.DMATXE.R = 0xFFFF; /* enable DMA */&lt;BR /&gt; LINFlexD_0.DMARXE.R = &lt;SPAN&gt;0xFFFF&lt;/SPAN&gt;; /* enable DMA */&lt;/P&gt;&lt;P&gt;(and after that I'm not even doing anything with the actual DMA module)&lt;/P&gt;&lt;P&gt;and disable them in my prepare to go to standby procedure:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LINFlexD_0.DMATXE.R = 0; /* disable DMA */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LINFlexD_0.DMARXE.R = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;; /* disable DMA */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will NOT&amp;nbsp;be able to go to standby. If I check the registers of TXE and RXE, after the disabling, they are both 0.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, if I don't enable it from the beginning, it WILL&amp;nbsp;go to standby.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea if I'm disabling this in the wrong way?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338427"&gt;main.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Aug 2016 22:57:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570827#M4081</guid>
      <dc:creator>shijiaguo</dc:creator>
      <dc:date>2016-08-29T22:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: UART with DMA going to Standby mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570828#M4082</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;usually the pending interrupt from peripherals may block the mode transition. So ensure all peripherals interrupt flags are cleared before entering low power mode.&lt;/P&gt;&lt;P&gt;Also check the DMA is really inactive before you clear DMARXE/DMATXE registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or please share the code that shows the issue, so we can check/test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 07:47:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570828#M4082</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2016-08-30T07:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: UART with DMA going to Standby mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570829#M4083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So in order to get rid of the side effect of DMA, I didn't even call the DMA module after my UART init.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is very long and hard to extract, so I'm taking one of the examples from here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/docs/DOC-332233"&gt;Example MPC5748G Standby mode GHS614&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and adding my part of code into it. Kinda can give an idea of how I'm doing it. See the attached file in the main dialog for my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you comment out these two lines in&amp;nbsp;static void UART_initChannel0(void):&lt;/P&gt;&lt;P&gt;LINFlexD_0.DMATXE.R = 0xFFFF; /* enable DMA */&lt;BR /&gt; LINFlexD_0.DMARXE.R = 0xFFFF; /* enable DMA */&lt;/P&gt;&lt;P&gt;It should go to standby. However, if you just run the code as is, although in&amp;nbsp;the&amp;nbsp;static void UART_prepareStandby(void) function, those are disabled, it won't go to &lt;SPAN&gt;standby&lt;/SPAN&gt;.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 17:51:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570829#M4083</guid>
      <dc:creator>shijiaguo</dc:creator>
      <dc:date>2016-08-30T17:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: UART with DMA going to Standby mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570830#M4084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also I made sure that all interrupts in UART and DMA were cleared and disabled. Please see if I'm missing something. Thank you!&amp;nbsp;@&lt;A _jive_internal="true" class="" data-reactid=".i4drtb7thc.1.0.0" href="https://community.nxp.com/people/PetrS" style="color: #51626f; border: 0px; font-weight: inherit; font-size: 20px;"&gt;Petr Stancik&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 17:53:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570830#M4084</guid>
      <dc:creator>shijiaguo</dc:creator>
      <dc:date>2016-08-30T17:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: UART with DMA going to Standby mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570831#M4085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/shijiaguo"&gt;shijiaguo&lt;/A&gt;‌, seems like it matters the order in which things are done&amp;nbsp;when preparing the LINFlexD for a transition to STANDBY. Disabling the LINFlexD channel DMA before&amp;nbsp;starting to prepare does the trick. i.e. kind of following the reverse order of the driver initialization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Disable DMA First */&lt;/P&gt;&lt;P&gt;LINFlexD_0.DMATXE.R = 0; /* disable DMA */&lt;BR /&gt; LINFlexD_0.DMARXE.R = 0; /* disable DMA */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Now disable LINFlexD interrupts, clear ISR pending flags, etc&amp;nbsp;*/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 13:41:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570831#M4085</guid>
      <dc:creator>gvictorio</dc:creator>
      <dc:date>2016-08-31T13:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: UART with DMA going to Standby mode</title>
      <link>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570832#M4086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works like magic&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2016 14:48:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/UART-with-DMA-going-to-Standby-mode/m-p/570832#M4086</guid>
      <dc:creator>shijiaguo</dc:creator>
      <dc:date>2016-08-31T14:48:54Z</dc:date>
    </item>
  </channel>
</rss>

