<?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: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working. in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208397#M12208</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector-san,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;gt;Please find it reattached.&lt;/P&gt;&lt;P&gt;Which patch do you exactly refer as "correct" one ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"mxs-auart.patch.zip" &lt;SPAN class="j-post-author"&gt;Jan 18, 2013 9:20 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"0001-mxs-auart-skip-CTS-handling-for-hardware-flow-contro.patch.zip"&amp;nbsp; &lt;SPAN class="j-post-author"&gt;Jan 21, 2013 4:32 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"0001-mxs-auart-skip-CTS-handling-for-hardware-flow-contro.patch.zip"&amp;nbsp; &lt;SPAN class="j-post-author"&gt;Jan 23, 2013 2:25 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&amp;gt;Do you think this is a valid test? It looks like you are turning hardware flow control on but then you are manually toggling CTS. Couldn't this confuse the UART logic?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;I believe so. RTS/CTS(or DTR/DSR) are completely asynchronous to RXD/TXD. The receiver can de-activate RTS whenever he feels he don't like to receive, then can re-activate whenever he thinks he's ready to receive. There is no guarantee RTS is active when an application open the /dev/ttySP* port. (Although I admit it is most likely case, but not guaranteed by RS-232C protocol).&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Also, there is much rare possibility that CTS input may have accidental impulse caused by ESD, EMI or faulty contact. It is unlikely irregular case, but high-reliability medical/industry equipment must overcome such irregular signal. That is why I'm testing iMX28 with 2usec CTS impulse in 100usec interval - it is very unlikely happen in real-life usecase, but I know accidental impulse does happen (I've been working for embedded computing more than 20 years, since the day of 8251, 6850 and Z-80SIO...) and industry equipment never excused to be freeze up by such irregular input.&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2013 23:01:43 GMT</pubDate>
    <dc:creator>YS</dc:creator>
    <dc:date>2013-01-24T23:01:43Z</dc:date>
    <item>
      <title>Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208374#M12185</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'm trying to communicate from an MX28 AUART port (as transmitter) to another target (as receiver) at baudrates of 115200 or higher (230400, 576000) with hardware flow control, but it doesn't seem to work. It works for some time but at some point, after receiving a stop signal from the receiver (RTS deasserted on receiver side) the MX28 stops sending forever, no matter if the receiver tells him to resume sending (RTS asserted back on receiver side).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have backported some patches from mainline (like 00592021010ad86d3b26bac7034034f6af145a2c) but it still fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody verified RTS/CTS hardware flow control on the AUART against a different target (this could be another MX28 too, but not another port on the same target). Kernel version 2.6.35. Driver mxs-auart.c.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Héctor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Dec 2012 11:27:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208374#M12185</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2012-12-14T11:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208375#M12186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should apply patches_for_L2.6.35_MX28_SDK_10.12_SOURCE.tar.gz, which is available from Freescale iMX28 portal site. One particular patch "0592-ENGR38993445-1-UART-driver-Fix-bit-setting-for-flow-.patch" addresses this issue, but you should apply all of them - some patches are critical for system stability.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the IMX28 AUART driver souce code in your kernel source tree, drivers/serial/mxs-auart.c. In function mxs_auart_settermios() there would be initial code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* figure out the hardware flow control settings */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cflag &amp;amp; CRTSCTS)&lt;/P&gt;&lt;P&gt;&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; ctrl2 |= BM_UARTAPP_CTRL2_CTSEN /* | BM_UARTAPP_CTRL2_RTSEN */ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctrl2 &amp;amp;= ~BM_UARTAPP_CTRL2_CTSEN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The commented out CTRL2_RTSEN is actually needed. After applying patch 0592-ENGR38993445-1, it should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* figure out the hardware flow control settings */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cflag &amp;amp; CRTSCTS)&lt;/P&gt;&lt;P&gt;&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; ctrl2 |= BM_UARTAPP_CTRL2_CTSEN | BM_UARTAPP_CTRL2_RTSEN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctrl2 &amp;amp;= ~BM_UARTAPP_CTRL2_CTSEN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 23:55:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208375#M12186</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-07T23:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208376#M12187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Yuji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had already applied all those patches but still the problem is reproducible. It is something that's not immediate, but the MX28 stops transmitting in less than 5 minutes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 07:56:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208376#M12187</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-08T07:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208377#M12188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm...We have tested IMX280 at 3Mbps with RTS/CTS control, but mostly as receiver side. We've tested some transmitter side, but our usual test target is a PC - which is fast enough to process incoming data, rarely de-activates RTS for flow control. So I'm not sure if we fave faced frequent RTS transmission interrupt situation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 18:59:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208377#M12188</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-08T18:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208378#M12189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay... I successfully reproduced (supposed to be) same issue as yours.&lt;/P&gt;&lt;P&gt;I wrote a short program running on PC-Linux, which intentionally turn OFF and ON RTS signal between every receive event. The core of the program is;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; len = read(fd, buff, 8);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total_len += len;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("%d\n", total_len);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status &amp;amp;= ~(TIOCM_RTS);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret = ioctl(fd, TIOCMSET, &amp;amp;status);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usleep(1 * 1000); /* 1msec */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status |= TIOCM_RTS;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret = ioctl(fd, TIOCMSET, &amp;amp;status);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this program on receiver side at 115200bps, sure iMX28 stops transmission in less than 1Kbyte.&lt;/P&gt;&lt;P&gt;I peeked UART and ICOLL register status when the stoppage happend.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ICOLL raw0=80000000 raw1=00000001 raw2=00000000 raw3=00000000&lt;/P&gt;&lt;P&gt;ICOLL 112=00000004&lt;/P&gt;&lt;P&gt;UART CTRL0=00030000 CTRL1=00000000 CTRL2=0022ca01&lt;/P&gt;&lt;P&gt;UART LINECTRL0=00680a70 LINECTRL1=00000000&lt;/P&gt;&lt;P&gt;UART INTR=00720002 STAT=f1f00000 DEBUG=00682800&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTR high (0x0072) shows RTIEN, TXIEN, RXIE, CTSMIEN are set.&lt;/P&gt;&lt;P&gt;INTR low (0x0002) shows CTSMIS is set, which suggests it should generate CTS interrupt.&lt;/P&gt;&lt;P&gt;However the correspoinding ICOLL register (ICOLL raw3, bit 16) shows 0,&lt;/P&gt;&lt;P&gt;which shows no IRQ from UART0 is activated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STAT high (0xf1f0) stuats shows Present, Highspeed, BUSY, CTS, RXFE are set.&lt;/P&gt;&lt;P&gt;BUSY bit (bit 29) should NOT be all-time high, but when this issue happens it will never go down.&lt;/P&gt;&lt;P&gt;Does it mean the UART logic is hung up?&lt;/P&gt;&lt;P&gt;I suspected it will be IRQ handler messes up IRQ mask, but if the UART logic is locked up, this is serious issue...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached "debuart" Linux driver source code to peek registers.&lt;/P&gt;&lt;P&gt;You have to modify KERNEL_SRC path in Makefile according to your build environment.&lt;/P&gt;&lt;P&gt;Once you get debuart.ko,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# insmod debuart.ko&lt;/P&gt;&lt;P&gt;debuart:register major id=253&lt;/P&gt;&lt;P&gt;# mknod /dev/debuart c 253 0 (* only once needed)&lt;/P&gt;&lt;P&gt;# cat /dev/debuart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will give you register dump of UART and ICOLL registers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 19:41:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208378#M12189</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-09T19:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208379#M12190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way I reproduce it is by setting both sides of the communication to use hardware &lt;/P&gt;&lt;P&gt;flow with 'stty' command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;stty -f /dev/ttySP0 115200 raw crtscts&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then on the listener side:&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;cat /dev/ttySP0	(or whatever the port is)&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;and on the sender (MX28):&lt;/P&gt;&lt;P&gt;	&lt;/P&gt;&lt;OL&gt;&lt;LI level="1" type="ol"&gt;&lt;P&gt;while true; do find / &amp;gt; /dev/ttySP0; done&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I modified a little your debuart module to pass the AUART port as parameter, because &lt;/P&gt;&lt;P&gt;in my hardware I'm using AUART1 instead of 0. My registers are similar than yours &lt;/P&gt;&lt;P&gt;after the error occurs, but I don't see the CTSMIS flag set on the interrupt register. &lt;/P&gt;&lt;P&gt;The AUART is busy forever, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ICOLL raw0=80000000 raw1=00000001 raw2=00000000 raw3=00000000&lt;/P&gt;&lt;P&gt;ICOLL 113=00000004&lt;/P&gt;&lt;P&gt;UART1 CTRL0=00030000 CTRL1=00000000 CTRL2=0022c201&lt;/P&gt;&lt;P&gt;UART1 LINECTRL0=00680a70 LINECTRL1=00000000&lt;/P&gt;&lt;P&gt;UART1 INTR=00720000 STAT=f1f00000 DEBUG=00682800&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;Héctor Palacios&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 12:50:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208379#M12190</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-10T12:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208380#M12191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm repeating this experiment. At this point, I think it is true that either iMX28 UART logic or iMX28 Linux UART driver (interrupt handler) has fraw, which causing TX stoppage with CTS flow control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I setup two iMX28 boards (silex SX-580 with its serial service process killed), connecting with cross cable, configure both /dev/ttySP0 port with 115200 raw crtscts. Launch "cat /dev/ttySP0" at one side (receiver), send more than 16byte of data (such as "echo "0123456789ABCDEF0123456789ABCDEF" &amp;gt; /dev/ttySP0) at the other side (transmitter). Almost instantly the transmission stops, even though the CTS level is assert.&lt;/P&gt;&lt;P&gt;After the stoppage happend, the transmission usually resumes when I dnegate RTS (CTS input) then re-assert it. You can do this by simplly ^C to stop reciever process (cat /dev/ttySP0) then launch it again. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logic analyzer shows RTS negate pulse from iMX28 UART is very short ... 20 to 40usec width. I guess this short RTS pulse may cause wrong effect to iMX28 UART logic or Linux driver / interrupt handler. My previous experiment is done with software-controlled RTS pulse, which pulse width is 200-400usec. I think that's why the issue "disappeared" when I rebooted the PC...I think I unintentionally turn hardware flow control ON yesterday. (I reported this morning, deleted because it was my mistake).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The stoppage happens even in lower bitrate, though the frequency is not so often compare to 115200bps (which stops almost immediately after 16byte). I could even successfully make TX stop at 1200bps! The RTS pulse width is still very short regardless to the bitrate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 03:24:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208380#M12191</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-11T03:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208381#M12192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yuij-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually, testing hardware flow control against a PC serial port is a bad idea. PC's &lt;/P&gt;&lt;P&gt;are usually fast enough to process messages so that they rarely need to assert their &lt;/P&gt;&lt;P&gt;RTS line to tell the transmitter to stop sending. Besides, they rarely support &lt;/P&gt;&lt;P&gt;baudrates beyond 115200. If you can, please try to use two embedded devices rather &lt;/P&gt;&lt;P&gt;than a PC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my tests I have used one MX28 as transmitter and one MX53 as receiver, and also &lt;/P&gt;&lt;P&gt;two different i.MX28 targets (one as receiver and the other as transmitter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have sometimes seen it work without failure, and this usually happens when the &lt;/P&gt;&lt;P&gt;receiver's RTS pulse is wide. If I stop the test and launch it again the error usually &lt;/P&gt;&lt;P&gt;triggers quickly, though it sends far more than the 16bytes you talk about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attaching a pair of scope shots where you can see the width of the CTS (on MX28 &lt;/P&gt;&lt;P&gt;transmitter side) and the TX data line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first one (576000baud) shows behaviour during normal transmission. The CTS pulse &lt;/P&gt;&lt;P&gt;is between 4 and 8 usec. This short duration doesn't seem to stop or have any &lt;/P&gt;&lt;P&gt;influence over the TX data flow, which looks continuous. This may be OK, because when &lt;/P&gt;&lt;P&gt;the transmitter receives the CTS it may still be flushing data out of the FIFO and by &lt;/P&gt;&lt;P&gt;the time it ends, the CTS has already been cleared and it can transmit without stopping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second one (230400baud) shows behaviour after the error happens. The pulse is &lt;/P&gt;&lt;P&gt;again around 8 usec or less. After receiving the CTS the MX28 flushes the data on the &lt;/P&gt;&lt;P&gt;buffer and then it stops sending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure of what in the receiver side makes that its RTS pulse is fast or slow. &lt;/P&gt;&lt;P&gt;Maybe a high load of interrupts would make the receiver slower in processing the &lt;/P&gt;&lt;P&gt;serial data. I would recommend to perform the test in systems that are mostly idle, &lt;/P&gt;&lt;P&gt;not running other processes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have sometimes been able to recover the transmission by generating a new CTS pulse, &lt;/P&gt;&lt;P&gt;but most times it never recovers. You need to close the port and reopen it.&lt;/P&gt;&lt;P&gt;-- &lt;/P&gt;&lt;P&gt;Héctor Palacios&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 08:47:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208381#M12192</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-11T08:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208382#M12193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I got a clue. Take look at CTRL2 register at the stoppage happened.&lt;/P&gt;&lt;P&gt;My data shows 0x0022ca01, your data shows 0x0022c201.&lt;/P&gt;&lt;P&gt;At normal state, my iMX28 shows 0x0022cb01.&lt;/P&gt;&lt;P&gt;In both cases of stoppage, bit8 of CTRL2 is not set.&lt;/P&gt;&lt;P&gt;The bit8 on CTRL2 is "TXE", Transmission Enable.&lt;/P&gt;&lt;P&gt;It seems like the chip stopped transmission because TXE is set to 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked at Linux max-aurt.c driver source code.&lt;/P&gt;&lt;P&gt;Function mxs_auart_irq_handle() detects CTS interrupt (by checking CTSMIS bit in INTR register),&lt;/P&gt;&lt;P&gt;then call uart_handle_cts_change() function (actually it is in-ilne macro defined in inlcude/linux/serial_core.h)&lt;/P&gt;&lt;P&gt;with second&amp;nbsp; argument as "current CTS status", read from STAT register,&lt;/P&gt;&lt;P&gt;After it called uart_handle_cts_change, it clears CTSMIS interrupt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u32 stat = __raw_read(s-&amp;gt;port.membase + HW_UARTAPP_STAT);&lt;/P&gt;&lt;P&gt;istatus = istat = __raw_read(s-&amp;gt;port.membase + HW_UARTAPP_INTR);&lt;/P&gt;&lt;P&gt;if (istat &amp;amp; BM_UARTAPP_INTR_CTSMIS) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uart_handle_cts_change(&amp;amp;s-&amp;gt;port, stat &amp;amp; BM_UARTAPP_STAT_CTS);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __raw_writel(BM_UARTAPP_INTR_CTSMIS,&lt;/P&gt;&lt;P&gt;&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; s-&amp;gt;port.membase + HW_UARTAPP_INTR_CLR);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In uart_handle_cts_change(), it will further call uport-&amp;gt;ops-&amp;gt;start_tx() or uport-&amp;gt;ops-&amp;gt;stop_tx() based on the&lt;/P&gt;&lt;P&gt;argument status, which should reflect "current" CTS status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the short CTS pulse screwed up this algorithm. Two IRQs must happen but apparently only one (rising edge of CTS - disabling TXE) happend, keep UART chip TX disabled forever. Or perhaps latency when IRQ is generated and CTS state is picked up in the IRQ handler causing the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 18:54:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208382#M12193</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-11T18:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208383#M12194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yuji-san:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Firstly, let me quote your previous message as it didn't properly post into the thread on the forum:&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;I think I found the cause and cure.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;When CTS is deactivated(rising), CTSMIS interrupt is caused.&lt;/P&gt;
