<?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 Re: MKE04Z128VLD4　UART Receive Data Register Full Flag in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKE04Z128VLD4-UART-Receive-Data-Register-Full-Flag/m-p/1230750#M59613</link>
    <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/79895"&gt;@jun1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interesting question and I have no idea why that comment is in the SDK example code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at the code, the answer should be "no" as long as interrupts are active.&amp;nbsp; It's possible that previous, unread data in the ring buffer is overwritten.&amp;nbsp;&amp;nbsp;I do use the UART interrupt receive SDK (with EDMA transmit) code so I do have experience with it on other Kinetis devices (K2x, K3x and K6x) and would never expect this to happen.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only case I can think of where the overrun flag is set at all in the example code is if interrupts were disabled for a long period of time (ie when clearing/programming many sectors of Flash and not enabling interrupts periodically) with UART data still coming in.&amp;nbsp; I should point out that the Data Register Full Flag should also be active in this case.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've just looked at the examle SDK code for the devices I'm working with (not the MKE04Z128VLD4) and the IRQ handler code is identical, but doesn't have that comment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe somebody with experience with the UART for this part can comment but to me the answer should be "no".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;</description>
    <pubDate>Sun, 14 Feb 2021 14:26:07 GMT</pubDate>
    <dc:creator>myke_predko</dc:creator>
    <dc:date>2021-02-14T14:26:07Z</dc:date>
    <item>
      <title>MKE04Z128VLD4　UART Receive Data Register Full Flag</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKE04Z128VLD4-UART-Receive-Data-Register-Full-Flag/m-p/1230694#M59608</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;If the Receiver Overrun Flag is set when receiving the UART, the received data will be lost.&lt;BR /&gt;Is it possible that the Receive Data Register Full Flag is not set and only the Receiver Overrun Flag is set?&lt;BR /&gt;I have a question because the following code was in the UART sample program of the SDK.&lt;BR /&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;SDK:SDK_2.8.0_MKE04Z128xxx4\boards\frdmke06z\driver_examples\uart\interrupt&lt;/P&gt;&lt;P&gt;void DEMO_UART_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; uint8_t data;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;/*&amp;nbsp; Is it possible that the Receive Data Register Full Flag is not set and only the Receiver Overrun Flag is set? */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if ((kUART_RxDataRegFullFlag | kUART_RxOverrunFlag) &amp;amp; UART_GetStatusFlags(DEMO_UART))&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data = UART_ReadByte(DEMO_UART);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* If ring buffer is not full, add data to ring buffer. */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (((rxIndex + 1) % DEMO_RING_BUFFER_SIZE) != txIndex)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; demoRingBuffer[rxIndex] = data;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rxIndex++;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rxIndex %= DEMO_RING_BUFFER_SIZE;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SDK_ISR_EXIT_BARRIER;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Feb 2021 08:04:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKE04Z128VLD4-UART-Receive-Data-Register-Full-Flag/m-p/1230694#M59608</guid>
      <dc:creator>jun1</dc:creator>
      <dc:date>2021-02-13T08:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: MKE04Z128VLD4　UART Receive Data Register Full Flag</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKE04Z128VLD4-UART-Receive-Data-Register-Full-Flag/m-p/1230750#M59613</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/79895"&gt;@jun1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interesting question and I have no idea why that comment is in the SDK example code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking at the code, the answer should be "no" as long as interrupts are active.&amp;nbsp; It's possible that previous, unread data in the ring buffer is overwritten.&amp;nbsp;&amp;nbsp;I do use the UART interrupt receive SDK (with EDMA transmit) code so I do have experience with it on other Kinetis devices (K2x, K3x and K6x) and would never expect this to happen.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only case I can think of where the overrun flag is set at all in the example code is if interrupts were disabled for a long period of time (ie when clearing/programming many sectors of Flash and not enabling interrupts periodically) with UART data still coming in.&amp;nbsp; I should point out that the Data Register Full Flag should also be active in this case.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've just looked at the examle SDK code for the devices I'm working with (not the MKE04Z128VLD4) and the IRQ handler code is identical, but doesn't have that comment.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe somebody with experience with the UART for this part can comment but to me the answer should be "no".&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myke&lt;/P&gt;</description>
      <pubDate>Sun, 14 Feb 2021 14:26:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/MKE04Z128VLD4-UART-Receive-Data-Register-Full-Flag/m-p/1230750#M59613</guid>
      <dc:creator>myke_predko</dc:creator>
      <dc:date>2021-02-14T14:26:07Z</dc:date>
    </item>
  </channel>
</rss>

