<?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 Re: IO_IOCTL_SERIAL_WAIT_FOR_TC behaves strange (MQX4.0) in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245052#M6956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am following a good tradition and replying to myself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually it appears there's a bug in MQX source code. The file Freescale_MQX_4_0\mqx\source\io\serial\polled\serl_pol_kuart.c, line 958:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while( ! sci_ptr-&amp;gt;S1 &amp;amp; UART_S1_TC_MASK )&lt;BR /&gt;must be replaced with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while( ! (sci_ptr-&amp;gt;S1 &amp;amp; UART_S1_TC_MASK))&lt;/P&gt;&lt;P&gt;to bring it in peace with operators precedence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Mikhail Burakov&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Oct 2013 16:52:46 GMT</pubDate>
    <dc:creator>mikhailburakov</dc:creator>
    <dc:date>2013-10-29T16:52:46Z</dc:date>
    <item>
      <title>IO_IOCTL_SERIAL_WAIT_FOR_TC behaves strange (MQX4.0)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245051#M6955</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 trying to implement support for custom protocol working via RS-485. However I stumbled upon a problem with IO_IOCTL_SERIAL_WAIT_FOR_TC. In my configuration I need to switch a gpio pin after all the data has been sent. To ensure all the data is sent, I tried to use the above ioctl. But on the receiving side I do not get the tail of my data, so it looks like the ioctl returns before all the data is sent. However, I figured out that actually this ioctl does nothing other than waiting for the TC bit in UARTx_S1 register in an infinite loop. I simply removed the ioctl call and replaced it with exact the same infinite loop. Everything started to work as expected afterwards. So my question is, how is this possible? I looked through the serial ioctls part of MQX code and did not found any suspicious calls. For the reference, I am running MQX 4.0.1 on MK20DX256VLK7 CPU. Is there anything I missed in the documentation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Mikhail Burakov&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 16:29:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245051#M6955</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2013-10-29T16:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: IO_IOCTL_SERIAL_WAIT_FOR_TC behaves strange (MQX4.0)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245052#M6956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am following a good tradition and replying to myself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually it appears there's a bug in MQX source code. The file Freescale_MQX_4_0\mqx\source\io\serial\polled\serl_pol_kuart.c, line 958:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while( ! sci_ptr-&amp;gt;S1 &amp;amp; UART_S1_TC_MASK )&lt;BR /&gt;must be replaced with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while( ! (sci_ptr-&amp;gt;S1 &amp;amp; UART_S1_TC_MASK))&lt;/P&gt;&lt;P&gt;to bring it in peace with operators precedence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Mikhail Burakov&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 16:52:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245052#M6956</guid>
      <dc:creator>mikhailburakov</dc:creator>
      <dc:date>2013-10-29T16:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: IO_IOCTL_SERIAL_WAIT_FOR_TC behaves strange (MQX4.0)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245053#M6957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mikhail, you are absolutely right! It will be fixed in next MQX release. Thanks ! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 07:58:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245053#M6957</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-10-30T07:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: IO_IOCTL_SERIAL_WAIT_FOR_TC behaves strange (MQX4.0)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245054#M6958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mikhail,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just wanted to say thank you for your post and findings. It saved me a lot of headache today because I was having a similar problem until I stumbled on your post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Nov 2013 18:37:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/IO-IOCTL-SERIAL-WAIT-FOR-TC-behaves-strange-MQX4-0/m-p/245054#M6958</guid>
      <dc:creator>davidtietz</dc:creator>
      <dc:date>2013-11-07T18:37:13Z</dc:date>
    </item>
  </channel>
</rss>