&lt;P&gt;IRQ handler is called, CPU will start calling mxs_auart_irq_handle().&lt;/P&gt;
&lt;P&gt;If CTS pulse is very short, CTS will be activated (falling) before CPU exits from IRQ handler.&lt;/P&gt;
&lt;P&gt;When the CPU clear the "current" interrupt, it will also erase second (falling) IRQ,&lt;/P&gt;
&lt;P&gt;resulting TXE is set to 0 even though CTS level is active (low).&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I swapped sequence of CTSMIS INTR clear and call of uart_handle_cts_change().&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if (istat &amp;amp; BM_UARTAPP_INTR_CTSMIS) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* uart_handle_cts_change(&amp;amp;s-&amp;gt;port, stat &amp;amp; BM_UARTAPP_STAT_CTS); */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __raw_writel(BM_UARTAPP_INTR_CTSMIS,&lt;/P&gt;
&lt;P&gt;&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; s-&amp;gt;port.membase + HW_UARTAPP_INTR_CLR);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; istat &amp;amp;= ~BM_UARTAPP_INTR_CTSMIS;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uart_handle_cts_change(&amp;amp;s-&amp;gt;port, stat &amp;amp; BM_UARTAPP_STAT_CTS);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;After this modification, I don't see stoppage anymore.&lt;/P&gt;
&lt;P&gt;I'm not sure if this is complete solution, however...I guess there is slight chance of "pinhole" could be&lt;/P&gt;
&lt;P&gt;exists, if RTS pulse is just right width it falls down after the CPU picks up STAT register but before&lt;/P&gt;
&lt;P&gt;clear the CTSMIS interrupt. The chance will be very narrow, maybe way less than 1usec...&lt;/P&gt;
&lt;P&gt;but possibility is still there, I think.&lt;/P&gt;
&lt;P&gt;I think we should not manipulate TXE bit from interrupt handler at all. It is automatically handled by chip&lt;/P&gt;
&lt;P&gt;hardware logic. I guess this code in uart_handle_cts_change() is provided for damn UART chip which&lt;/P&gt;
&lt;P&gt;does not have hardware logic flow control at all, but unnecessary if the chip has hardware flow logic -&lt;/P&gt;
&lt;P&gt;even cause undesirable side effect like this.&lt;/P&gt;

