
我有一個 sama5d36 設備,運行 Debian jessie(內核 4.1.10),帶有 DMA USART。為了讓 DMA USART 正確輸出,我必須關閉 ECHO 和 ONLCR。
stty -F /dev/ttyS2 -echo -onlcr speed 115200
如果我進行測試,發送一堆字節,我將收到 2048 個字節,然後它會停止接收,直到我重新啟動。
cat testLines > /dev/ttyS2
cat < /dev/ttyS2
這是 /proc/tty/driver/atmel_serial 的輸出
2: uart:ATMEL_SERIAL mmio:0xF0020000 irq:31 tx:2185 rx:2048 DSR|CD|RI
這是我的 stty 輸出(stty -F /dev/ttyS2 -a):
atmel_usart f0020000.serial: using dma0chan4 for rx DMA transfers
atmel_usart f0020000.serial: using dma0chan5 for tx DMA transfers
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
atmel_serial 的 DMA 緩衝區為 512 位元組。
有什麼見解嗎?
更新:進一步的播放表明,序列將寫入超過2048字節,但在2048位元組後凍結,然後僅寫入一次2048位元組。查看核心中的 atmel_serial.c,看起來環形緩衝區設定為 1024。 所以我仍然很困惑為什麼 2048 位元組很重要。
答案1
將您的核心升級到較新的核心。該驅動程式在早期核心中存在問題。