struct termios termios_Settings; if ((int_FPUart2 = open(UART2_FILE_NAME, O_RDWR)) < 0) { printf("Failed to open uart1%s\n", UART2_FILE_NAME); exit(1); } tcgetattr(int_FPUart2, &termios_Settings); ispeed = cfsetispeed(&termios_Settings, B9600); ospeed = cfsetospeed(&termios_Settings, B9600); termios_Settings.c_cflag &= ~PARENB; //no parity termios_Settings.c_cflag &= ~CSTOPB; //Stop bits =1 termios_Settings.c_cflag &= ~CSIZE; /* Clears the Mask */ termios_Settings.c_cflag |= CS8; /* Set the data bits = 8 */ termios_Settings.c_cflag &= ~CRTSCTS; //turn off hw flow ctrl termios_Settings.c_cflag |= (CREAD |CLOCAL); termios_Settings.c_iflag &= ~(IXON | IXOFF | IXANY); //turn off sw flow ctrl, XON/XOFF termios_Settings.c_oflag &= ~OPOST; //raw o/p termios_Settings.c_iflag &= ~(ICANON | ECHO | ECHOE | ISIG); //non-Canonical mode - raw model if (tcsetattr(int_FPUart2, TCSAFLUSH, &termios_Settings) == 0) { printf("Serial Set Attr successfully\n"); }