UART problems

I have enabled UART2 on my Beaglebone Black using the device tree overlay method. I am able to communicate with minicom but not in C. I used termios to setup UART2, I have no issues writing data but I do when I try to read. I don’t understand why in minicom reading works and not in my C program. What could be the reason?
ps- I’ve attached my code just in case.

Best Regards,
Marco Vazquez

uart1.c (1.07 KB)

I found out what I had wrong I was setting the new termios “newt” to zero. I then used the previous contents of ttyO1 on newt instead. That worked great, also I had to remove ICANON from the c_lflag to work.

Nevermind the “memset(&newt,0,sizeof(newt))” works if the line “newt.c_lflag = ICANON;” is set to zero, “newt.c_lflag = 0;”. I am not sure why but it works :).