<?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 Software Development KitのトピックRe: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470346#M3752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many many thanks for the explanation you gave me about point 1 of my email. Now it works perfectly! I also tried, in the same lwip echo example, to use both UART3 and UART0 following your example and it worked without any problem.&lt;/P&gt;&lt;P&gt;When I initially tried using UART_DRV_SendDataBlocking(..) it crashed because, looking at your good code example, I didn't create and initialized the interrupt handler for the UART3 I tried to use (with UART_DRV_IRQHandler(3) and OSA_InstallIntHandler(..)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That being said, &lt;SPAN style="text-decoration: underline;"&gt;I would like to understand how to implement peripheral code library (point 2 of my email of Feb 3rd)&lt;/SPAN&gt;. For this reason, following your previous reply, I would like to ask you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;a)&lt;/STRONG&gt; &lt;/SPAN&gt;In what KSDK_1.3.0 example with MQX I can find a &lt;SPAN style="color: #3334ca;"&gt;NIO UART code implementation&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #e23d39;"&gt;b)&lt;/STRONG&gt; Can I implement UARTs communication using &lt;SPAN style="color: #3334ca;"&gt;different MQX driver code (compared to NIO)&lt;/SPAN&gt; which currently has description documentation available? Can I use, in my environment described above, "Formatted I/O Library", for example? (This is actually the question of point 2 of my post of Feb 3rd).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your precious help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Feb 2016 23:56:27 GMT</pubDate>
    <dc:creator>mmoncigoli</dc:creator>
    <dc:date>2016-02-04T23:56:27Z</dc:date>
    <item>
      <title>TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470338#M3744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear community, please I need to ask an explanation for a weird issue I'm having using the "&lt;STRONG&gt;lwip_udpecho_demo&lt;/STRONG&gt;" example (under c:\Freescale\KSDK_1.3.0\examples\twrk65f180m\demo_apps\lwip\lwip_udpecho_demo\udpecho_rtos). But, in my opinion, the issue is not due to the SPECIFIC demo example I am using. I guess it's use to MQX RTOS.&lt;/P&gt;&lt;P&gt;Unfortunately my deadline will be this incoming Monday. If I don't fix this issue I cannot deliver my project... :-(&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG style="color: #e23d39; text-decoration: underline;"&gt;ENVIRONMENT I AM USING&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;- KSDK 1.3.0&lt;/P&gt;&lt;P&gt;- TWR-K65F180 with TWR-SER2&lt;/P&gt;&lt;P&gt;- MQX RTOS&lt;/P&gt;&lt;P&gt;- PEMicro&lt;/P&gt;&lt;P&gt;- Either openSDA or Jlink for debugging&lt;/P&gt;&lt;P&gt;- PC console: either DB9 on TWR-SER2 or openSDA&lt;/P&gt;&lt;P&gt;- GNU-GCC Compiler&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG style="color: #e23d39; text-decoration: underline;"&gt;DESCRIPTION OF THE ISSUE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"&lt;STRONG&gt;lwip_udpecho_demo&lt;/STRONG&gt;" code example uses &lt;STRONG&gt;UART2&lt;/STRONG&gt; to display debug strings on the PC-console. I need to make this TWR board communicate with another TWR-K65F180 with TWR-SER2 over UART. So I tried to use, in vain, either &lt;STRONG&gt;UART0&lt;/STRONG&gt; or &lt;STRONG&gt;UART3&lt;/STRONG&gt; (from, respectively, J7 pins 1 and 3 of TWR-SER2 and R40 (PT17) and R39 (PT16) of TWR-K65F180 board. &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;The issue I'm having is that, when my code tries to transmit over UART0 (or UART3) using "UART_DRV_SendDataBlocking(0, bufferData, byteCountBuff, 1000u)", it always crashes inside this function (more precisely, when this function calls "retVal = UART_DRV_StartSendData(instance, txBuff, txSize)").&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;SPAN style="color: #e23d39; text-decoration: underline;"&gt;MY ANALYSIS OF THE ISSUE&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I also tried to transmit data over UART0 and UART3 (same boards configuration) with the example "&lt;STRONG&gt;uart_blocking&lt;/STRONG&gt;" present in the driver examples of the KSDK 1.3.0 folder. &lt;SPAN style="text-decoration: underline;"&gt;In this case I had not problem in term of that, everything worked perfectly!&lt;/SPAN&gt; So, since this "uart_blocking" example is not using any RTOS, my guess is that MQX, for some reasons, keeps busy both UART0 and UART3 making my code crashing.&amp;nbsp; But, in the code, I didn't find the point when MQX opens these two ports.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Can this be the right explanation? But, more important, how can I use these two UARTs (0 and 3) using MQX RTOS in my code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much to all people who are going to help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 07:56:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470338#M3744</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-01-28T07:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470339#M3745</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;Are you trying to use another UART instance as debug console or you need to have 2 UART (one as debug console and other to communicate different messages to other board)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac Avila&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 21:40:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470339#M3745</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-01-28T21:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470340#M3746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for this explanation, now I'm understanding a bit more. I am using 2 UARTs, one as debug console and the other to communicate different messages to another board. The debug console is the one already implemented in the "lwip_udpecho_demo" example (UART2). In order to communicate with other 2 boards, I need to use UART0 and UART3 (the ones I could not make work).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, at this point, please, I'd like to ask you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt; how to install NIO serial driver&lt;/P&gt;&lt;P&gt;-&amp;gt; in term of NIO function description, where can I find the proper documentation? I searched in &lt;EM&gt;&lt;STRONG&gt;"Freescale MQX™ RTOS Reference Manual"&lt;/STRONG&gt; &lt;/EM&gt;and &lt;STRONG&gt;&lt;EM&gt;"Freescale MQX™ RTOS User's Guide"&lt;/EM&gt;&lt;/STRONG&gt;, but I didn't find anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your precious help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 21:57:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470340#M3746</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-01-28T21:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470341#M3747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually Isaac, in terms of my question about how to install NIO serial driver, running "lwip_udpecho_demo" example, I think it's already installed in my system, isn't it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jan 2016 22:09:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470341#M3747</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-01-28T22:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470342#M3748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello mmoncigoli,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, this NIO driver is already installed when MQX initializes, if you seek on init_bsp.c file (located at BSP_Files folder) you will notice the const NIO_SERIAL_INIT_DATA_STRUCT nio_serial_default_init strcuture that contains setup for default console port (like UART instance, baud rate, etc) and it is installed in _bsp_init function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This NIO driver is used for debug console, so you can use functions like in POSIX standard (fopen, fclose, ioctl, fwrite, fread) and it is only installed for DEFAULT IO SUBSYSTEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to use another UART instance, you can use KSDK drivers as they are (UART_DRV_Init, UART_DRV_SendDataBlocking), however, if you would like to use POSIX standard for this UART instance, you should create a wrapper by installing a new NIO driver like it was installed for DEFAULT_IO_SUBSYSTEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this can help you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac Avila&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 17:51:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470342#M3748</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-01-29T17:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470343#M3749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Isaac, I will check it and, if it works, I'll set this discussion as "Answered"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2016 21:08:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470343#M3749</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-01-29T21:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470344#M3750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MQX RTOS on&amp;nbsp; KSDK_1.3.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking at NIO documentation for MQX RTOS on&amp;nbsp; KSDK_1.3.0 and found nothing&amp;nbsp; :smileyconfused: :smileycry:&lt;/P&gt;&lt;P&gt;At this point, since it's very important for me to close this UART implementation issue in my project as soon as possible, I need to ask you these following &lt;STRONG style="text-decoration: underline;"&gt;two questions&lt;/STRONG&gt; please:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;1)&lt;/STRONG&gt;&lt;/SPAN&gt; You wrote: "&lt;EM&gt;If you want to use another UART instance, you can use KSDK drivers as they are (&lt;STRONG style="color: #3334ca;"&gt;UART_DRV_Init&lt;/STRONG&gt;, &lt;SPAN style="color: #3334ca;"&gt;&lt;STRONG&gt;UART_DRV_SendDataBlocking&lt;/STRONG&gt;&lt;/SPAN&gt;)...&lt;/EM&gt;". As by my initial question, using these UART_DRV_xxx functions in a project with MQX (and the environment described in my first post), &lt;SPAN style="color: #3334ca;"&gt;&lt;STRONG&gt;UART_DRV_SendDataBlocking(..)&lt;/STRONG&gt;&lt;/SPAN&gt; function crashes. It doesn't work. So my question is, &lt;STRONG style="text-decoration: underline;"&gt;is it really possible to use UART_DRV_xxx functions in my project&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;2)&lt;/STRONG&gt;&lt;/SPAN&gt; Since NIO documentation for MQX RTOS is, practically, non existent, &lt;STRONG style="text-decoration: underline;"&gt;can I implement UARTs communication using different MQX driver code which currently has description documentation available? Can I use, in my environment described above, "Formatted I/O Library", for example?&lt;/STRONG&gt; One problem I've just found about that, is that "&lt;STRONG style="color: #e23d39;"&gt;fio.h&lt;/STRONG&gt;" file is not present in all my installed Freescale code ("KSDK_1.3.0", "KDS_3.0.0" and "CW MCU v10.6").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can help me about this topic, it would be really great.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your time&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Feb 2016 19:36:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470344#M3750</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-02-03T19:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470345#M3751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About your first question, I can say, yes, you can, and I've made some modifications on lwip_udpecho_demo_mqx_twrk65f180m example to validate it. I attach this main.c file for your reference but I will explain all that I've done in order to get this UART driver to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, I included the "fsl_uart_driver.h" file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14545314224261099" data-renderedposition="155_8_1231_16" jivemacro_uid="_14545314224261099"&gt;&lt;P&gt;#include "fsl_uart_driver.h"&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I defined UART 3's handler as it is explained on this document:&lt;A href="https://community.nxp.com/docs/DOC-103966" rel="noopener noreferrer" target="_blank"&gt;How To: Using Interrupt Handlers in MQX with KSDK&lt;/A&gt; (You can also check this useful post &lt;A href="https://community.nxp.com/docs/DOC-104352" rel="noopener noreferrer" target="_blank"&gt;Interrupt handling with KSDK and Kinetis Design Studio&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1454531579363466 jive_text_macro" data-renderedposition="255_8_1231_112" jivemacro_uid="_1454531579363466"&gt;&lt;P&gt;extern void UART_DRV_IRQHandler(uint32_t instance);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void MQX_UART3_RX_TX_IRQHandler () {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_DRV_IRQHandler(3);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this, on Main task, I configured the UART module (pins, baud rate, etc) and all necessary variables:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_14545319568977969 jive_macro_code jive_text_macro" data-renderedposition="409_8_1231_320" jivemacro_uid="_14545319568977969"&gt;&lt;P&gt;const uint8_t buffStart[]&amp;nbsp;&amp;nbsp; = "\r\n++++++++++++++++ UART Send/Receive Blocking Example +++++++++++++++++\r\n";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Inform to start blocking example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t byteCountBuff = sizeof(buffStart);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Initialize variable uartState of type uart_state_t&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uart_state_t uartState;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Fill in uart config data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uart_user_config_t uartConfig = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .bitCountPerChar = kUart8BitsPerChar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .parityMode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = kUartParityDisabled,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .stopBitCount&amp;nbsp;&amp;nbsp;&amp;nbsp; = kUartOneStopBit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .baudRate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 115200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* UART3 pins on PTE4 and PTE5 */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Affects PORTE_PCR4 register */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetMuxMode(PORTE,4u,kPortMuxAlt3);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Affects PORTE_PCR5 register */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORT_HAL_SetMuxMode(PORTE,5u,kPortM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uxAlt3);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UART 3's handler is installed through OSA layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14545320437745101 jive_text_macro" data-renderedposition="792_8_1231_16" jivemacro_uid="_14545320437745101"&gt;&lt;P&gt;OSA_InstallIntHandler(UART3_RX_TX_IRQn, MQX_UART3_RX_TX_IRQHandler);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, I initialize the module and send a basic message:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14545321808589606 jive_text_macro" data-renderedposition="850_8_1231_80" jivemacro_uid="_14545321808589606"&gt;&lt;P&gt;if (kStatus_UART_Success != UART_DRV_Init(UART3_IDX, &amp;amp;uartState, &amp;amp;uartConfig)) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Error on UART initialization\r\n");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_DRV_SendDataBlocking(UART3_IDX, buffStart, byteCountBuff,1000);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this, demo is unaltered and you can see that both UART instances (UART2 as I/O console and UART3) print messages on terminals:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Both Terminals.jpg"&gt;&lt;IMG alt="Both Terminals.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/56136i59E0477769197A8D/image-size/large?v=v2&amp;amp;px=999" title="Both Terminals.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way, you can see that UART can be used as it is used on baremetal examples.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About second point, the way to do it is through NIO (I know about the lack of documentation on this abstraction) but you can base on NIO driver that is used to install default console on MQX system. I can try to explain it deeper if you desire so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For now, I hope this can help you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:25:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470345#M3751</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2020-11-02T13:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470346#M3752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many many thanks for the explanation you gave me about point 1 of my email. Now it works perfectly! I also tried, in the same lwip echo example, to use both UART3 and UART0 following your example and it worked without any problem.&lt;/P&gt;&lt;P&gt;When I initially tried using UART_DRV_SendDataBlocking(..) it crashed because, looking at your good code example, I didn't create and initialized the interrupt handler for the UART3 I tried to use (with UART_DRV_IRQHandler(3) and OSA_InstallIntHandler(..)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That being said, &lt;SPAN style="text-decoration: underline;"&gt;I would like to understand how to implement peripheral code library (point 2 of my email of Feb 3rd)&lt;/SPAN&gt;. For this reason, following your previous reply, I would like to ask you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;a)&lt;/STRONG&gt; &lt;/SPAN&gt;In what KSDK_1.3.0 example with MQX I can find a &lt;SPAN style="color: #3334ca;"&gt;NIO UART code implementation&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #e23d39;"&gt;b)&lt;/STRONG&gt; Can I implement UARTs communication using &lt;SPAN style="color: #3334ca;"&gt;different MQX driver code (compared to NIO)&lt;/SPAN&gt; which currently has description documentation available? Can I use, in my environment described above, "Formatted I/O Library", for example? (This is actually the question of point 2 of my post of Feb 3rd).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your precious help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2016 23:56:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470346#M3752</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-02-04T23:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470347#M3753</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;That's good to know that you could use UART instances and KSDK's drivers in your MQX project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunatelly, there is no example for NIO UART implementation, there are only folders that contain source and header files that show you how it should be implemented (nio_mem, nio_serial, nio_tty). They are located at: &amp;lt;KSDK_1_3_PATH&amp;gt;\rtos\mqx\mqx\source\nio\drivers, but there are not examples projects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We hope to create a basic NIO document that could show you how to setup up your driver and how it works, but it is still planned and hope to be finished soon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for this inconvenience!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac Avila&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 20:27:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470347#M3753</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-02-05T20:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470348#M3754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Isaac for your reply! Unfortunately I guessed I would have received that answer.&lt;/P&gt;&lt;P&gt;How about point b) of my previous post? Can I use "Formatted I/O Library" to implement serial communication on my system?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 21:36:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470348#M3754</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-02-05T21:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470349#M3755</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 am not 100% sure but I think the only way to do it, is to install a NIO driver like it was installed for default console, as i previously said, it is installed in init_bsp.c file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will make an update until a further analysis would be made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this can help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 23:43:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470349#M3755</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-02-05T23:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470350#M3756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Isaac!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 23:45:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470350#M3756</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-02-05T23:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470351#M3757</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;For formatted I/O functions, the MQX_STDLIB library is given (&amp;lt;KSDK_1_3_PATH&amp;gt;\rtos\mqx\mqx_stdlib), and basically, NIO drivers use these function in order to access to read, write functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I almost finish the document to guide you through NIO installation. i will let you know as soon as it is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Isaac Avila&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 17:38:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470351#M3757</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-02-22T17:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470352#M3758</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;Here is a basic guide that explains the way to create you own NIO driver in MQX for KSDK. &lt;A href="https://community.nxp.com/docs/DOC-330036"&gt;Installing NIO driver in MQX for KSDK&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can find it helpful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Isaac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 23:07:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470352#M3758</guid>
      <dc:creator>isaacavila</dc:creator>
      <dc:date>2016-02-29T23:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: TWR-K65F180 with MQX: why cannot I use UART0 and UART3? The system crashes</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470353#M3759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Isaac,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for this late reply, but I haven't checked this post for lots of days. The document attached to your last post is really useful. Right now I have UART driver implemented following what you explained in your post of Feb 3, 2016 12:55 PM, but I will implement it following the NIO document of your previous reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 21:28:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/TWR-K65F180-with-MQX-why-cannot-I-use-UART0-and-UART3-The-system/m-p/470353#M3759</guid>
      <dc:creator>mmoncigoli</dc:creator>
      <dc:date>2016-03-11T21:28:39Z</dc:date>
    </item>
  </channel>
</rss>

