1. 程式人生 > >Ubuntu16.04安裝串列埠除錯工具gtkterm

Ubuntu16.04安裝串列埠除錯工具gtkterm

gtkterm是一個用GTK+寫的串列埠終端。

安裝:sudo apt install gtkterm 

配置檔案的位置為:~/.gtktermrc

 1 [default]
 2 port    = /dev/ttyUSB0          //配置埠號
 3 speed    = 9600              //配置波特率
 4 bits    = 8                 //配置資料位
 5 stopbits    = 1              //配置停止位
 6 parity    = none             //配置奇偶性
 7 flow    = none              
8 wait_delay = 0 9 wait_char = -1 10 rs485_rts_time_before_tx = 30 11 rs485_rts_time_after_tx = 30 12 echo = False 13 crlfauto = False 14 font = "Monospace 12" 15 term_block_cursor = True 16 term_rows = 80 17 term_columns = 25 18 term_scrollback = 200 19 term_visual_bell = True
20 term_foreground_red = 0.660000 21 term_foreground_blue = 0.660000 22 term_foreground_green = 0.660000 23 term_foreground_alpha = 1.000000 24 term_background_red = 0.000000 25 term_background_blue = 0.000000 26 term_background_green = 0.000000 27 term_background_alpha = 1.000000

其實只改了第二行,還有第三行。

連線上開發板,上電後,在終端敲命令dmesg 來檢視安裝驅動的資訊。也可以使用命令:ls /dev/ttyUSB*

 來檢視相關資訊。 

 1 [ 5398.036071] usb 2-1.1: new full-speed USB device number 9 using ehci-pci
 2 [ 5398.131459] usb 2-1.1: New USB device found, idVendor=10c4, idProduct=ea60
 3 [ 5398.131466] usb 2-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 4 [ 5398.131470] usb 2-1.1: Product: CP2104 USB to UART Bridge Controller
 5 [ 5398.131474] usb 2-1.1: Manufacturer: Silicon Labs
 6 [ 5398.131478] usb 2-1.1: SerialNumber: 008FA13B
 7 [ 5398.133162] cp210x 2-1.1:1.0: cp210x converter detected
 8 [ 5398.133501] usb 2-1.1: cp210x converter now attached to ttyUSB0

可以看出連線的是ttyUSB0.
在終端敲入命令:sudo gtkterm
如果沒有設定預設配置,可以在“Configuration”選項卡設定—>Port—>Boud Rate設定為115200;Port設定為/dev/ttyUSB0
然後打印出資訊來。(如果沒列印,可以將開發板reset一下)