<?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中的主题 Re: UART / CAN Transfer examples</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078195#M57461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabio,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case of overrun you should use &lt;STRONG&gt;kUART_RxOverrunFlag&lt;/STRONG&gt; when using &lt;STRONG&gt;UART_ClearStatusFlags&lt;/STRONG&gt;. Please check the below explanaition from fsl_uart.c driver.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;OL&gt;&lt;LI&gt;If RX ring buffer is not enabled, then save xfer-&amp;gt;data and xfer-&amp;gt;dataSize to uart handle, enable interrupt to store received data to xfer-&amp;gt;data. When all data received, trigger callback.&lt;/LI&gt;&lt;/OL&gt;&lt;OL start="2"&gt;&lt;LI&gt;If RX ring buffer is enabled and not empty, get data from ring buffer first.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If there are enough data in ring buffer, copy them to xfer-&amp;gt;data and return.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If there are not enough data in ring buffer, copy all of them to xfer-&amp;gt;data,&amp;nbsp;save the xfer-&amp;gt;data remained&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;empty space to uart handle, receive data to this empty space and trigger callback when finished.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jul 2020 17:19:25 GMT</pubDate>
    <dc:creator>FelipeGarcia</dc:creator>
    <dc:date>2020-07-03T17:19:25Z</dc:date>
    <item>
      <title>UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078187#M57453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Based on FRDM-K64 example I use UART and CANBUS in Transfer mode. In this examples (respectively frdmk64f_uart_interrupt_transfer and frdmk64f_flexcan_loopback_transfer), however, in callback only a few status&amp;nbsp;&lt;/P&gt;&lt;P&gt;are managed, tipically TxIdle and RxIdle,&amp;nbsp;while the actual states are many more. Sometimes the callback return other status, like RxOverrun/TxOverrun or Error and&amp;nbsp;it gets stuck in these states.&lt;/P&gt;&lt;P&gt;How should these states be managed and / or how can I prevent these situations?&lt;/P&gt;&lt;P&gt;Are there more in-depth examples for both the UART and the CANBUS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2020 13:22:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078187#M57453</guid>
      <dc:creator>LArmstrong1985</dc:creator>
      <dc:date>2020-06-22T13:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078188#M57454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabio&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also take a look at the open source uTasker project which contains proven parallel operation of I2C, UART and FlexCAN:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/uTasker/uTasker-Kinetis" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.utasker.com/docs/uTasker/uTasker_I2C.pdf" target="test_blank"&gt;https://www.utasker.com/docs/uTasker/uTasker_I2C.pdf&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.utasker.com/docs/uTasker/uTaskerUART.PDF" target="test_blank"&gt;https://www.utasker.com/docs/uTasker/uTaskerUART.PDF&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.utasker.com/docs/uTasker/uTaskerCAN.PDF" target="test_blank"&gt;https://www.utasker.com/docs/uTasker/uTaskerCAN.PDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=Ha8cv_XEvco" target="test_blank"&gt;https://www.youtube.com/watch?v=Ha8cv_XEvco&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as well as simulation of the peripherals for simpler debugging and project development.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The supported developer's version give addition features like integrated CANopen for professional needs.&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;Mark&lt;BR /&gt;&lt;EM&gt;[uTasker project developer for Kinetis and i.MX RT]&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2020 14:29:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078188#M57454</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-06-22T14:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078189#M57455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mark,&lt;/P&gt;&lt;P&gt;thanks for your interest, but I'm using the official SDK and I need support for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2020 16:03:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078189#M57455</guid>
      <dc:creator>LArmstrong1985</dc:creator>
      <dc:date>2020-06-22T16:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078190#M57456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fabio,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you referring to the UART callback? An overrun indicates that received data has been lost because there was a lack of room to store it in the data buffer. Therefore, while S1[OR] is set, no further data is stored in the data buffer until S1[OR] is cleared.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recommend you to check chapter 52.8.4 of the &lt;A href="https://www.nxp.com/webapp/Download?colCode=K64P144M120SF5RM"&gt;reference manual&lt;/A&gt; for more in depth information about this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2020 19:13:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078190#M57456</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-06-25T19:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078191#M57457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Felipe,&lt;/P&gt;&lt;P&gt;yes, I'm referring to UART/FlexCAN callback.&lt;/P&gt;&lt;P&gt;Specifically regarding UART, in the example on callback, only&amp;nbsp;kStatus_UART_TxIdle and&amp;nbsp;kStatus_UART_RxIdle state are managed, but other states? For example if callback return kStatus_UART_RxHardwareOverrun that typically I find,&lt;/P&gt;&lt;P&gt;what I have to do? You showed me the S1 register&amp;nbsp;but is this not managed internally by fs_uart library?&lt;/P&gt;&lt;P&gt;Are there high-level functions to manage these conditions?&lt;/P&gt;&lt;P&gt;For FlexCAN, for example, that has a similar interface before calling&amp;nbsp;FLEXCAN_TransferSendNonBlocking or&amp;nbsp;FLEXCAN_TransferReceiveNonBlocking,&lt;/P&gt;&lt;P&gt;I call&amp;nbsp;respectively FLEXCAN_TransferAbortSend and&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;FLEXCAN_TransferAbortReceive&amp;nbsp;which should cancel any previous sending / receiving in progress,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; but I don't think it's the best solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;P&gt;Fabio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2020 08:07:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078191#M57457</guid>
      <dc:creator>LArmstrong1985</dc:creator>
      <dc:date>2020-06-26T08:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078192#M57458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Fabio,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the reference manual when receive a hardware overrun status, software should do the following.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;1. Remove data from the receive data buffer. This could be done by reading data from the data buffer and processing it if the data in the FIFO was still valuable when the overrun event occurred, or using CFIFO[RXFLUSH] to clear the buffer.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2. Clear S1[OR]. Note that if data was cleared using CFIFO[RXFLUSH], then clearing S1[OR] will result in SFIFO[RXUF] asserting. This is because the only way to clear S1[OR] requires reading additional information from the FIFO. Care should be taken to disable the SFIFO[RXUF] interrupt prior to clearing the OR flag and then clearing SFIFO[RXUF] after the OR flag has been cleared.&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;To do this I recommend you to call &lt;STRONG&gt;UART_ClearStatusFlags&lt;/STRONG&gt; function that will clear the flags and flush all data in FIFO.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2020 21:41:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078192#M57458</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-06-30T21:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078193#M57459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;I saw the function&amp;nbsp;UART_ClearStatusFlags.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Reading the comments it expects a bit mask with the following values&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;kUART_TxDataRegEmptyFlag, kUART_TransmissionCompleteFlag, kUART_RxDataRegFullFlag,&lt;BR /&gt;kUART_RxActiveFlag, kUART_NoiseErrorInRxDataRegFlag, kUART_ParityErrorInRxDataRegFlag,&lt;BR /&gt;kUART_TxFifoEmptyFlag,kUART_RxFifoEmptyFlag.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;W&lt;SPAN&gt;hich flag should i reset? All?&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;In the example the callback it's the following:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;void UART_UserCallback(UART_Type *base, uart_handle_t *handle, status_t status, void *userData)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; userData = userData;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (kStatus_UART_TxIdle == status)&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; txBufferFull = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; txOnGoing&amp;nbsp;&amp;nbsp;&amp;nbsp; = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (kStatus_UART_RxIdle == status)&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; rxBufferEmpty = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rxOnGoing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = false;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Is it okay if I call the &lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; overflow-wrap: break-word; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;UART_ClearStatusFlags&lt;/SPAN&gt; function on callback if status==kStatus_UART_RxHardwareOverrun?&lt;/DIV&gt;&lt;DIV&gt;What I have to do if status==kStatus_UART_RxBusy? Very often I find that the UART is stuck in this state and I no longer receive anything&lt;/DIV&gt;&lt;DIV&gt;(I use the call UART_TransferReceiveNonBlocking).&lt;/DIV&gt;&lt;DIV&gt;It says in the comments: &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;kStatus_UART_RxBusy Previous receive request is not finished.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;How come UART hangs?&lt;/DIV&gt;&lt;DIV&gt;I also wanted to specify that at the moment I am not using the internal FIFO to which you have seen you refer.&lt;BR /&gt;I don't know if it could help. How does it work? In transmission wait for the queue to be full to send message or send as soon as it can?&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2020 08:30:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078193#M57459</guid>
      <dc:creator>LArmstrong1985</dc:creator>
      <dc:date>2020-07-01T08:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078194#M57460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;I noticed now reading the documentation and seeing the examples that function&amp;nbsp;UART_TransferReceiveNonBlocking is used in combination with ring buffer while I have the ring buffer disabled.&lt;/P&gt;&lt;P&gt;This may be the problem, or the function UART_TransferReceiveNonBlocking can we used without ring buffer?&lt;/P&gt;&lt;P&gt;W&lt;SPAN&gt;hat is the advantage of the ring buffer compared to the internal FIFO?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can I use them together?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2020 12:27:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078194#M57460</guid>
      <dc:creator>LArmstrong1985</dc:creator>
      <dc:date>2020-07-01T12:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078195#M57461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabio,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case of overrun you should use &lt;STRONG&gt;kUART_RxOverrunFlag&lt;/STRONG&gt; when using &lt;STRONG&gt;UART_ClearStatusFlags&lt;/STRONG&gt;. Please check the below explanaition from fsl_uart.c driver.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;OL&gt;&lt;LI&gt;If RX ring buffer is not enabled, then save xfer-&amp;gt;data and xfer-&amp;gt;dataSize to uart handle, enable interrupt to store received data to xfer-&amp;gt;data. When all data received, trigger callback.&lt;/LI&gt;&lt;/OL&gt;&lt;OL start="2"&gt;&lt;LI&gt;If RX ring buffer is enabled and not empty, get data from ring buffer first.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If there are enough data in ring buffer, copy them to xfer-&amp;gt;data and return.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If there are not enough data in ring buffer, copy all of them to xfer-&amp;gt;data,&amp;nbsp;save the xfer-&amp;gt;data remained&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;empty space to uart handle, receive data to this empty space and trigger callback when finished.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2020 17:19:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078195#M57461</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-07-03T17:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078196#M57462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;I should have solved it!&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that error was due to baudrate that is too high (I had set it to 921600&lt;/P&gt;&lt;P&gt;even if in the UARTInit function documentation it set baudrate to 20000000).&lt;/P&gt;&lt;P&gt;Reducing it I stopped having serial locking problems in the busy state most likely due to errors in communication.&lt;/P&gt;&lt;P&gt;Having said that, what is the maximum baudrate that can be set for the serial port? Does it depend on the source clock?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Fabio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2020 15:55:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078196#M57462</guid>
      <dc:creator>LArmstrong1985</dc:creator>
      <dc:date>2020-07-07T15:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: UART / CAN Transfer examples</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078197#M57463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabio,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The max baud rate varies by device, but can be calculated using the following formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UART Max Baud Rate = (UART Module Clock Frequency) / 16&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please take into consideration that UART0 and UART1 modules operate from the core/system clock, which provides higher performance level for these modules. All other UART modules operate from the bus clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2020 16:01:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/UART-CAN-Transfer-examples/m-p/1078197#M57463</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2020-07-14T16:01:00Z</dc:date>
    </item>
  </channel>
</rss>

