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;
}