Tool/software: Linux
Hi,
On am3352 borad, I used 4 uarts( 0 1 3 4) for data transmission, when write the fd of the uarts, the uart3 and uart4 prints, but the uart0 and uart1 have no prints.
The code as follow:
struct termios newtio;
guint8 ch, i;
static const char g_uart_path[12][12]=
{
"/dev/ttyS0","/dev/ttyS1",
"/dev/ttyS3","/dev/ttyS4",
};
for(ch=0; ch<4; ch++)
{
g_uart_fd[ch] = open(g_uart_path[ch], O_RDWR | O_NOCTTY | O_NONBLOCK);
if(g_uart_fd[ch] < 0)
{
return false;
}
bzero(&newtio, sizeof(struct termios));
newtio.c_cflag = B115200 | CS8 | CREAD | CLOCAL | PARENB & (~PARODD);
newtio.c_iflag = IGNPAR;
tcflush(g_uart_fd[ch], TCIFLUSH);
tcsetattr(g_uart_fd[ch], TCSANOW, &newtio);
}
char *buffer="55555555";
while(1)
{
for(i=0; i<1; i++)
{
write(g_uart_fd[i], buffer, strlen(buffer));
sleep(5);
printf("%d %s \r\n",i, buffer);
}
}