Linux下minicom的配置和使用方法
安裝配置minicom
--------------------------------------------------
# lsmod | grep usbserial (如果直接使用序列槽線,而沒有用到USB轉序列槽裝置,此步可以跳過)
如果有usbserial,說明系統支援USB轉序列槽。
安裝minicom (Fedora自帶有minicom,此步可以跳過)
apt-get install minicom
apt-get install lrzsz
配置minicom
# minicom -s
Serial port setup [Enter]
+-------------------------------------------------------------+
| A - Serial Device : /dev/ttyUSB0 |
| 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? |
+-------------------------------------------------------------+
注: 如果沒有使用USB轉接口,Serial Device要配置為 /dev/ttyS0
Save setup as dfl
Exit from Minicom
使用minicom傳輸檔案
--------------------------------------------------
# minicom
(Ctrl + a) --> s --> zmodem --> [Okay] -->
+-----------------------------------------+
|No file selected - enter filename: |
|> /home/zxl/ssl/codes/led/lls_led.ko | [Enter]
+-----------------------------------------+
注: download kernel by minicom in ubuntu
--------------------------------------------------
When I download linux kernel by x protocol in minicom, it says "Failure executing protocol, press any key to continue".
The problem is the x protocol isn't installed bye ubuntu by default, so you should install it by hand:
# apt-get install lrzsz
After successful download and install, you can send files by x protocol in minicom.
lrzsz包括了x/y/zmodem協定
安裝lrzsz
--------------------------------------------------
1. 從下面的網站下載下傳lrzsz-0.12.20.tar.gz
http://www.filewatcher.com/m/lrzsz-0.12.20.tar.gz.280938.0.0.html
2. tar zxvf lrzsz-0.12.20.tar.gz
3. 檢視裡面的INSTALL文檔了解安裝參數說明和細節
4. # cd lrzsz-0.12.20
5. # ./configure --prefix=/usr/local/lrzsz
6. # make
7. # make install
8. 建立軟連結
# cd /usr/bin
# ln -s /usr/local/lrzsz/bin/lrz rz
# ln -s /usr/local/lrzsz/bin/lsz sz
這樣minicom就可以使用zmodem傳輸檔案了
配置檔案所在目錄
--------------------------------------------------
Ctrl + a o
+-----[configuration]------+
| Filenames and paths |
| File transfer protocols -|
| Serial port setup |
| Modem and dialing |
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
+--------------------------+
+-----------------------------------------------------------------------+
| A - Download directory : /home/zxl |
| B - Upload directory : /tmp |
| C - Script directory : |
| D - Script program : runscript |
| E - Kermit program : |
| F - Logging options |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
A - download 下載下傳的檔案的存放位置
B - upload 從此處讀取上傳的檔案
download 開發闆 ---> PC
upload PC ---> 開發闆
B - Upload directory : /tmp
PC機向開發闆發送檔案,需要發送的檔案在/tmp目錄下(PC機上的目錄)。做了此項配置後,每次向開發闆發送檔案時,隻需輸入檔案名即可,無需輸入檔案所在目錄的絕對路徑
開發闆 ---> PC
--------------------------------------------------
開發闆上的(操作)指令
# sz filename
開發闆上的檔案filename将被傳輸到PC機上/home/zxl目錄下
錄制開發闆輸入資訊:
--------------------------------------------------
Ctrl + A + L
+-----------------------------------------+
|Capture to which file? |
|> /tmp/minicom.cap |
+-----------------------------------------+