UART interfaces refuse to set baudrate to 1 Mbps

      UART interfaces refuse to set baudrate to 1 Mbps

      Hello,

      I tried to set the baud rate of a UARTs to 1 Mbps on the SKIT:

      Source Code

      1. # stty -F /dev/ttymxc4 1000000
      2. stty: invalid argument '1000000'


      I checked "/dev/ttymxc0", "/dev/ttymxc2", "/dev/ttymxc4" and "/dev/ttymxc5". No one accept the configuration of 1 Mbps. But 921600 bps and slower is working fine.

      According to the "i.MX 6SoloX Applications Processor Reference Manual" chapter "1.4 Features", all UART interfaces supports up to 4 Mbps.

      Source Code

      1. Six UARTs operating up to 4.0 Mbps each, …


      Can any one hint me to the part that limits the UART baud rate?
      The question is: who is generating this error? Is this really the UART driver? Or is it simply the stty command line tool that can not handle these large baud rates?

      Probably you have to try a small UART test C program where you set the baud rate with the system function and then transmit some bytes. Then you know whether the system call fails or not.

      From the driver side I see no restrictions. If there is a divider that can be used to divide the base clock, then it should work. However the base clock may differ from one i.MX CPU type to another type. For example on regular i.MX6, the base clock is 80 MHz, but there is a fix division by 16 in the UART. So the clock rate should theoretically go up to 5 MHz. On i.MX6SX, there is an option to use 24 MHz as UART clock base and as far as I know the standard driver clock tree code will actually use this setting. So here the clock can be 24MHz/16 = 1.5MHz at most. So maybe this is the restriction here.

      Your F&S Support Team
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.
      Thanks for the reply.

      I checked to set the baud rate in a C program. As shown below the baud rate of 1 Mbps worked fine with a externel USB Adapter (FTDI Chip):

      Source Code

      1. char *portname = "/dev/ttyUSB0";
      2. set_interface(fd, B1000000);



      But with the internel UART_C the same program runs without any errors but sets the baud rate falsely to "0" (see line 2. in RESULT).

      Source Code

      1. char *portname = "/dev/ttymxc4";
      2. set_interface(fd, B1000000);


      Result for internel UART_C:

      Source Code

      1. # stty -F /dev/ttymxc4
      2. speed 0 baud; line = 0;
      3. intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
      4. eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
      5. werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 1;
      6. -brkint -icrnl -imaxbel
      7. -opost
      8. -isig -icanon -iexten -echo


      Therefore, it is also unknown for me who generates this error (stty: invalid argument '1000000').


      Where can I find the base clock part in the sources and more informations about its configuration?
      Or what can I try to do....to investigate this error?

      Post was edited 3 times, last by “BrenkeM” ().

      Hi,

      I also checked the UART CLOCK SPEED for all serial interfaces on the SKIT:

      Source Code

      1. # cat /sys/class/tty/ttymxc0/uartclk
      2. 80000000
      3. # cat /sys/class/tty/ttymxc2/uartclk
      4. 80000000
      5. # cat /sys/class/tty/ttymxc4/uartclk
      6. 80000000
      7. # cat /sys/class/tty/ttymxc5/uartclk
      8. 80000000


      All activated UARTs, from the F+S image, works with 80 MHz.