Dear Champs,
My customer wants to use UART3(UART3 == /dev/ttyS2) in the usespace application to output debug information, but it is very slow than UART1 used for linux kernel debug information.
They set the terminal as below and output message using write command of file descriptor through UART3 serial console.
int nFD_Log; struct termios ta;
tcgetattr(0, &ta); ta.c_iflag = ICRNL|IXON|IXOFF; ta.c_oflag = OPOST|ONLCR; ta.c_cflag = CS8|CREAD|(B115200&CBAUD); ta.c_lflag = ISIG|ICANON|ECHO|ECHOE|ECHOK|ECHOCTL|ECHOKE|IEXTEN; ta.c_cc[VINTR] = CTRL('C'); ta.c_cc[VQUIT] = CTRL('\\'); ta.c_cc[VERASE] = CTRL('H'); ta.c_cc[VKILL] = CTRL('?'); ta.c_cc[VEOF] = CTRL('D'); ta.c_cc[VMIN] = '\001'; ta.c_cc[VSTART] = CTRL('Q'); ta.c_cc[VSTOP] = CTRL('S'); ta.c_cc[VSUSP] = CTRL('Z'); ta.c_cc[VREPRINT] = CTRL('R'); ta.c_cc[VDISCARD] = CTRL('O'); ta.c_cc[VWERASE] = CTRL('W'); ta.c_cc[VLNEXT] = CTRL('V'); tcsetattr(0, TCSANOW, &ta); ioctl(0, TIOCEXCL, (struct sttyb *)NULL); setbuf(stdout, NULL);
if ((nFD_Log = open("/dev/ttyS2", O_WRONLY | O_NOCTTY)) == -1) { return -1; }
tcgetattr(nFD_Log, &ta); ta.c_iflag = 0; ta.c_oflag = 0; ta.c_cflag &= ~(CS7|PARENB|CBAUD); ta.c_cflag |= (CS8|CBAUD& B115200); ta.c_lflag &= ~(ICANON|ISIG|ECHO); tcsetattr(g_nFD_Log, TCSANOW, &ta); ioctl(nFD_Log, TCFLSH, NULL);
char acLogBuf[256] = { 0, }; write(nFD_Log, acLogBuf, 256);
close(nFD_Log); |
Should they use DMA to make fast in UART3 output?
If so, could you please guide me how they can use DMA for UART3?
Thanks and Best Regards,
SI.