Can you write your code for open the com port?
I use this:
/* open UART */
if ((I_uart_file = ::open(device, O_RDWR | O_NOCTTY | O_NDELAY)) == -1) {
/*
* Could not open the port.
*/
I_isOpen = P_Error;
return;
}
/* set BAUDRATE */
tcgetattr(I_uart_file, &termios_old);
termios_mxc = termios_old;
termios_mxc.c_lflag &= ~(ICANON | ECHO | ISIG);
cfsetospeed(&termios_mxc,B115200);
cfsetispeed(&termios_mxc,B115200);
retval = tcsetattr(I_uart_file, TCSANOW, &termios_mxc);
line_val = LOOPBACK;
ioctl(I_uart_file, TIOCMSET, &line_val);
and I don't have any problem.