I’m trying to write/read to serial port UART2. I’m not having problems with the write part, I’ve confirmed that it works perfectly, but when trying to read it says: Unable to read from port /dev/ttyHSL1 -: Resource temporarily unavailable.
The serial port configuration is the following:
fd = open("/dev/ttyHSL1", O_RDWR| O_NOCTTY | O_NDELAY); struct termios options; tcgetattr(fd, &options); cfsetispeed(&options, B38400); cfsetospeed(&options, B38400); options.c_cflag |= (CLOCAL | CREAD); options.c_cflag &= ~PARENB; options.c_cflag |= CSTOPB; options.c_cflag &= ~CSIZE; options.c_cflag |= CS8; options.c_cflag &= ~CRTSCTS; options.c_iflag &= ~(IXON | IXOFF | IXANY); options.c_oflag &= ~OPOST; options.c_cc[VMIN] = 0; options.c_cc[VTIME] = 10; tcsetattr(fd, TCSANOW, &options);
The configuration i’m trying to do is 38400 baud rate, no parity, 2 stop bits, timeout 1 sec, no flow control.
Any advice about why this might be happening?