minicom 是 linux下 一款常用的串口调试工具。
安装 minicom
ubuntu 环境下,使用如下命令安装
apt-get install minicom
配置 minicom
使用前需要进行配置
minicom -s
命令输出内容
+-----[configuration]------+
| Filenames and paths |
| File transfer protocols |
| Serial port setup |
| Modem and dialing |
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
+--------------------------+
键盘方向键,到 Serial port setup
,回车
命令输出内容,一个选择界面
+-----------------------------------------------------------------------+
| A - Serial Device : /dev/ttymxc3 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
键盘输入 A
,光标跳到第一行最后,编辑想要连接的串口设备,我这次的设备使用的串口是 /dev/ttymxc3
,编辑完回车。
键盘输入 E
,弹出波特率选项,输入选项的字母,回车,或者ESC退出。
键盘输入 F
,改为 No,再次键入 F
,改为 Yes。默认是 Yes,要改为 No。
设置完后,回车,返回设置界面,使用方向键,切换到 Exit
。
就可以输入命令了,如果串口一直输出命令,也会接收到。
minicom 是基于窗口的。要弹出所需功能的窗口,可按下 Ctrl + A
按住 Ctrl + A
再输入 Z,打开帮助窗口
帮助内容
+-------------------------------------------------------------------+
| Minicom Command Summary
|
| Commands can be called by CTRL-A <key>
|
| Main Functions Other Functions
|
| Dialing directory..D run script (Go)....G | Clear Screen.......C
| Send files.........S Receive files......R | cOnfigure Minicom..O
| comm Parameters....P Add linefeed.......A | Suspend minicom....J
| Capture on/off.....L Hangup.............H | eXit and reset.....X
| send break.........F initialize Modem...M | Quit with no reset.Q
| Terminal settings..T run Kermit.........K | Cursor key mode....I
| lineWrap on/off....W local Echo on/off..E | Help screen........Z
| Paste file.........Y Timestamp toggle...N | scroll Back........B
| Add Carriage Ret...U
|
+-------------------------------------------------------------------+
Ctrl + A 命令
Ctrl + A
按 E,回显,即输入了什么命令会显示,默认是不显示的。
按 X,提示退出 minicom,Yes 选项,回车。
+----------------------+
| Leave Minicom? |
| Yes No |
+----------------------+
直接命令
minicom -D /dev/ttymxc3
我的设备设置了一直输出 GPS 信息