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.

OMAP5432 UART2 linux user test failure

I want to use OMAP5432 UART2 available on J17 external connectore (TX pin3, RX pin5).

The following log is present in dmsg:

[    0.664642] 48020000.serial: ttyO2 at MMIO 0x48020000 (irq = 106) is a OMAP UART2

When I execute the test code bellow , I have nothing on J17 pin3 on the scope.

 

My test code:

fd = open_serial_port("/dev/ttyO2);

write (fd, buf,1);

int open_serial_port(char *name) {  int  remote_desc;  struct termios termios;        memset (&termios, 0, sizeof (termios));

 remote_desc = open (name, O_RDWR | O_NOCTTY | O_NDELAY |  O_NONBLOCK);  if (remote_desc < 0) {    perror ("Could not open remote device");    return -1;  }

 tcgetattr(remote_desc, &termios);

 cfsetispeed(&termios, B115200);  

cfsetospeed(&termios, B115200);     

termios.c_cflag |= B1152000 | CBAUDEX;     

cfmakeraw(&termios); 

termios.c_cflag &= ~CRTSCTS;     

termios.c_iflag &= ~(IXON | IXOFF | IXANY);    

termios.c_cflag &= ~PARENB; 

 termios.c_cflag &= ~CSTOPB;

termios.c_cflag &= ~CSIZE; 

termios.c_cflag |= CS8;    

termios.c_cflag |= (CLOCAL | CREAD);      

termios.c_lflag &= ~(ICANON | IEXTEN | ECHO | ISIG); 

termios.c_iflag &= ~(ICRNL | INPCK | ISTRIP | BRKINT);     

 termios.c_oflag &= ~OPOST; 

  termios.c_cc[VMIN] = 0;      

termios.c_cc[VTIME] = 3;

  if (tcflush (remote_desc, TCIOFLUSH) < 0)     {       printf ("\n Flushing port failed");       return -1 ;     }  

if (tcsetattr(remote_desc, TCSANOW, &termios) < 0)     {       printf ("\n Setting port failed");       return -1;     }

     printf("UART %s configured....\n",name);

    return remote_desc;

}

 

 

  • Hi Can you provide register dump of the registers,

    and mainly see if the muxing is correct?

    Regards,

    Boyko

  • Hi,

    How and which registers I need to dump?

    Thanks to support me

    regards

    Philippe

  • Hi,

    For example the mux registers responsible for that particular uart.

    Regards,

    Boyko

  • Hi,

    I have the same problem. I am running similar test code. Has there been any progress here?

    I am also confused about which UARTx corresponds to which ttyOx. When I boot I see that the USB debug terminal is on ttyO2.

    Cheers,

    Paul.

  • Hi Paul,

    ttyO2 is designated in the defconfig files

    for example:

    kernel/android-3.8/arch/arm/configs/omap2plus_defconfig

    CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200"

    /kernel/android-3.8/arch/arm/configs/omap5_earlyboot_defconfig:

    CONFIG_CMDLINE="elevator=noop console=ttyO2,115200n8 earlyprintk=0 fixrtc quiet"

    Regards,

    Boyko

  • Hi Paul,

    Here the dts file which correct the problem on our side (uart2 is replace mcspi).

    We rebuild the kernel, then you can see the correct pin detection with  dmesg.

    uart2 is mounted on /dev/ttyO1 on our configuration, but I don't know why

    regards

    Philippe

     

            /* MOD AR: Added for UART2 support */

    uart2_pins: pinmux_uart2_pins {

    pinctrl-single,pins = <

    0x7c 0x118 /* uart2_rx INPUT | PULLUP | MODE0 */

    0x7e 0x0 /* uart2_tx MODE0 */

    >;

    };

            /* END MOD AR */

            /* MOD AR: Removed and replaced by UART2 */

    //mcspi3_pins: pinmux_mcspi3_pins {

    // pinctrl-single,pins = <

    // 0x78 0x101      /*  MCSPI2_SOMI INPUTENABLE | MODE1

    // 0x7a 0x101      /*  MCSPI2_CS INPUTENABLE | MODE1

    // 0x7c 0x101      /*  MCSPI2_SIMO INPUTENABLE | MODE1

    // 0x7e 0x101      /*  MCSPI2_CLK INPUTENABLE | MODE1

    // >;

    //};

            /* END MOD AR */