&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think you hit the point here: the function &lt;STRONG&gt;&lt;EM&gt;uart_handle_cts_change() &lt;/EM&gt;&lt;/STRONG&gt;seems to be designed to do software flow control as it is manually stopping or starting the TX transmission. On a pure hardware flow control, the driver should not do this. So in my opinion, the driver is doing software flow control stuff even when configured to do hardware flow control.&lt;/P&gt;&lt;P&gt;When hardware flow control is enabled, it is the chip who should pause/resume the transmission automatically, without the need of any software action. My first approach was to remove the call to &lt;STRONG&gt;&lt;EM&gt;uart_handle_cts_change()&lt;/EM&gt;&lt;/STRONG&gt; in the interrupt handler, and have the interrupt handler simply acknowledge the IRQ. This worked fine, and then I thought: "if I'm not doing anything at all in the ISR, why the heck do I need to have the CTS interrupt enabled at all?" So I left the ISR untouched and disabled instead the CTSMIEN (CTS interrupt), but unfortunately this did not work. The reason is that the INTR register reflects the CTS interrupt status even when CTS interrupt is disabled (this looks like an error of the chip).&lt;/P&gt;&lt;P&gt;So I did both things: disable the CTS interrupt and discard the CTS interrupt status if the interrupt is disabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In summary, it looks like the chip correctly handles hardware flow control, but the driver is mixing the handling of hardware and software flow control by turning TXE on and off, which causes trouble when the CTS pulse is short enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find attached my suggested patch which enables the CTS interrupt only when hardware flow control is not enabled.&lt;/P&gt;&lt;P&gt;Please notice that I have not extensively tested it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 16:57:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208383#M12194</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-14T16:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208384#M12195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason I deleted previous post was, UART driver still stops even though I change the interrupt handler order. I tried various tricks. I tried to eliminate TXE disable from ISR (it still stops), but I didn't thought to eliminate uart_handle_cts_change at all. My concern was that, "tty-&amp;gt;hw_stopped" flag belongs to tty domain rather than port driver domain. I saw hw_stopped is set in several places in serial_core.c. If we completely eliminate uart_handle_cts_change, it may cause another case of deadlock because tty-&amp;gt;hw_stopped flag is not cleared on CTS level change.&lt;/P&gt;&lt;P&gt;(Should we implement our "own" version of uart_handle_cts in ISR, just to detect CTS active and enable (but never disable) transmission again?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right, implement software flow control over hardware-flow-controlled UART chip is complete nonsense. However those damm hw_stopped flag is inside tty layer, which is part of linux serial driver framework. We should not alter OS framework due to the chip limitation, so somehow we should find "evasive" way to deal with it...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2013 17:46:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208384#M12195</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-14T17:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208385#M12196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuji-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand your concern but if you look at the i.MX53 driver (mxc_uart.c):&lt;/P&gt;&lt;P&gt;1) It only calls uart_handle_cts_change() function for software flow control.&lt;/P&gt;&lt;P&gt;2) The driver manually sets tty-&amp;gt;hw_stopped to 0 on set_termios hook if hardware flow is enabled. So I added this to my previous patch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested communications using this patch with different combinations of databits, parity and flow control (none, software, and hardware) and it seems to be working without any problem so far.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2013 11:23:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208385#M12196</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-15T11:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208386#M12197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your patch. I confirmed it can withstand extreme condition (300KHz continuous ON/OFF pulse in CTS) which I could not make my version of mxs-auart.c work reliably.&lt;/P&gt;&lt;P&gt;However, I found an issue. Turn CTS off, then send a single byte of data (echo -n A &amp;gt; /dev/ttySP0). It should be blocked until CTS turns ON, or give up after reasonably long timeout (30sec). The original Freescale mxs-uart.c works in that way, so as PC-Linux 16550 UART driver. However when I tried same operation on your version of patched driver, single byte data does not blocked at all. When I tried longer data (echo -n 0123456789ABCDEF &amp;gt; /dev/ttySP0), it blocked by CTS but only for 3 seconds. If I do not activate CTS within 3 seconds, whole 16byte data is gone forever.&lt;/P&gt;&lt;P&gt;I think just to set hw_stopped=0 might not enough to "fool" the tty layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2013 18:42:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208386#M12197</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-15T18:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208387#M12198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently, my "best practice" is to apply minimum modification at mxs_aurat_irq_handel() to ignore negative CTS detection / transmit disable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#if 0&lt;/P&gt;&lt;P&gt;&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; uart_handle_cts_change(&amp;amp;s-&amp;gt;port, stat &amp;amp; BM_UARTAPP_STAT_CTS);&lt;/P&gt;&lt;P&gt;#else&lt;/P&gt;&lt;P&gt;/* Instead of standard CTS handler, we just check if port is blocked&lt;/P&gt;&lt;P&gt;and CTS is ready */&lt;/P&gt;&lt;P&gt;&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; if (stat &amp;amp; BM_UARTAPP_STAT_CTS) {&lt;/P&gt;&lt;P&gt;&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; struct uart_port *uport = &amp;amp;s-&amp;gt;port;&lt;/P&gt;&lt;P&gt;&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; struct tty_port *port = &amp;amp;uport-&amp;gt;state-&amp;gt;port;&lt;/P&gt;&lt;P&gt;&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; struct tty_struct *tty = port-&amp;gt;tty;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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; if (tty-&amp;gt;hw_stopped)&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tty-&amp;gt;hw_stopped = 0;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uport-&amp;gt;ops-&amp;gt;start_tx(uport);&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uart_write_wakeup(uport);&lt;/P&gt;&lt;P&gt;&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; }&lt;/P&gt;&lt;P&gt;&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;/P&gt;&lt;P&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The modified code withstood overnight testing at two units, continuously transmitting at 115200bps with continuous pulsive CTS input (2usec negative pulse with 100usec interval).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2013 20:21:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208387#M12198</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-17T20:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208388#M12199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuji-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Freescale Tech Support elaborated upon our patches and provided me the following one. I don't know if it resolves the 1-byte, 16-bytes transmission issues you talked about.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2013 16:20:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208388#M12199</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-18T16:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208389#M12200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Hector-san. I will try later.&lt;/P&gt;&lt;P&gt;I'm facing with more sinister issue... when I keep transmission from iMX28 AUART with very short CTS-negative pulse input overnight, it freeze up. I'm not sure if this is related to this particular issue or completely different. I'm trying to figure out what makes this freeze up now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2013 22:01:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208389#M12200</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-18T22:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208390#M12201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuji-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The previous patch was disregarding software flow control. Please see corrected patch.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2013 11:32:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208390#M12201</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-21T11:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208391#M12202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hector-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested the Freescale patch, but it looks not very good.&lt;/P&gt;&lt;P&gt;It will stop transmission in less than 10 seconds when configured with NO hardware flow control (stty -F /dev/ttySP0 -crtscts). It is connected to another i.MX28 AUART. I'm pretty sure that calling stop_tx() in mxs_auart_irq_handle() causes this (why do they retain this code? there is no need to handle CTSMIS interrupt when hardware flow control is off!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With flow control ON, it runs longer but did not withstand overnight test. The transmission stopped, even though it was not catastrophic dead-lock as I experienced with my version of mxs-auart.c.&lt;/P&gt;&lt;P&gt;I'm increasingly doubtful that we should not use CTSMIS interrupt at all. This function is very faulty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2013 17:54:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208391#M12202</guid>
      <dc:creator>YS</dc:creator>
      <dc:date>2013-01-22T17:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208392#M12203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yuji-san,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please clarify: did you test the first Freescale patch I posted or the second one? The &lt;/P&gt;&lt;P&gt;first one didn't take into account software flow control, the second one does &lt;/P&gt;&lt;P&gt;(reattached here).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My tests ran ok with high baudrates and hardware/software/none flow control.&lt;/P&gt;&lt;P&gt;The ISR does:&lt;/P&gt;&lt;P&gt;- For HW flow control, it clears the status flag and ACKs the irq&lt;/P&gt;&lt;P&gt;- For SW flow control:&lt;/P&gt;&lt;P&gt;	- if CTS is high and transmission stopped, it resumes.&lt;/P&gt;&lt;P&gt;	- if CTS is low and transmission not stopped, it stops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that for no-flow control, CTS is never triggered.&lt;/P&gt;&lt;P&gt;I'm attaching my whole mxs-auart.c file, just in case you're missing something else &lt;/P&gt;&lt;P&gt;from other patches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 09:25:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208392#M12203</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-23T09:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hardware flow (RTS/CTS) on AUARTs on i.MX28 not working.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208393#M12204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuji-san.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mmm, I think you are right: software flow control has problems too. I tested with &lt;/P&gt;&lt;P&gt;'stty -F /dev/ttySP4 115200 raw ixon -crtscts' and the transmission stops sooner or later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think however that the problem is not the patch or the interrupt handler because &lt;/P&gt;&lt;P&gt;with software flow control the CTS line is not used at all. Anyway, I tried it also &lt;/P&gt;&lt;P&gt;disabling the interrupt and commenting the start/stop lines in the ISR and it still &lt;/P&gt;&lt;P&gt;happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is a different problem. Maybe a misinterpreted data as STOP signal?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2013 12:24:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Hardware-flow-RTS-CTS-on-AUARTs-on-i-MX28-not-working/m-p/208393#M12204</guid>
      <dc:creator>HectorPalacios</dc:creator>
      <dc:date>2013-01-23T12:24:25Z</dc:date>
    </item>
  </channel>
</rss>

