<?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のトピックLost chars on uart TX</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Lost-chars-on-uart-TX/m-p/179887#M2608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using MQX370 on Kinetis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ITTYE at 115,200 no handshake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BSP_DEFAULT_IO_OPEN_MODE&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (pointer) ( IO_SERIAL_RAW_IO | IO_SERIAL_NON_BLOCKING)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A single task looks every 10mS to see if any chars have come in, and reliably detects them all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A series of calls to _io_write() from within the same task will &lt;STRONG&gt;intermittently fail to transmit the chars&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Buffer size is set to 64, and we never get close to filling that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lowest level call (_io_serial_int_putc_internal) appears to offer a pass/fail return, but I think MQX throws that away half-way up the stack?&amp;nbsp; As usual, the documentation is pathetic.&lt;/P&gt;&lt;P&gt;(From the IOUG)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The serial device driver provides these services:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;API&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Calls&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;/EM&gt; &lt;EM&gt;Interrupt-driven&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; Polled&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_fopen() _io_serial_int_open() _io_serial_polled_open()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_fclose() _io_serial_int_close() _io_serial_polled_close()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_read() _io_serial_int_read() _io_serial_polled_read()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_write() _io_serial_int_write() _io_serial_polled_write()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_ioctl() _io_serial_int_ioctl() _io_serial_polled_ioctl()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well that was useful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This used to be simple - an IRQ for RX chars, and a blocking call waiting on TXBuffEmpty to transmit them was 100% reliable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is no setting for "non-blocking on RX only" in the MQX driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody got any ideas?&amp;nbsp; Maybe use IOControl calls to see if it is safe to send?&amp;nbsp; look for the rval on _io_write, and do what?&amp;nbsp; Flush the bufffer on every character transmit?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;OldNick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Jul 2012 23:16:50 GMT</pubDate>
    <dc:creator>OldNick</dc:creator>
    <dc:date>2012-07-16T23:16:50Z</dc:date>
    <item>
      <title>Lost chars on uart TX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Lost-chars-on-uart-TX/m-p/179887#M2608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using MQX370 on Kinetis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ITTYE at 115,200 no handshake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BSP_DEFAULT_IO_OPEN_MODE&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (pointer) ( IO_SERIAL_RAW_IO | IO_SERIAL_NON_BLOCKING)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A single task looks every 10mS to see if any chars have come in, and reliably detects them all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A series of calls to _io_write() from within the same task will &lt;STRONG&gt;intermittently fail to transmit the chars&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Buffer size is set to 64, and we never get close to filling that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lowest level call (_io_serial_int_putc_internal) appears to offer a pass/fail return, but I think MQX throws that away half-way up the stack?&amp;nbsp; As usual, the documentation is pathetic.&lt;/P&gt;&lt;P&gt;(From the IOUG)&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The serial device driver provides these services:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;API&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Calls&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;/EM&gt; &lt;EM&gt;Interrupt-driven&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; Polled&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_fopen() _io_serial_int_open() _io_serial_polled_open()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_fclose() _io_serial_int_close() _io_serial_polled_close()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_read() _io_serial_int_read() _io_serial_polled_read()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_write() _io_serial_int_write() _io_serial_polled_write()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;_io_ioctl() _io_serial_int_ioctl() _io_serial_polled_ioctl()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well that was useful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This used to be simple - an IRQ for RX chars, and a blocking call waiting on TXBuffEmpty to transmit them was 100% reliable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is no setting for "non-blocking on RX only" in the MQX driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody got any ideas?&amp;nbsp; Maybe use IOControl calls to see if it is safe to send?&amp;nbsp; look for the rval on _io_write, and do what?&amp;nbsp; Flush the bufffer on every character transmit?&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;OldNick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 23:16:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Lost-chars-on-uart-TX/m-p/179887#M2608</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2012-07-16T23:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lost chars on uart TX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Lost-chars-on-uart-TX/m-p/179888#M2609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed the defines:&lt;/P&gt;&lt;P&gt;#define IO_SERIAL_NON_BLOCKING_RD&amp;nbsp;&amp;nbsp;&amp;nbsp; (0x10)&lt;/P&gt;&lt;P&gt;#define IO_SERIAL_NON_BLOCKING_WR&amp;nbsp;&amp;nbsp;&amp;nbsp; (0x40)&lt;/P&gt;&lt;P&gt;At each build error location change the&amp;nbsp;define by ..RD or ..WR depending if it is read or write operation.&lt;/P&gt;&lt;P&gt;More info:&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="93460" class="jive_macro jive_macro_thread default_title" href="https://community.freescale.com/thread/93460" jivemacro="thread" title="https://community.freescale.com/thread/93460"&gt;https://community.freescale.com/thread/93460&lt;/A&gt;&lt;/P&gt;&lt;P&gt;~Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2012 23:28:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Lost-chars-on-uart-TX/m-p/179888#M2609</guid>
      <dc:creator>MarkP_</dc:creator>
      <dc:date>2012-07-18T23:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lost chars on uart TX</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Lost-chars-on-uart-TX/m-p/179889#M2610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thansk Mark.&amp;nbsp; At least I am not the only one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought of doing that, but reluctant to patch the library.&amp;nbsp; That's Freescale's job, no?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't think it is any better in MQX380 either.&amp;nbsp; Maybe you know different?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Went native and put in a while loop checking IOCTL_CAN_TRANSMIT just to get reliable TX,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void serialP_putchar(&amp;nbsp; char c )&lt;BR /&gt;{&lt;BR /&gt;_mqx_int param ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do//wait here until there is enough space in the buffer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)ioctl( rs232_dev,IO_IOCTL_SERIAL_CAN_TRANSMIT,&amp;amp;param);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }while (param &amp;lt;1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _io_write( rs232_dev, &amp;amp;c, 1 );//now send it&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Functional, but not elegant - as it keeps the task active.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody got any other ideas?&amp;nbsp; Reliable Serial TX is kinda fundamental...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 14:56:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Lost-chars-on-uart-TX/m-p/179889#M2610</guid>
      <dc:creator>OldNick</dc:creator>
      <dc:date>2012-07-19T14:56:32Z</dc:date>
    </item>
  </channel>
</rss>

