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.

AM3358: How to enable UART1 and develop a simple application

Part Number: AM3358

Hi

I want to enable uart1. How to change code in dts file and how to develop a simple application tht jst read and write to the port. And one more question if i enable the uart then what will be the name of uart in /dev/tty* ?

Plz help me !!

Thanks in advance

  • Hi,

    Sandeep kumar10 said:
    I want to enable uart1. How to change code in dts file

    UART1 is already enabled in am335x-evm.dts, you can use it as the example. Basically you need to set the pinmux and enable uart1 node.

    Sandeep kumar10 said:
    how to develop a simple application tht jst read and write to the port.

    This is out of the support scope on this forum. There are plenty of example on the internet.

    Sandeep kumar10 said:
    if i enable the uart then what will be the name of uart in /dev/tty* ?

    The index of /dev/ttyS* would be the index in serial* in aliases in am33xx.dtsi. So uart1 would be /dev/ttyS1 on AM335x.

  • Hi......Thanks for reply...i added these lines in my dts file

    uart1_pins: pinmux_uart1_pins {
            pinctrl-single,pins = <
                AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0)    /* uart1_rxd.uart1_rxd */
                AM33XX_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0)    /* uart1_txd.uart1_txd */
            >;
        };


    &uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart1_pins>;

        status = "okay";
    };

    Is it correct? I did this but i am not getting any data on tx line. I am using ftdi cable and gtkterm to check the transmitted data.

  • Is this on you custom board? which pins does your ftdi cable connect to? have you double checked they are 0x980 and 0x984?

    Do you see /dev/ttyS1 is initialized in the kernel boot log?

    Can you see the TX line activity on a scope?

  • Hi

    I am using beaglebone black. I am using uart1 which is on P9.24(Tx) and P9.26(Rx). I have connected Tx pin of Beaglebone black to Rx pin of FTDI cable and trying  to check data on console of gtkterm. And when i do ls /dev/ttyS* it is showing many  port starting with ttyS* e.g. ttyS0, ttyS1, ttyS2, ttyS3, ttyS4 etc...

    Thanks for reply

  • Please attach the dmesg kernel log after kernel is booted.

  • ok.....give me sometime. I am doing some changes. After change i will see if i got any issue then i will give here all details.

    Thanks for reply

  • Hi...thanks for help.....Now i am able to do communication through uart. I did one mistake in dts file, in place of "pinctrl-0" i wrote "pinctrl-1" that's why it was not working. After changing from pinctrl-1 to pinctrl-0. It is working now.

    &uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart1_pins>;

        status = "okay";
    };

    Your suggestion help me a alot. Thanks!!