linux 串口信息记到日志,[linux学习笔记]之一:ubuntu ch340调试备忘
[linux學習筆記]之一:ubuntu ch340調試備忘
已有 2183 次閱讀2016-11-8 21:52
|個人分類:linux
最近迷上了Linux,入了一塊板。電腦使用win7+ubuntu 雙系統,可是調試的時候就麻煩了,ubuntu下寫好sd卡鏡像,調試的時候還要切換到win7,手上的usb轉串口驅動芯片時CH340,于是就想看ubuntu下時候可以安裝ch340驅動。
網上搜了一下,還真有,不過時很早的內容了。
因為屬于小白,所以就摸著走唄...把ch340 一端插入電腦
輸入命令: lsmod | grep usbserial
輸出:usbserial? ?? ?? ?? ???53248??1 ch341
成功發現了設備,識別出時 ch341??是我記錯了??
輸入:lsusb
輸出一下信息:
Bus 002 Device 003: ID 17ef:4810 Lenovo Integrated Webcam [R5U877]
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 002: ID 1a81:1004 Holtek Semiconductor, Inc.
Bus 006 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
發現了ch341的一些相關信息
輸入命令(查看USB轉串口接入狀態):dmesg
輸出相關信息,部分信息如下:
[??429.184170] usb 6-1: new full-speed USB device number 3 using uhci_hcd
[??429.345937] usb 6-1: New USB device found, idVendor=1a86, idProduct=7523
[??429.345944] usb 6-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[??429.345948] usb 6-1: Product: USB2.0-Ser!
[??429.368123] usbcore: registered new interface driver usbserial
[??429.368396] usbcore: registered new interface driver usbserial_generic
[??429.368875] usbserial: USB Serial support registered for generic
[??429.374125] usbcore: registered new interface driver ch341
[??429.374143] usbserial: USB Serial support registered for ch341-uart
[??429.374165] ch341 6-1:1.0: ch341-uart converter detected
[??429.386851] usb 6-1: ch341-uart converter now attached to ttyUSB0
ID信息與lsusb檢測到的一致,ch341-uart converter now attached to ttyUSB0??成功驅動,端口為ttyUSB0
太驚喜了。免的安裝驅動了
下一步,安裝串口終端軟件,搜到了一個minicom,動手試試:
安裝:sudo apt-get install minicom
打印一些信息,輸入‘y’。
等待安裝成功,然后用sudo minicom -s 設置minicom的端口對應到ttyUSB0(對應使用dmesg命令看到的信息)。
出現配置菜單:
選擇“Serial port setup”,出現串口配置菜單:
輸入A,修改serial device 由/Dev/tty0修改為/dev/ttyusb0,波特率等修改為115200 8N1。
硬件連接,上電,成功輸出打印信息,呵呵
U-Boot SPL 2016.09-rc1 (Oct 01 2016 - 21:31:35)
init i2c
rand test 0 MB RW, err cnt = 0
DRAM:??512 MiB ~
CPU: 1008000000Hz, AXI/AHB/APB: 3/2/2
sunxi_board_init ok!
Trying to boot from MMC1
mmc_dev=0
common/spl/spl_mmc.c L138: mmc_initialize ok
common/spl/spl_mmc.c L155: find_mmc_device ok
part_init: try 'EFI': ret=-1
err=0
mmc_init: 0, time 268
common/spl/spl_mmc.c L298: mmc_init ok
common/spl/spl_mmc.c L335: goto mmc_load_image_raw_sector
hdr read sector 50, count=1
load_legacy
read 906 sectors to 49ffffc0
Jumping to U-Boot
SPL malloc() used 656 bytes (0 KB)
loaded - jumping to U-Boot...
image entry point: 0x
###in board_init_f
U-Boot 2016.09-rc1 (Oct 01 2016 - 21:31:35 +0800) Allwinner Technology
CPU:? ?Allwinner A13 (SUN5I)
Model: Lichee A13
I2C:? ?ready
DRAM:??512 MiB
###out board_init_f
###in board_init_r
MMC:? ?part_init: try 'EFI': ret=-1
part_init: try 'DOS': ret=0
err=0
mmc_init: 0, time 276
*** Warning - bad CRC, using default environment
Setting up a 800x480 lcd console (overscan 0x0)
###set hbp=110, ht=1080, hspw=10
###set vbp=45, vt=527, vspw=10
.........
下一篇分享sd卡ubuntu下創建分區,boot/根文件等鏡像燒錄
總結
以上是生活随笔為你收集整理的linux 串口信息记到日志,[linux学习笔记]之一:ubuntu ch340调试备忘的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: numpy(8)-转换维度
- 下一篇: C指针原理(10)-编译原理-小型计算器