<?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: Can't read from ttymxc0  in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Can-t-read-from-ttymxc0/m-p/578253#M88195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any suggestions on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tested communication with CuteCom (which I built on the board), but it hangs on read.&lt;/P&gt;&lt;P&gt;And I compared all members of termios structure between Nitrogen's ttymxc0 and my desktop ttyUSB0 and they match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Miroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2016 21:44:11 GMT</pubDate>
    <dc:creator>laza</dc:creator>
    <dc:date>2016-07-19T21:44:11Z</dc:date>
    <item>
      <title>Can't read from ttymxc0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-t-read-from-ttymxc0/m-p/578252#M88194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'comic sans ms', sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'comic sans ms', sans-serif;"&gt;I am using following code on Nitrogen Linux board to communicate over ttymxc0 with another device(TX,RX, GND only). &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: 'comic sans ms', sans-serif;"&gt;The problem is that this code is working when built and run on desktop Ubuntu, but not on Nitrogen.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_1468669463987427 jive_macro_code jive_text_macro" data-renderedposition="186_50_798_512" jivemacro_uid="_1468669463987427"&gt;&lt;P&gt;int set_interface_attribs (int fd, int speed, int parity)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; struct termios tty;&lt;/P&gt;&lt;P&gt;&amp;nbsp; memset (&amp;amp;tty, 0, sizeof tty);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (tcgetattr (fd, &amp;amp;tty) != 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf ("error %d from tcgetattr\n", errno);&lt;/P&gt;&lt;P&gt;&amp;nbsp; return -1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cfsetospeed (&amp;amp;tty, speed);&lt;/P&gt;&lt;P&gt;&amp;nbsp; cfsetispeed (&amp;amp;tty, speed);&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_cflag = (tty.c_cflag &amp;amp; ~CSIZE) | CS8;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_iflag &amp;amp;= ~IGNBRK;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_iflag &amp;amp;= ~(IXON | IXOFF | IXANY);&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_oflag = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; // Timeouts are ignored in canonical input mode or when the NDELAY option is set&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_cc[VMIN]&amp;nbsp; = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; // wait 1st char received&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_cc[VTIME] = 10;&amp;nbsp;&amp;nbsp; // or 1 second&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_cflag |= (CLOCAL | CREAD);&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_cflag &amp;amp;= ~(PARENB | PARODD);&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_cflag |= parity;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_cflag &amp;amp;= ~(CSTOPB | CRTSCTS);&lt;/P&gt;&lt;P&gt;&amp;nbsp; // raw mode&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_lflag &amp;amp;= ~(ICANON | ECHO | ECHONL | ECHOE | ISIG | IEXTEN);&lt;/P&gt;&lt;P&gt;&amp;nbsp; tty.c_iflag &amp;amp;= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (tcsetattr (fd, TCSANOW, &amp;amp;tty) != 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; printf ("error %d from tcsetattr\n", errno);&lt;/P&gt;&lt;P&gt;&amp;nbsp; return -1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Port is open with just O_RDWR flag and tcflush is done after setting port parameters.&lt;/P&gt;&lt;P&gt;Program get stuck on read but from /proc/tty/driver/IMX-UART it seems that both transmitted and received bytes increased.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why doesn't read get these bytes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jul 2016 11:55:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-t-read-from-ttymxc0/m-p/578252#M88194</guid>
      <dc:creator>laza</dc:creator>
      <dc:date>2016-07-16T11:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can't read from ttymxc0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-t-read-from-ttymxc0/m-p/578253#M88195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any suggestions on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tested communication with CuteCom (which I built on the board), but it hangs on read.&lt;/P&gt;&lt;P&gt;And I compared all members of termios structure between Nitrogen's ttymxc0 and my desktop ttyUSB0 and they match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Miroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 21:44:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-t-read-from-ttymxc0/m-p/578253#M88195</guid>
      <dc:creator>laza</dc:creator>
      <dc:date>2016-07-19T21:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can't read from ttymxc0</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Can-t-read-from-ttymxc0/m-p/578255#M88197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gary,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the key problem was getty instance which is started on ttymxc0.&lt;/P&gt;&lt;P&gt;I removed /etc/init/ttymxc0.conf and now it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Miroslav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2016 21:52:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Can-t-read-from-ttymxc0/m-p/578255#M88197</guid>
      <dc:creator>laza</dc:creator>
      <dc:date>2016-07-20T21:52:18Z</dc:date>
    </item>
  </channel>
</rss>

