1. 用法
minicom -S <script name> -C <log name>
參數解析:
-S: 指定要執行的腳本
-C: 指定輸出日志文件名
2. 既然可以指定腳本,那么腳本自然有自己固有的語法
expect { "string1" command1 "string2" command2 [ timeout <time> <command> ] }
3. 腳本示例
expect { "autoboot" break [ timeout 1000 exit ] }
send ""
如果串口輸出了字符串autoboot,那么就退出expect,就會發送空字符串和回車到串口,這樣就進入了uboot,模擬了用戶敲下按鍵
如果1000秒過去了,那就直接exit