2020年2月12日 星期三

How to test Uart Port

可利用Loopback來測試

1. 先設置Uart Port
# stty -F /dev/ttyS0 -echo -onlcr

2. 背景讀取 ttyS0
# cat /dev/ttyS0

3. 對Uart傳送字串
# echo "Uart Test" > /dev/ttyS0

終端機就會收到 Uart Test 字串