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.

UART4 and Uart5 Not working in am335x



I have enabled uart4 and uart5 in am335x. loop back is working fine in both.But when i am througing kernel log on ttyO4 and ttyO5(changing in u-boot only and getty login is on ttyO0 only) terminal is getting hanged.

I am using TTL to RS-232 converter for testing. ttyO1,ttyO2,ttyO3 are working fine . I can see kernel log on ttyO1,2,3.

But nothing is coming on ttyO4,ttyO5.Just loopback working.

For UART4  and UART5 this is my changes

/* pin-mux for UART4 support */
static struct pinmux_config uart4_pin_mux[] = {
        {"uart0_ctsn.uart4_rxd", OMAP_MUX_MODE1 | AM33XX_PIN_INPUT_PULLUP |         AM33XX_SLEWCTRL_SLOW},

        {"uart0_rtsn.uart4_txd", OMAP_MUX_MODE1 | AM33XX_PULL_UP | AM33XX_PULL_DISA |
                                                                AM33XX_SLEWCTRL_SLOW},
        {NULL, 0},
};


/* pin-mux for UART5 support */
statre working fine.ic struct pinmux_config uart5_pin_mux[] = {
        {"lcd_data9.uart5_rxd", OMAP_MUX_MODE4 | AM33XX_PIN_INPUT| AM33XX_SLEWCTRL_SLOW}        ,
        {"lcd_data8.uart5_txd", OMAP_MUX_MODE4 |AM33XX_PULL_DISA |
                                                            AM33XX_SLEWCTRL_SLOW},
        {NULL, 0},
};
there was no entry for UART5 in mux33xx.c so i enabled uart5 there.and loopback is working.But i am unable to send data on ttyO5.

_AM33XX_MUXENTRY(LCD_DATA8, 0,
                "lcd_data8", "gpmc_a12", NULL, "mcasp0_aclkx",
                "uart5_txd" , NULL, "uart2_ctsn", "gpio2_14"),

_AM33XX_MUXENTRY(LCD_DATA9, 0,
                "lcd_data9", "gpmc_a13", NULL, "mcasp0_fsx",
                "uart5_rxd" , NULL, "uart2_rtsn", "gpio2_15"),

same case with ttyO4 i.e UART4.just Loopback is working.

Suggest me what to do. only loopback working for UART4 and UART5.but i want to send continuous data on all UARTs 1-5. please help me as soon as possible.

  • Do you mean external loopback or internal UART loopback? Check that you pinmux doesn't get overwritten somewhere in the kernel.

  • I shorted tx and rx pins(TTL) and i am getting the data whatever i am sending using minicom. But when i am changing

    the debugging port to ttyO4 and ttyO5 from u-boot.terminal is getting hanged and nothing is coming on the ttyO4(UART4) and ttyO5(UART5). same thing is working in case of UART1,UART2,UART3.

    I have verified the muxing 2-3 times .everthing is ok there because i am able to do loop back.

  • Are ttyO4 and ttyO5 not working in Linux? If so, look at drivers/tty/serial/omap-serial.c. There is an array that needs to be changed. Look for

     static struct uart_omap_port *serial_omap_console_ports[4];

    and change it to

     static struct uart_omap_port *serial_omap_console_ports[OMAP_MAX_HSUART_PORTS];

    Steve K.

  • It is already declared as  6.

       #define OMAP_MAX_HSUART_PORTS 6.

      At TTL level i am able to loop back ttyO4 and ttyO5. but when i am setting my debugging port as ttyO4 or ttyO5 in u-boot.my terminal is hanged and nothing is coming on ttyO4 and ttyO5(using TTL ro RS-232 converter ).

    But ttyO1,ttyO2,ttyO3 are working fine.I can use them as debug port as well as i am able to transfer continuous data between Host PC and board.  

    please suggest the way to resolve this problem.

    May i know whether UART4 and UART5 are  tested by TI in am335evm.

  • It is already declared as  6.

       #define OMAP_MAX_HSUART_PORTS 6.

      At TTL level i am able to loop back ttyO4 and ttyO5. but when i am setting my debugging port as ttyO4 or ttyO5 in u-boot.my terminal is hanged and nothing is coming on ttyO4 and ttyO5(using TTL ro RS-232 converter ).

    But ttyO1,ttyO2,ttyO3 are working fine.I can use them as debug port as well as i am able to transfer continuous data between Host PC and board.  

    please suggest the way to resolve this problem.

    May i know whether UART4 and UART5 are  tested by TI in am335evm.

  • Yes, they have been tested. I used a Beaglebone with the RS232 cape to test them. I'll post more code tomorrow, but in the kernel, just because you have the #define does not mean it is getting used. Look at the driver in drivers/tty/serial/omap-serial.c and make sure that array of structures I mentioned earlier is using that #define and not the value 4.

    I have verified the UARTS in both u-boot and kernel. By the way, which u-boot are you using? I want to make sure I am using the same one you are using.

    Steve K.

  • We have our own customized board based on am335x. We have taken reference from am335xevm.

    we are using barebox not u-boot. our kernel is 3.2 and barebox-2013.07.

    May i know which kernel you have used to test the UARTS .With device tree or without device tree.

    I have verified the driver .its ok and declared as 6 only.

    static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS];