<?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>MQX Software Solutions中的主题 Re: about MQX interrupt uart</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405048#M13571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/RadekS"&gt;RadekS&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have an example of how to use UART interrupts? I'm using this code to install the ISR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_nvic_int_init(INT_UART4_RX_TX, 2, TRUE);&lt;BR /&gt; _nvic_int_enable(INT_UART4_RX_TX);&lt;BR /&gt; _int_install_isr(INT_UART4_RX_TX, &lt;STRONG&gt;uart4_rx_tx_isr&lt;/STRONG&gt;, port);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing that in my initialization routine along with other things. Immediately after those three lines, I perform a &lt;STRONG&gt;fwrite&lt;/STRONG&gt; and I can see that the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;uart4_rx_tx_isr&lt;/STRONG&gt; function is being called after the first byte is sent&amp;nbsp;and then my applications crashes and the MCU restarts.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 May 2019 19:57:01 GMT</pubDate>
    <dc:creator>m4l490n</dc:creator>
    <dc:date>2019-05-30T19:57:01Z</dc:date>
    <item>
      <title>about MQX interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405044#M13567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey ,every one I find a problem about interrupt uart in MQX .I use K60 microcontroller.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I can receive data from ISR. but when I send bytes to Computer. I just receive one byte in Computer. even if I send one byte follow one byte .I also just can receive only the first byte. Someone can help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After I install my uart ISR . I can not disable it . I have try use _int_disable(); But it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void world_task&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_32 initial_data&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; MY_ISR_STRUCT_PTR&amp;nbsp; uart_isr_ptr;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char return1s;&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; _task_id hello_task_id;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; upload_dev&amp;nbsp; = fopen( "ittyd:", BSP_DEFAULT_IO_OPEN_MODE );&amp;nbsp; //BSP_DEFAULT_IO_OPEN_MODE&amp;nbsp; IO_SERIAL_RAW_IO&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_32 baud=9600;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; // _kuart_int_enable();&lt;BR /&gt; return1s = _bsp_serial_io_init(3, (IO_PERIPHERAL_PIN_MUX_ENABLE|IO_PERIPHERAL_CLOCK_ENABLE));&lt;BR /&gt; if(return1s == MQX_OK)&lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; printf("OK");&lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _int_install_isr(INT_UART3_RX_TX,UART4_RX_ISR,upload_dev); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* EOF */&lt;BR /&gt;uint32_t g_UART_ISR_buffer[40]; //&lt;/P&gt;&lt;P&gt;void UART4_RX_ISR( pointer user_isr_ptr)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned char Redata;&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;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; int itemp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART_MemMapPtr&amp;nbsp; sci_ptr = UART3_BASE_PTR;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((sci_ptr-&amp;gt;S1 &amp;amp; UART_S1_RDRF_MASK)==0) goto UART4_RX_ISR_End;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Redata&amp;nbsp;&amp;nbsp;&amp;nbsp; = sci_ptr-&amp;gt;D;&amp;nbsp;&amp;nbsp;&amp;nbsp; //?????????&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt; if(CreateFrame(Redata)!=0)&amp;nbsp; &lt;BR /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; //_lwevent_set(&amp;amp;lwevent_group,Event_UART4_ReData); &lt;BR /&gt; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART4_RX_ISR_End: ;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 08:28:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405044#M13567</guid>
      <dc:creator>haoyuancai</dc:creator>
      <dc:date>2015-04-14T08:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: about MQX interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405045#M13568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose that you want use ittyd: as serial interface out of default console. Correct?&lt;/P&gt;&lt;P&gt;In that case you should decide whether you will use MQX uart driver or you will write your own.&lt;/P&gt;&lt;P&gt;In your code I see combination of both these approaches. You installed MQX driver but you changed drivers ISR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want use MQX driver, please enable this interface in user_config.h file, use fopen, fread, fwrite for communication over serial driver. Interrupt UART driver already contains buffer for received data. Size of this buffer could be change by definition #define BSPCFG_SCI3_QUEUE_SIZE&amp;nbsp; 64, where this number could be in range 0..256 (64bytes is default size)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want use your own serial driver (probably some low level or generated by PE), please disable this interface user_config.h file, don’t use fopen, fread, fwrite when your driver is not posix and install ISR out of MQX by command int_install_kernel_isr() and _bsp_int_init(). This way you will have full control on your serial interface.&lt;/P&gt;&lt;P&gt;Note: In that case please check also init_gpio.c file whether serial interface pins are not in collision with any other IOs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&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>Fri, 17 Apr 2015 13:40:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405045#M13568</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-04-17T13:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: about MQX interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405046#M13569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey ,&amp;nbsp; Radeks.Thank you so much for ur answer. I will use your function to modify my code . If I have any question . I will chat with you again .Thank you .But I want to ask u how to know how many bytes in buffer that I can read. Because I want to read data from buffer. But I dont know how many. Do you know which function can tell me how many bytes data in buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 14:11:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405046#M13569</guid>
      <dc:creator>haoyuancai</dc:creator>
      <dc:date>2015-04-21T14:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: about MQX interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405047#M13570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to propose two basic options:&lt;/P&gt;&lt;OL style="list-style-type: decimal;"&gt;&lt;LI&gt;You can switch uart driver into non-blocking mode. In this mode the _io_read() function doesn’t wait till the receive buffer is full. It immediately returns received characters and number of received characters. Unfortunately this approach has also some disadvantages. Therefore I cannot fully recommend it.&lt;/LI&gt;&lt;LI&gt;As second option you can use standard ioctl command IO_IOCTL_CHAR_AVAIL for check whether buffer already contains any data. Unfortunately this ioctl command didn’t tell you directly how many characters are in buffer. However you can modify _io_serial_int_ioctl() function in serl_int.c file for return number of characters instead of boll value if you need it.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&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>Wed, 22 Apr 2015 09:46:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405047#M13570</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2015-04-22T09:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: about MQX interrupt uart</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405048#M13571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/RadekS"&gt;RadekS&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have an example of how to use UART interrupts? I'm using this code to install the ISR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_nvic_int_init(INT_UART4_RX_TX, 2, TRUE);&lt;BR /&gt; _nvic_int_enable(INT_UART4_RX_TX);&lt;BR /&gt; _int_install_isr(INT_UART4_RX_TX, &lt;STRONG&gt;uart4_rx_tx_isr&lt;/STRONG&gt;, port);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing that in my initialization routine along with other things. Immediately after those three lines, I perform a &lt;STRONG&gt;fwrite&lt;/STRONG&gt; and I can see that the&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;uart4_rx_tx_isr&lt;/STRONG&gt; function is being called after the first byte is sent&amp;nbsp;and then my applications crashes and the MCU restarts.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 19:57:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/about-MQX-interrupt-uart/m-p/405048#M13571</guid>
      <dc:creator>m4l490n</dc:creator>
      <dc:date>2019-05-30T19:57:01Z</dc:date>
    </item>
  </channel>
</rss>

