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.

Accessing UART3 from Linux for AM335X

Hello,

I am having AM335X board running Linux.

How can I know on which serial port UART3 is configured?  I need to use this port for UART communication.

If its not enabled, how to enable it? After enabling in Kernel which tty port it will map to?

Any link to C APIs to configure the port e.g. to set baudrate, parity, flow control etc. would help.

Sorry for too many questions.

Thank you.

Best regards

Shailendra  

  • Hi Shailendra,

    Shailendrakumar Mehta said:
    How can I know on which serial port UART3 is configured? 

    I don't understand this question, there is only one UART3 port on AM335x.

    Shailendrakumar Mehta said:
    If its not enabled, how to enable it? After enabling in Kernel which tty port it will map to?

    It is done in the board DTS file - set pinmux for UART3 pins which you use, and enable UART3 device node.

    The TTY port mapped to UART ports are defined in the aliases section in am33xx.dtsi. Typically UART3 is mapped to ttyS3.

    Shailendrakumar Mehta said:
    Any link to C APIs to configure the port e.g. to set baudrate, parity, flow control etc. would help.

    This is generic Linux question, it is out of the support scope on this forum, pleas ask the Linux community for help.

  • Hello Bin Liu

    Thank you for the information.

    Best regards

    Shailendra

  • Hello

    My dtsi file has below entry but there is no mention of TTY or tty.

    Does this mean that uart3 is not mapped anywhere?

    Best regards

    Shailendra

    aliases {
    i2c0 = &i2c0;
    i2c1 = &i2c1;
    i2c2 = &i2c2;
    serial0 = &uart0;
    serial1 = &uart1;
    serial2 = &uart2;
    serial3 = &uart3;
    serial4 = &uart4;
    serial5 = &uart5;
    d_can0 = &dcan0;
    d_can1 = &dcan1;
    usb0 = &usb0;
    usb1 = &usb1;
    phy0 = &usb0_phy;
    phy1 = &usb1_phy;
    ethernet0 = &cpsw_emac0;
    ethernet1 = &cpsw_emac1;
    };

  • Shailendrakumar Mehta said:
    serial3 = &uart3;

    "serial3" means /dev/ttyS3 in Linux userspace.

  • Hello

    Thank you for the reply.

    What is default baud rate, flow control, and other settings?

    How can I change them in dts as well as in run time?

    Best regards

    Shailendra

  • Shailendrakumar Mehta said:
    What is default baud rate, flow control, and other settings?

    Linux command 'stty -F /dev/ttyS3' will tell you all the information.

    Shailendrakumar Mehta said:
    How can I change them in dts as well as in run time?

    These settings are not defined in dts, rather specified in your program when opening the tty port.