<?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 EXAMPLE_GetRingBufferLengthEDMA in uart edma_rb_transfer example in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980411#M1915</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New uart driver example "edma_rb_transfer" in SDK2.6.0 has EXAMPLE_GetRingBufferLengthEDMA() implementation.&lt;/P&gt;&lt;P&gt;Seems function will return wrong result if data length in rx ringbuffer will be same as ringbuffer size.&lt;/P&gt;&lt;P&gt;Ex., size of uart dma ringbuffer is 255 bytes and same &lt;SPAN class="" lang="en"&gt;&lt;SPAN class="" title=""&gt;amount of bytes recieved - EXAMPLE_GetRingBufferLengthEDMA will return zero.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Nov 2019 14:21:26 GMT</pubDate>
    <dc:creator>andreykorol1</dc:creator>
    <dc:date>2019-11-12T14:21:26Z</dc:date>
    <item>
      <title>EXAMPLE_GetRingBufferLengthEDMA in uart edma_rb_transfer example</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980411#M1915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New uart driver example "edma_rb_transfer" in SDK2.6.0 has EXAMPLE_GetRingBufferLengthEDMA() implementation.&lt;/P&gt;&lt;P&gt;Seems function will return wrong result if data length in rx ringbuffer will be same as ringbuffer size.&lt;/P&gt;&lt;P&gt;Ex., size of uart dma ringbuffer is 255 bytes and same &lt;SPAN class="" lang="en"&gt;&lt;SPAN class="" title=""&gt;amount of bytes recieved - EXAMPLE_GetRingBufferLengthEDMA will return zero.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2019 14:21:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980411#M1915</guid>
      <dc:creator>andreykorol1</dc:creator>
      <dc:date>2019-11-12T14:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: EXAMPLE_GetRingBufferLengthEDMA in uart edma_rb_transfer example</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980412#M1916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you let me know which MCU are you using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Nov 2019 23:08:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980412#M1916</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-11-12T23:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: EXAMPLE_GetRingBufferLengthEDMA in uart edma_rb_transfer example</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980413#M1917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MK60DN512, but function behavior independent of the processor:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
    receivedBytes &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;
        EXAMPLE_RING_BUFFER_SIZE &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;EDMA_GetRemainingMajorLoopCount&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;EXAMPLE_UART_DMA_BASEADDR&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; UART_RX_DMA_CHANNEL&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍
&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in case then we was receive same amount bytes as ringbuffer length receivedBytes will be set to zerro, but we know - right answer is EXAMPLE_RING_BUFFER_SIZE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2019 06:43:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980413#M1917</guid>
      <dc:creator>andreykorol1</dc:creator>
      <dc:date>2019-11-14T06:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: EXAMPLE_GetRingBufferLengthEDMA in uart edma_rb_transfer example</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980414#M1918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you mention in the SDK implementation you should always have one extra byte in the buffer for the data you want to receive, if you want to receive transmission up to 255 bytes, you should have this size + 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2019 15:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980414#M1918</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-11-14T15:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: EXAMPLE_GetRingBufferLengthEDMA in uart edma_rb_transfer example</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980415#M1919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;:smileyhappy: No, it's wrong disigion - if you alway know how many bytes you will receive, you just don't need ring buffer (look at "edma_transfer" uart example). When we use ring buffer it's mean - we don't know how many data we will receive and some time we may lost some bytes (ex. on heavy loaded system), but in this case we alway can get last X bytes (where X - size of ring buffer).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; One moment is - as i see in "edma_rb_transfer" example every time when&lt;/P&gt;&lt;P&gt;EXAMPLE_RING_BUFFER_SIZE - EDMA_GetRemainingMajorLoopCount(EXAMPLE_UART_DMA_BASEADDR, UART_RX_DMA_CHANNEL) == ringBufferIndex&lt;/P&gt;&lt;P&gt;we can't &lt;SPAN class="" lang="en"&gt;&lt;SPAN class="" title=""&gt;distinguish have we empty or we have full ring buffer.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" lang="en"&gt;&lt;SPAN class="" title=""&gt;&amp;nbsp; At second, does not take into account ring buffer overflow. Let's say we have 255 bytes-len ring buffer and it contain 10 bytes of data. And we receive 265 bytes. In this case EXAMPLE_GetRingBufferLengthEDMA will return 20, but ring buffer is full and contain 255 bytes. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2019 07:07:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/EXAMPLE-GetRingBufferLengthEDMA-in-uart-edma-rb-transfer-example/m-p/980415#M1919</guid>
      <dc:creator>andreykorol1</dc:creator>
      <dc:date>2019-11-15T07:07:08Z</dc:date>
    </item>
  </channel>
</rss>

