<?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's UART2 Interrupt only gets two chars</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/k64-s-UART2-Interrupt-only-gets-two-chars/m-p/989678#M55625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have always used UART0 without any trouble, but now I need also to use UART2. I have configured UART2 with the MCUxpresso Peripherals tab making sure that UART2 is in Bus clock. I can send commands without any problem but the interrupt routine only gets the first two chars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure that the issue is a simple mistake, but I can't figure out what it is really. Do you have any hints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my interrupt handlers from UART0 and UART2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UART0_RX_TX_IRQHandler(void){&lt;/P&gt;&lt;P&gt;uint8_t data;&lt;/P&gt;&lt;P&gt;if( (kUART_RxDataRegFullFlag | kUART_RxOverrunFlag) &amp;amp; UART_GetStatusFlags(UART_0_PERIPHERAL) ){&lt;/P&gt;&lt;P&gt;data = UART_ReadByte(UART_0_PERIPHERAL);//read the UART buffer&lt;/P&gt;&lt;P&gt;// If ring buffer is not full, add data to ring buffer.&lt;BR /&gt; if (((UART0_endRingBuffer + 1) % UART0_RING_BUFFER_SIZE) != UART0_startRingBuffer)&lt;BR /&gt; {&lt;BR /&gt; UART0_RX_RingBuffer[UART0_endRingBuffer] = data;&lt;BR /&gt; UART0_endRingBuffer++;&lt;BR /&gt; UART0_endRingBuffer %= UART0_RING_BUFFER_SIZE;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;void UART2_RX_TX_IRQHandler(void){&lt;/P&gt;&lt;P&gt;uint8_t data;&lt;/P&gt;&lt;P&gt;if( (kUART_RxDataRegFullFlag | kUART_RxOverrunFlag) &amp;amp; UART_GetStatusFlags(UART_2_PERIPHERAL) ){&lt;/P&gt;&lt;P&gt;data = UART_ReadByte(UART_2_PERIPHERAL);//read the UART buffer&lt;/P&gt;&lt;P&gt;// If ring buffer is not full, add data to ring buffer.&lt;BR /&gt; if (((UART2_endRingBuffer + 1) % UART2_RING_BUFFER_SIZE) != UART2_startRingBuffer)&lt;BR /&gt; {&lt;BR /&gt; UART2_RX_RingBuffer[UART2_endRingBuffer] = data;&lt;BR /&gt; UART2_endRingBuffer++;&lt;BR /&gt; UART2_endRingBuffer %= UART2_RING_BUFFER_SIZE;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Nov 2019 11:25:02 GMT</pubDate>
    <dc:creator>joao_ribeiro</dc:creator>
    <dc:date>2019-11-29T11:25:02Z</dc:date>
    <item>
      <title>k64's UART2 Interrupt only gets two chars</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/k64-s-UART2-Interrupt-only-gets-two-chars/m-p/989678#M55625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have always used UART0 without any trouble, but now I need also to use UART2. I have configured UART2 with the MCUxpresso Peripherals tab making sure that UART2 is in Bus clock. I can send commands without any problem but the interrupt routine only gets the first two chars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sure that the issue is a simple mistake, but I can't figure out what it is really. Do you have any hints?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my interrupt handlers from UART0 and UART2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UART0_RX_TX_IRQHandler(void){&lt;/P&gt;&lt;P&gt;uint8_t data;&lt;/P&gt;&lt;P&gt;if( (kUART_RxDataRegFullFlag | kUART_RxOverrunFlag) &amp;amp; UART_GetStatusFlags(UART_0_PERIPHERAL) ){&lt;/P&gt;&lt;P&gt;data = UART_ReadByte(UART_0_PERIPHERAL);//read the UART buffer&lt;/P&gt;&lt;P&gt;// If ring buffer is not full, add data to ring buffer.&lt;BR /&gt; if (((UART0_endRingBuffer + 1) % UART0_RING_BUFFER_SIZE) != UART0_startRingBuffer)&lt;BR /&gt; {&lt;BR /&gt; UART0_RX_RingBuffer[UART0_endRingBuffer] = data;&lt;BR /&gt; UART0_endRingBuffer++;&lt;BR /&gt; UART0_endRingBuffer %= UART0_RING_BUFFER_SIZE;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;void UART2_RX_TX_IRQHandler(void){&lt;/P&gt;&lt;P&gt;uint8_t data;&lt;/P&gt;&lt;P&gt;if( (kUART_RxDataRegFullFlag | kUART_RxOverrunFlag) &amp;amp; UART_GetStatusFlags(UART_2_PERIPHERAL) ){&lt;/P&gt;&lt;P&gt;data = UART_ReadByte(UART_2_PERIPHERAL);//read the UART buffer&lt;/P&gt;&lt;P&gt;// If ring buffer is not full, add data to ring buffer.&lt;BR /&gt; if (((UART2_endRingBuffer + 1) % UART2_RING_BUFFER_SIZE) != UART2_startRingBuffer)&lt;BR /&gt; {&lt;BR /&gt; UART2_RX_RingBuffer[UART2_endRingBuffer] = data;&lt;BR /&gt; UART2_endRingBuffer++;&lt;BR /&gt; UART2_endRingBuffer %= UART2_RING_BUFFER_SIZE;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Nov 2019 11:25:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/k64-s-UART2-Interrupt-only-gets-two-chars/m-p/989678#M55625</guid>
      <dc:creator>joao_ribeiro</dc:creator>
      <dc:date>2019-11-29T11:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: k64's UART2 Interrupt only gets two chars</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/k64-s-UART2-Interrupt-only-gets-two-chars/m-p/989679#M55626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;João,&lt;/P&gt;&lt;P&gt;Please notice the difference of receive FIFO.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UART FIFO K64.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/95463i472638F1FF51674B/image-size/large?v=v2&amp;amp;px=999" role="button" title="UART FIFO K64.png" alt="UART FIFO K64.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px; font-size: 14px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; border: 0px; font-size: 14px;"&gt;Robin&lt;/P&gt;&lt;P style="color: #51626f; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; border: 0px; font-size: 14px;"&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Dec 2019 00:41:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/k64-s-UART2-Interrupt-only-gets-two-chars/m-p/989679#M55626</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2019-12-01T00:41:45Z</dc:date>
    </item>
  </channel>
</rss>

