This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP35x UART speed change



All, I am trying to change the speed of a serial UART on a gumstix WaterSTORM to 3,686,400 and the standard Linux drivers only support 460,800. The OMAP35x Applications Processor Technical Reference Manual (spruf98y.pdf) says that the speed can be set that high via "software" however does not tell me how or if a driver is needed to do so. Any help would be much appreciated. Thank you.

  • Hi Kris,

    There are various ways to change the UART baud rate settings. You can change the register settings which are describe in the OMAP35x TRM Table 17-30. UART Baud Rate Settings where you can choose DLH_REG and DLL_REG values for desired speed. Then follow the sequence described in the OMAP35x TRM section 17.5.1 UART Programming Model.
    An other way is to change the UART baud rate in the source code by the following c code:

    #include <stropts.h>
    #include <asm/termios.h>
    
    struct termios2 tio;
    ioctl(fd, TCGETS2, &tio);
    tio.c_cflag &= ~CBAUD;
    tio.c_cflag |= BOTHER;
    tio.c_ispeed = 3686400;
    tio.c_ospeed = 3686400;
    ioctl(fd, TCSETS2, &tio);



    You can find more ways to change the UART baud rate at:
    stackoverflow.com/.../how-to-set-baud-rate-to-307200-on-linux

    BR
    Tsvetolin Shulev

  • hello tsvetolin,

    Seems like the source code you provided doesn't work.

    #include <stropts.h>
    #include <asm/termios.h>

    struct termios2 tio;
    ioctl(fd, TCGETS2, &tio);
    tio.c_cflag &= ~CBAUD;
    tio.c_cflag |= BOTHER;
    tio.c_ispeed = 3686400;
    tio.c_ospeed = 3686400;
    ioctl(fd, TCSETS2, &tio);

    When I do this and check the baud rate afterwards by "stty -F /dev/ttyS0" it shows the baud rate as 9600. or a Step I am missing?

    Is it possible that there is some sort of resister that needs to be pulled up on the board to allow high speed data transmission?

  • Kris,

    I suppose that the above source code is not working because the UART baud rate of 3686400 bps is non-standard for Linux. Therefore I suggest you to change register values according to OMAP35x TRM description.

    BR
    Tsvetolin Shulev