<?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>MCUXpresso IDE中的主题 KL16Z UART peripheral menu does not enable UART2 clock DMA</title>
    <link>https://community.nxp.com/t5/MCUXpresso-IDE/KL16Z-UART-peripheral-menu-does-not-enable-UART2-clock-DMA/m-p/1302010#M7098</link>
    <description>&lt;P&gt;Hello, I'm having a bit of trouble with the GUI interface when selecting the UART2 peripheral with DMA where a HardFault is triggered upon using any UART related API such as UART_WriteBlocking.&lt;/P&gt;&lt;P&gt;Here is the UART configuration:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2021-07-03 02-10-16.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/148703i30427D6DB44F5AD7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot from 2021-07-03 02-10-16.png" alt="Screenshot from 2021-07-03 02-10-16.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot from 2021-07-03 02-10-16.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; tested it with:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;sendXfer.data = sendData;
sendXfer.dataSize = sizeof(sendData)/sizeof(sendData[0]);
UART_TransferSendDMA(UART2,&amp;amp;UART2_UART_DMA_Handle, &amp;amp;sendXfer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;triggers Hard-fault when attempting to read UART2_PERIPHERAL. So it turned out that clock for UART 2 is not enabled and had to be enabled manually be enabled like this (even though the gui config should handle this):&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    /* Init board hardware. */
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    SIM-&amp;gt;SCGC4 |= SIM_SCGC4_UART2(1);
    BOARD_InitBootPeripherals();&lt;/LI-CODE&gt;&lt;P&gt;this no longer triggers an hard-fault when calling the API functions but no output is given from UART2 so any help would really be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the pin mux for UART2:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2021-07-03 04-07-04.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/148707i3D991D1EF8C07446/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot from 2021-07-03 04-07-04.png" alt="Screenshot from 2021-07-03 04-07-04.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot from 2021-07-03 04-07-04.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 23:08:04 GMT</pubDate>
    <dc:creator>turtius</dc:creator>
    <dc:date>2021-07-02T23:08:04Z</dc:date>
    <item>
      <title>KL16Z UART peripheral menu does not enable UART2 clock DMA</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/KL16Z-UART-peripheral-menu-does-not-enable-UART2-clock-DMA/m-p/1302010#M7098</link>
      <description>&lt;P&gt;Hello, I'm having a bit of trouble with the GUI interface when selecting the UART2 peripheral with DMA where a HardFault is triggered upon using any UART related API such as UART_WriteBlocking.&lt;/P&gt;&lt;P&gt;Here is the UART configuration:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2021-07-03 02-10-16.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/148703i30427D6DB44F5AD7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot from 2021-07-03 02-10-16.png" alt="Screenshot from 2021-07-03 02-10-16.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot from 2021-07-03 02-10-16.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; tested it with:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;sendXfer.data = sendData;
sendXfer.dataSize = sizeof(sendData)/sizeof(sendData[0]);
UART_TransferSendDMA(UART2,&amp;amp;UART2_UART_DMA_Handle, &amp;amp;sendXfer);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;triggers Hard-fault when attempting to read UART2_PERIPHERAL. So it turned out that clock for UART 2 is not enabled and had to be enabled manually be enabled like this (even though the gui config should handle this):&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    /* Init board hardware. */
    BOARD_InitBootPins();
    BOARD_InitBootClocks();
    SIM-&amp;gt;SCGC4 |= SIM_SCGC4_UART2(1);
    BOARD_InitBootPeripherals();&lt;/LI-CODE&gt;&lt;P&gt;this no longer triggers an hard-fault when calling the API functions but no output is given from UART2 so any help would really be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the pin mux for UART2:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot from 2021-07-03 04-07-04.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/148707i3D991D1EF8C07446/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot from 2021-07-03 04-07-04.png" alt="Screenshot from 2021-07-03 04-07-04.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Screenshot from 2021-07-03 04-07-04.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 23:08:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/KL16Z-UART-peripheral-menu-does-not-enable-UART2-clock-DMA/m-p/1302010#M7098</guid>
      <dc:creator>turtius</dc:creator>
      <dc:date>2021-07-02T23:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: KL16Z UART peripheral menu does not enable UART2 clock DMA</title>
      <link>https://community.nxp.com/t5/MCUXpresso-IDE/KL16Z-UART-peripheral-menu-does-not-enable-UART2-clock-DMA/m-p/1302050#M7099</link>
      <description>&lt;P&gt;The problem has been fixed where no data is sent through UART2 by increasing the baud rate from 115200 to 128000 and the tx line sends the right pulses at 128000 but not 115200 which is strange.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone knows the reason why please let me know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 11:26:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-IDE/KL16Z-UART-peripheral-menu-does-not-enable-UART2-clock-DMA/m-p/1302050#M7099</guid>
      <dc:creator>turtius</dc:creator>
      <dc:date>2021-07-03T11:26:12Z</dc:date>
    </item>
  </channel>
</rss>

