Forum Discussion
Altera_Forum
Honored Contributor
13 years agoBug in altera_avalon_uart_read
NOTE: This is not a question, but an information ************************************ The call to read for a /dev/uart returns a wrong value when non-blocking and no data available. This...
Altera_Forum
Honored Contributor
10 years agoHi,
I'm facing the same problem with Quartus Prime 16.0 Lite edition. I have made the following changes to make the fgets function Non Blocking : _serialPort = fopen("/dev/uart_0", "r+"); fd = fileno(_serialPort); fcntl(fd, F_SETFL, O_NONBLOCK); After this it's been set to Non-Blocking, but inside the while loop when I'm passing a "STOP" command (should break out of the while loop) it's not reading the command and goes on continuously. I've tried your method but it's still not working. I've also checked that with getc(_serialPort) "-1" is being returned. Can you please kindly help me with this issue ?