<?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 UART RX interrupt with no data in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788621#M911</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using MCUXpresso 10.2.1 with a custom board based on MK66F2M0.&lt;/P&gt;&lt;P&gt;I'm facing with a strange situation: sometimes I get the UART interrupt handling the RX data register full event, but in the buffer there is no data available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; /* Receive data register full */&lt;BR /&gt; if ((UART_S1_RDRF_MASK &amp;amp; base-&amp;gt;S1) &amp;amp;&amp;amp; (UART_C2_RIE_MASK &amp;amp; base-&amp;gt;C2))&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Get the size that can be stored into buffer for this interrupt. */&lt;BR /&gt;#if defined(FSL_FEATURE_UART_HAS_FIFO) &amp;amp;&amp;amp; FSL_FEATURE_UART_HAS_FIFO&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;count = base-&amp;gt;RCFIFO;&lt;BR /&gt;#else&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;count = 1;&lt;BR /&gt;#endif&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this situation I get count = 0.&lt;/P&gt;&lt;P&gt;Why there is the rx data event and no data is available?&lt;/P&gt;&lt;P&gt;How can this situation be generated?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Dec 2018 10:22:12 GMT</pubDate>
    <dc:creator>biafra</dc:creator>
    <dc:date>2018-12-12T10:22:12Z</dc:date>
    <item>
      <title>UART RX interrupt with no data</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788621#M911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using MCUXpresso 10.2.1 with a custom board based on MK66F2M0.&lt;/P&gt;&lt;P&gt;I'm facing with a strange situation: sometimes I get the UART interrupt handling the RX data register full event, but in the buffer there is no data available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; /* Receive data register full */&lt;BR /&gt; if ((UART_S1_RDRF_MASK &amp;amp; base-&amp;gt;S1) &amp;amp;&amp;amp; (UART_C2_RIE_MASK &amp;amp; base-&amp;gt;C2))&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Get the size that can be stored into buffer for this interrupt. */&lt;BR /&gt;#if defined(FSL_FEATURE_UART_HAS_FIFO) &amp;amp;&amp;amp; FSL_FEATURE_UART_HAS_FIFO&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;count = base-&amp;gt;RCFIFO;&lt;BR /&gt;#else&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;count = 1;&lt;BR /&gt;#endif&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this situation I get count = 0.&lt;/P&gt;&lt;P&gt;Why there is the rx data event and no data is available?&lt;/P&gt;&lt;P&gt;How can this situation be generated?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Biafra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2018 10:22:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788621#M911</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2018-12-12T10:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: UART RX interrupt with no data</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788622#M912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi biafra,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please debug your code, add the two breakpoint here:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;if ((UART_S1_RDRF_MASK &amp;amp; base-&amp;gt;S1) &amp;amp;&amp;amp; (UART_C2_RIE_MASK &amp;amp; base-&amp;gt;C2))&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Get the size that can be stored into buffer for this interrupt. */&lt;BR /&gt;#if defined(FSL_FEATURE_UART_HAS_FIFO) &amp;amp;&amp;amp; FSL_FEATURE_UART_HAS_FIFO&lt;BR /&gt; &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;count = base-&amp;gt;RCFIFO;&lt;/STRONG&gt;&lt;/SPAN&gt; // add break point here&lt;BR /&gt;#else&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;count = 1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;#endif&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Can you enter the red code when you debug the code in the interrupt?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Besides, please check you code, do you enable FSL_FEATURE_UART_HAS_FIFO?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;If you don't enable the fifo, you need to read the UARTX_D register to clear the RDRF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;You also can check your UARTx_S1, and UARTX_S2, and send me the debug register result when you enter the interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;If you have the oscilloscope, you also can check the RX pin wave, whether there have the interference or really have the UART RX wave.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;Any updated information, please kindly let me know.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Thu, 13 Dec 2018 03:35:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788622#M912</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-12-13T03:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: UART RX interrupt with no data</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788623#M913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/kerryzhou"&gt;kerryzhou&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In MK66F18_features.h file there is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#define FSL_FEATURE_UART_HAS_FIFO (1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;So the line&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; count = base-&amp;gt;RCFIFO;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;is executed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;There is no interference in RX pin.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;When count is 0, I have S1 = 0xE0 and S2 = 0x41.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The UART driver is the one that is supplied with SDK!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Biafra&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2018 09:09:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788623#M913</guid>
      <dc:creator>biafra</dc:creator>
      <dc:date>2018-12-13T09:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: UART RX interrupt with no data</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788624#M914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your software is correct for me.&lt;/P&gt;&lt;P&gt;Sometimes this kind of problem could occured by a stress on Vdd or Gnd or another input which face an abnormal voltage / interference&amp;nbsp;which "press" on RX pin reference and can generate an interruption.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Verify that there is no interference on any I/O.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bertrand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2018 08:26:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788624#M914</guid>
      <dc:creator>merigotbertrand</dc:creator>
      <dc:date>2018-12-14T08:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: UART RX interrupt with no data</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788625#M915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi MERIGOT BERTRAND,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please use the oscilloscope to check your RX pin during your debugging, I want to see the RX wave.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Besides, do you have the official K66 board on your side, you can also try our official board, check whether your code still have this problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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>Mon, 17 Dec 2018 03:24:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/UART-RX-interrupt-with-no-data/m-p/788625#M915</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-12-17T03:24:44Z</dc:date>
    </item>
  </channel>
</rss>

