<?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: iMX6: UART refuse to set baud rate to 1 Mbps in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704662#M109484</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The source of the UART baud rate problem was the stty command of the used busybox- tools (v1.24.2).&lt;/P&gt;&lt;P&gt;A work a round to fix the problem was to install the coreutils including stty that smoothly did the job.&lt;/P&gt;&lt;P&gt;buildroot:&lt;/P&gt;&lt;P&gt;&amp;nbsp; -&amp;gt; Target packages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; Show packages that are also provided by busybox&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; coreutils&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore, I initiated a bug report @ [1] to get the busybox tools fixed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[1]:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://bugs.busybox.net/show_bug.cgi?id=10456" title="https://bugs.busybox.net/show_bug.cgi?id=10456"&gt;10456 – busybox stty unable to set UART baud rate to 1Mbps&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Oct 2017 11:58:15 GMT</pubDate>
    <dc:creator>maikbrenke</dc:creator>
    <dc:date>2017-10-25T11:58:15Z</dc:date>
    <item>
      <title>iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704653#M109475</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 searching for hours to find a solution, but could not find one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a Linux based OS&amp;nbsp;built by &lt;STRONG&gt;buildroot.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the "i.MX 6SoloX Applications Processor Reference Manual" chapter "1.4 Features", all UART interfaces supports up to 4 Mbps.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"Six UARTs operating up to 4.0 Mbps each, …"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that I can not set the baud rate to 1000000 bit per second (1 Mbps).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;# stty -F /dev/ttymxc4 1000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;stty: invalid argument '1000000'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also toggled the hardware flow of the interface:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;# stty -F /dev/ttymxc4 -crtscts&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;# stty -F /dev/ttymxc4 1000000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;stty: invalid argument '1000000'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A C-program to set the baud rate to 1 Mbps runs without any errors but the baud rate goes to '0':&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,monospace;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,monospace;"&gt;char *portname = "/dev/ttymxc4"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,monospace;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: andale mono,monospace;"&gt;set_interface(fd, B1000000);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;# stty -F /dev/ttymxc4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;&lt;STRONG&gt;speed 0&lt;/STRONG&gt; baud; line = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also checked the UART clock speed:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;# cat /sys/class/tty/ttymxc4/uartcl&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;80000000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do I need to do to increase the serial baud rate to 1 Mbps?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 07:29:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704653#M109475</guid>
      <dc:creator>maikbrenke</dc:creator>
      <dc:date>2017-10-12T07:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704654#M109476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reason may be that root frequency does not allow for such configuration,&lt;/P&gt;&lt;P&gt;one can check parent pll and try to reprogram it (note, it may be also used by&lt;/P&gt;&lt;P&gt;other peripherals) and uart ccm dividers using Figure 19-2. Clock Tree i.MX6SX Reference Manual &lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX6SXRM.pdf" rel="nofollow" target="_blank"&gt;http://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;BR /&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>Thu, 12 Oct 2017 23:27:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704654#M109476</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2017-10-12T23:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704655#M109477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I checked the sources [&amp;nbsp;&lt;A data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX6SXRM.pdf" rel="nofollow" target="_blank"&gt;http://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf&lt;/A&gt; ] and will present my findings:&lt;/P&gt;&lt;P&gt;The UART circuit is clocked by "UART_CLK_ROOT". The PLL number 3 (PLL3) in the MCU is running with 480 MHz and after a static divider of 6 in the hardware "UART_CLK_ROOT" results with a frequency of 80 MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to [ &lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/312518#comment-351167" title="https://community.nxp.com/thread/312518#comment-351167"&gt;https://community.nxp.com/thread/312518#comment-351167&lt;/A&gt; ] the UART circuit should be able to generate the required frequency.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But why does the iMX6 not support the baud rate of 1 Mbps?&lt;/P&gt;&lt;P&gt;I am not sure where the problem is. Is it the hardware or the software?&lt;/P&gt;&lt;P&gt;But what is the relation between "UART_CLK_ROOT" and the corresponding baud rate?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also checked the supported baud rates in my setting up to 4 Mbps:&lt;/P&gt;&lt;P&gt;$ for i in $(seq 1 1 4000000); do stty -F /dev/ttymxc4 $i 2&amp;gt; /dev/null; if [ "$?" -eq "0" ]; then echo $i; fi; done&lt;/P&gt;&lt;P&gt;50&lt;/P&gt;&lt;P&gt;75&lt;BR /&gt;110&lt;/P&gt;&lt;P&gt;134&lt;BR /&gt;150&lt;BR /&gt;200&lt;BR /&gt;300&lt;BR /&gt;600&lt;BR /&gt;1200&lt;BR /&gt;1800&lt;BR /&gt;2400&lt;BR /&gt;4800&lt;BR /&gt;9600&lt;BR /&gt;19200&lt;BR /&gt;38400&lt;BR /&gt;57600&lt;BR /&gt;115200&lt;BR /&gt;230400&lt;BR /&gt;460800&lt;BR /&gt;921600&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 13:45:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704655#M109477</guid>
      <dc:creator>maikbrenke</dc:creator>
      <dc:date>2017-10-16T13:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704656#M109478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please check with jtag (or printf) ccm and uart dividers (check uart chapter of RM)&lt;/P&gt;&lt;P&gt;using Figure 19-2. Clock Tree i.MX6SX Reference Manual &lt;BR /&gt;&lt;A class="" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX6SXRM.pdf" rel="nofollow" target="_blank"&gt;http://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf&lt;/A&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 00:16:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704656#M109478</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2017-10-17T00:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704657#M109479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What should I check? The Clock speeds?&lt;/P&gt;&lt;P&gt;As I mentioned the KERNEL sees a "UART_CLK_ROOT" of 80 MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did anyone else run an iMX6SoloX with 1 Mbps. Or can someone check that for me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 06:27:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704657#M109479</guid>
      <dc:creator>maikbrenke</dc:creator>
      <dc:date>2017-10-17T06:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704658#M109480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please check baudrate registers UARTx_UBMR, UARTx_UBRC,&lt;/P&gt;&lt;P&gt;sect.65.4.2.2 Maximum Baud Rate i.MX6SX Reference Manual &lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX6SXRM.pdf" rel="nofollow" target="_blank"&gt;http://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Oct 2017 07:45:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704658#M109480</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2017-10-17T07:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704659#M109481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In now checked the registers and macros:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Marco BOTHER is defined:&lt;BR /&gt;BOTHER: 0x1000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drivers/tty/serial/imx.c:&lt;/P&gt;&lt;P&gt;imx_set_termios() {&lt;BR /&gt;…&lt;BR /&gt;////////// debug @ line 1441&lt;BR /&gt;printk("\nNUM: 0x%02X\n", num);&lt;BR /&gt;printk("DENOM: 0x%02X\n\n", denom);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;writel(num, sport-&amp;gt;port.membase + UBIR);&lt;BR /&gt; writel(denom, sport-&amp;gt;port.membase + UBMR);&lt;BR /&gt;…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;command line:&lt;BR /&gt;# stty -F /dev/ttymxc4&lt;/P&gt;&lt;P&gt;NUM: 0x1F7&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;speed 115200 baud; line = 0;&lt;BR /&gt;intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &amp;lt;undef&amp;gt;;&lt;BR /&gt;eol2 = &amp;lt;undef&amp;gt;; swtch = &amp;lt;undef&amp;gt;; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;&lt;BR /&gt;werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;BR /&gt;-brkint -imaxbel&lt;BR /&gt;# stty -F /dev/ttymxc4 9600&lt;/P&gt;&lt;P&gt;NUM: 0x1F7&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NUM: 0x29&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;# stty -F /dev/ttymxc4 9600&lt;/P&gt;&lt;P&gt;NUM: 0x29&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;# stty -F /dev/ttymxc4 115200&lt;/P&gt;&lt;P&gt;NUM: 0x29&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NUM: 0x1F7&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;# stty -F /dev/ttymxc4 921600&lt;/P&gt;&lt;P&gt;NUM: 0x1F7&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NUM: 0x23F&lt;BR /&gt;DENOM: 0x270&lt;/P&gt;&lt;P&gt;# stty -F /dev/ttymxc4 1000000&lt;BR /&gt;stty: invalid argument '1000000'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the registers UBIR and UBMR will not be calculated and set. So where is the error in this case? Is it the Freescale driver itself?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 09:53:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704659#M109481</guid>
      <dc:creator>maikbrenke</dc:creator>
      <dc:date>2017-10-23T09:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704660#M109482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also checked &lt;STRONG&gt;&lt;SPAN class=""&gt;termios2&lt;/SPAN&gt;&lt;/STRONG&gt; from this thread [&lt;A href="https://community.nxp.com/thread/312518"&gt;How do I change the IMX6 UART clock speed&lt;/A&gt;] with the C-example from this thread [&lt;A class="link-titled" href="http://compgroups.net/comp.lang.python/how-to-set-250000-baud-rate-in-pyserial/1950430" title="http://compgroups.net/comp.lang.python/how-to-set-250000-baud-rate-in-pyserial/1950430"&gt;How to set 250000 baud rate in pyserial ? - comp.lang.python&lt;/A&gt;]:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fcntl.h&amp;gt;&lt;BR /&gt;#include &amp;lt;errno.h&amp;gt;&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;BR /&gt;#include &amp;lt;linux/termios.h&amp;gt;&lt;/P&gt;&lt;P&gt;int ioctl(int d, int request, ...);&lt;/P&gt;&lt;P&gt;int main(int argc, char *argv[]) {&lt;BR /&gt; struct termios2 t;&lt;BR /&gt; int fd,baud;&lt;/P&gt;&lt;P&gt;if (argc != 3) {&lt;BR /&gt; fprintf(stderr,"usage: %s &amp;lt;device&amp;gt; &amp;lt;baud&amp;gt;\n", argv[0]);&lt;BR /&gt; return 1;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;fd = open(argv[1], O_RDWR | O_NOCTTY | O_NDELAY);&lt;/P&gt;&lt;P&gt;if (fd == -1) {&lt;BR /&gt; fprintf(stderr, "error opening %s: %s", argv[1], strerror(errno));&lt;BR /&gt; return 2;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;baud = atoi(argv[2]);&lt;/P&gt;&lt;P&gt;if (ioctl(fd, TCGETS2, &amp;amp;t)) {&lt;BR /&gt; perror("TCGETS2");&lt;BR /&gt; return 3;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;t.c_cflag &amp;amp;= ~CBAUD;&lt;BR /&gt; t.c_cflag |= BOTHER;&lt;BR /&gt; t.c_ispeed = baud;&lt;BR /&gt; t.c_ospeed = baud;&lt;/P&gt;&lt;P&gt;if (ioctl(fd, TCSETS2, &amp;amp;t)) {&lt;BR /&gt; perror("TCSETS2");&lt;BR /&gt; return 4;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if (ioctl(fd, TCGETS2, &amp;amp;t)) {&lt;BR /&gt; perror("TCGETS2");&lt;BR /&gt; return 5;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;printf("actual speed reported %d\n", t.c_ospeed);&lt;BR /&gt; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example is working on a USB serial adapter but not on the UART of the iMX6SX:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;# stty -F /dev/ttymxc4&lt;/P&gt;&lt;P&gt;NUM: 0x29&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;speed &lt;STRONG&gt;9600&lt;/STRONG&gt; baud; line = 0;&lt;BR /&gt;intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &amp;lt;undef&amp;gt;;&lt;BR /&gt;eol2 = &amp;lt;undef&amp;gt;; swtch = &amp;lt;undef&amp;gt;; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;&lt;BR /&gt;werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;BR /&gt;-brkint -imaxbel&lt;BR /&gt;# ./test_arm /dev/ttymxc4 &lt;STRONG&gt;115200&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NUM: 0x29&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NUM: 0x1F7&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;actual speed reported &lt;STRONG&gt;115200&lt;/STRONG&gt;&lt;BR /&gt;# stty -F /dev/ttymxc4&lt;/P&gt;&lt;P&gt;NUM: 0x1F7&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;speed &lt;STRONG&gt;115200&lt;/STRONG&gt; baud; line = 0;&lt;BR /&gt;intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &amp;lt;undef&amp;gt;;&lt;BR /&gt;eol2 = &amp;lt;undef&amp;gt;; swtch = &amp;lt;undef&amp;gt;; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;&lt;BR /&gt;werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;BR /&gt;-brkint -imaxbel&lt;BR /&gt;# ./test_arm /dev/ttymxc4 &lt;STRONG&gt;1000000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NUM: 0x1F7&lt;BR /&gt;DENOM: 0xC34&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NUM: 0x00&lt;BR /&gt;DENOM: 0x00&lt;/P&gt;&lt;P&gt;actual speed reported &lt;STRONG&gt;1000000&lt;/STRONG&gt;&lt;BR /&gt;# stty -F /dev/ttymxc4&lt;/P&gt;&lt;P&gt;NUM: 0x00&lt;BR /&gt;DENOM: 0x00&lt;/P&gt;&lt;P&gt;speed &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt; baud; line = 0;&lt;BR /&gt;intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &amp;lt;undef&amp;gt;;&lt;BR /&gt;eol2 = &amp;lt;undef&amp;gt;; swtch = &amp;lt;undef&amp;gt;; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;&lt;BR /&gt;werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;&lt;BR /&gt;-brkint -imaxbel&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Oct 2017 11:20:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704660#M109482</guid>
      <dc:creator>maikbrenke</dc:creator>
      <dc:date>2017-10-23T11:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704661#M109483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;one can debug it using attached Linux Manual&lt;/P&gt;&lt;P&gt;Chapter 45 Universal Asynchronous Receiver/Transmitter&lt;BR /&gt;(UART) Driver and AN4553 Using Open Source Debugging Tools for Linux on i.MX Processors&lt;BR /&gt;&lt;A href="http://www.nxp.com/assets/documents/data/en/application-notes/AN4553.pdf"&gt;http://www.nxp.com/assets/documents/data/en/application-notes/AN4553.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;igor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2017 01:40:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704661#M109483</guid>
      <dc:creator>igorpadykov</dc:creator>
      <dc:date>2017-10-24T01:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: iMX6: UART refuse to set baud rate to 1 Mbps</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704662#M109484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The source of the UART baud rate problem was the stty command of the used busybox- tools (v1.24.2).&lt;/P&gt;&lt;P&gt;A work a round to fix the problem was to install the coreutils including stty that smoothly did the job.&lt;/P&gt;&lt;P&gt;buildroot:&lt;/P&gt;&lt;P&gt;&amp;nbsp; -&amp;gt; Target packages&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; Show packages that are also provided by busybox&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; coreutils&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore, I initiated a bug report @ [1] to get the busybox tools fixed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[1]:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://bugs.busybox.net/show_bug.cgi?id=10456" title="https://bugs.busybox.net/show_bug.cgi?id=10456"&gt;10456 – busybox stty unable to set UART baud rate to 1Mbps&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2017 11:58:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/iMX6-UART-refuse-to-set-baud-rate-to-1-Mbps/m-p/704662#M109484</guid>
      <dc:creator>maikbrenke</dc:creator>
      <dc:date>2017-10-25T11:58:15Z</dc:date>
    </item>
  </channel>
</rss>

