<?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中的主题 K64 eDMA UART missing bytes</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-eDMA-UART-missing-bytes/m-p/760941#M46384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use the eDMA UART module on a Kinetis K64. Code has been based on the example from the SDK.&lt;/P&gt;&lt;P&gt;Everything works ok during normal operation, but when a bad packet is received (eg. frame error) the Kinetis stops receiving and the eDMA receive operation never completes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to be able to recover from&amp;nbsp;errors (parity, framing, noise, etc)&amp;nbsp;by discarding the data in the buffer and starting a new receive operation.&amp;nbsp;I've written some code to check status flags for errors and start a new receive operation when an error is detected;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint32_t active_flags = UART_GetStatusFlags(p_base);&lt;BR /&gt; uint32_t error_flags = kUART_NoiseErrorFlag | kUART_FramingErrorFlag | kUART_ParityErrorFlag;&amp;nbsp;&lt;BR /&gt; if (active_flags &amp;amp; error_flags)&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;UART_TransferAbortReceiveEDMA(p_base, &amp;amp;uart_edma_handle);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;UART_ClearStatusFlags(p_base, error_flags);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;uart_transfer_t xfer;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;xfer.dataSize = RX_BUF_SIZE;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;xfer.data = rx_buf;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UART_ReceiveEDMA(p_base, &amp;amp;uart_edma_handle, &amp;amp;xfer);&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This&amp;nbsp;isn't working.&amp;nbsp;After the receive operation is restarted the subsequent data coming in on the RX line gets missed.&amp;nbsp;Calls to&amp;nbsp;UART_TransferGetReceiveCountEDMA() return 0.&amp;nbsp;Eventually, after a few seconds and many bytes of missed data, it starts receiving again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas what could be causing this?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Nov 2017 08:41:09 GMT</pubDate>
    <dc:creator>nbuters</dc:creator>
    <dc:date>2017-11-09T08:41:09Z</dc:date>
    <item>
      <title>K64 eDMA UART missing bytes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-eDMA-UART-missing-bytes/m-p/760941#M46384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use the eDMA UART module on a Kinetis K64. Code has been based on the example from the SDK.&lt;/P&gt;&lt;P&gt;Everything works ok during normal operation, but when a bad packet is received (eg. frame error) the Kinetis stops receiving and the eDMA receive operation never completes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to be able to recover from&amp;nbsp;errors (parity, framing, noise, etc)&amp;nbsp;by discarding the data in the buffer and starting a new receive operation.&amp;nbsp;I've written some code to check status flags for errors and start a new receive operation when an error is detected;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint32_t active_flags = UART_GetStatusFlags(p_base);&lt;BR /&gt; uint32_t error_flags = kUART_NoiseErrorFlag | kUART_FramingErrorFlag | kUART_ParityErrorFlag;&amp;nbsp;&lt;BR /&gt; if (active_flags &amp;amp; error_flags)&lt;BR /&gt; {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;UART_TransferAbortReceiveEDMA(p_base, &amp;amp;uart_edma_handle);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;UART_ClearStatusFlags(p_base, error_flags);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;uart_transfer_t xfer;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;xfer.dataSize = RX_BUF_SIZE;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;xfer.data = rx_buf;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UART_ReceiveEDMA(p_base, &amp;amp;uart_edma_handle, &amp;amp;xfer);&amp;nbsp;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This&amp;nbsp;isn't working.&amp;nbsp;After the receive operation is restarted the subsequent data coming in on the RX line gets missed.&amp;nbsp;Calls to&amp;nbsp;UART_TransferGetReceiveCountEDMA() return 0.&amp;nbsp;Eventually, after a few seconds and many bytes of missed data, it starts receiving again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas what could be causing this?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Nov 2017 08:41:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-eDMA-UART-missing-bytes/m-p/760941#M46384</guid>
      <dc:creator>nbuters</dc:creator>
      <dc:date>2017-11-09T08:41:09Z</dc:date>
    </item>
  </channel>
</rss>

