<?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 KSDK v1.3 UART_DRV_Edma driver questions (k22F, FreeRTOS) in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-v1-3-UART-DRV-Edma-driver-questions-k22F-FreeRTOS/m-p/474235#M3903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an interesting case where I use the non-blocking function &lt;STRONG&gt;UART_DRV_EdmaReceiveData&lt;/STRONG&gt; to receive 64 bytes. What I receive can either be 64 bytes or 4bytes.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To deal with the 4 byte packet, I continuously call &lt;STRONG&gt;UART_DRV_EdmaGetReceiveStatus&lt;/STRONG&gt; from a task. When I have received at least 4 bytes (when &lt;STRONG&gt;bytesRemaiining&lt;/STRONG&gt; &amp;lt; 61) I check the first byte received to determine if it is a small or big packet. I have verified with a debugger that &lt;STRONG&gt;bytesRemaining&lt;/STRONG&gt; will tell me that I have received at least 4 bytes.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if it is a small packet I call &lt;STRONG&gt;UART_DRV_EdmaAbortReceivingData&lt;/STRONG&gt;, assuming that since &lt;STRONG&gt;byteRemaining&lt;/STRONG&gt; reports that I have 4 bytes, I have received my whole small packet copied to my buffer.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have found however is that sometimes the Edma will not have actually copied the last couple of bytes into my buffer even though it says it has received 4 bytes. And when I call the &lt;STRONG&gt;UART_DRV_EdmaAbortReceivingData&lt;/STRONG&gt; I never actually get the bytes it reports I received.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand this is not exactly how these drivers where intended, but can anyone explain what is happening? How can &lt;STRONG&gt;UART_DRV_EdmaGetReceiveStatus &lt;/STRONG&gt;report I have 4 bytes, before they were actually copied?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Terry Cooke&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2/19/2016: I am still waiting on a response to this, does anyone have any further infromation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2016 00:58:22 GMT</pubDate>
    <dc:creator>thcooke77</dc:creator>
    <dc:date>2016-01-29T00:58:22Z</dc:date>
    <item>
      <title>KSDK v1.3 UART_DRV_Edma driver questions (k22F, FreeRTOS)</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-v1-3-UART-DRV-Edma-driver-questions-k22F-FreeRTOS/m-p/474235#M3903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an interesting case where I use the non-blocking function &lt;STRONG&gt;UART_DRV_EdmaReceiveData&lt;/STRONG&gt; to receive 64 bytes. What I receive can either be 64 bytes or 4bytes.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To deal with the 4 byte packet, I continuously call &lt;STRONG&gt;UART_DRV_EdmaGetReceiveStatus&lt;/STRONG&gt; from a task. When I have received at least 4 bytes (when &lt;STRONG&gt;bytesRemaiining&lt;/STRONG&gt; &amp;lt; 61) I check the first byte received to determine if it is a small or big packet. I have verified with a debugger that &lt;STRONG&gt;bytesRemaining&lt;/STRONG&gt; will tell me that I have received at least 4 bytes.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if it is a small packet I call &lt;STRONG&gt;UART_DRV_EdmaAbortReceivingData&lt;/STRONG&gt;, assuming that since &lt;STRONG&gt;byteRemaining&lt;/STRONG&gt; reports that I have 4 bytes, I have received my whole small packet copied to my buffer.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I have found however is that sometimes the Edma will not have actually copied the last couple of bytes into my buffer even though it says it has received 4 bytes. And when I call the &lt;STRONG&gt;UART_DRV_EdmaAbortReceivingData&lt;/STRONG&gt; I never actually get the bytes it reports I received.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand this is not exactly how these drivers where intended, but can anyone explain what is happening? How can &lt;STRONG&gt;UART_DRV_EdmaGetReceiveStatus &lt;/STRONG&gt;report I have 4 bytes, before they were actually copied?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Terry Cooke&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2/19/2016: I am still waiting on a response to this, does anyone have any further infromation?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 00:58:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/KSDK-v1-3-UART-DRV-Edma-driver-questions-k22F-FreeRTOS/m-p/474235#M3903</guid>
      <dc:creator>thcooke77</dc:creator>
      <dc:date>2016-01-29T00:58:22Z</dc:date>
    </item>
  </channel>
</rss>

