Chinaunix首页 | 论坛 | 博客
  • 博客访问: 418444
  • 博文数量: 121
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1393
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-11 12:17
个人简介

www.vibexie.com vibexie@qq.com

文章分类

全部博文(121)

文章存档

2015年(55)

2014年(66)

我的朋友

分类: 嵌入式

2014-11-21 10:19:01

minicom是一个linux串口通信工具,就像Windows下的超级终端,可用来与串口设备通信。
我的linux系统是fedora20(使用什么版本的linux发行版都一样),串口是USB转串口线,开发板是JZ2440;
对于用USB转串口线和直接用串口线连接电脑的minicom配置有一点点差异,我先介绍使用USB转串口线的minicom配置。
1.首先切换为root用户,因为后面的几步都只能root用户才能操作,yum安装minicom
    [root@vibexie dev]# yum install minicom
2.安装成功后,我们用dmesg看看开机信息里有关于USB转串口的驱动信息
    [root@vibexie dev]# dmesg | grep usb   (主要的信息我用红色标记)
  1. [ 0.548336] usbcore: registered new interface driver usbfs
  2. [ 0.548349] usbcore: registered new interface driver hub
  3. [ 0.548620] usbcore: registered new device driver usb
  4. [ 1.189258] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
  5. [ 1.189261] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
  6. [ 1.189263] usb usb1: Product: EHCI Host Controller
  7. [ 1.189265] usb usb1: Manufacturer: Linux 3.11.10-301.fc20.x86_64 ehci_hcd
  8. [ 1.189267] usb usb1: SerialNumber: 0000:02:03.0
  9. [ 1.191104] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
  10. [ 1.191106] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
  11. [ 1.191108] usb usb2: Product: UHCI Host Controller
  12. [ 1.191110] usb usb2: Manufacturer: Linux 3.11.10-301.fc20.x86_64 uhci_hcd
  13. [ 1.191112] usb usb2: SerialNumber: 0000:02:00.0
  14. [ 1.191653] usbcore: registered new interface driver usbserial
  15. [ 1.191671] usbcore: registered new interface driver usbserial_generic
  16. [ 1.191698] usbserial: USB Serial support registered for generic
  17. [ 1.216272] usbcore: registered new interface driver usbhid
  18. [ 1.216273] usbhid: USB HID core driver
  19. [ 1.493878] usb 2-1: new full-speed USB device number 2 using uhci_hcd
  20. [ 1.626413] usb 2-1: New USB device found, idVendor=0e0f, idProduct=0003
  21. [ 1.626416] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  22. [ 1.626424] usb 2-1: Product: VMware Virtual USB Mouse
  23. [ 1.626428] usb 2-1: Manufacturer: VMware
  24. [ 1.637347] input: VMware VMware Virtual USB Mouse as /devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-1/2-1:1.0/input/input3
  25. [ 1.637738] hid-generic 0003:0E0F:0003.0001: input,hidraw0: USB HID v1.10 Mouse [VMware VMware Virtual USB Mouse] on usb-0000:02:00.0-1/input0
  26. [ 1.739619] usb 2-2: new full-speed USB device number 3 using uhci_hcd
  27. [ 1.876398] usb 2-2: New USB device found, idVendor=0e0f, idProduct=0002
  28. [ 1.876403] usb 2-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
  29. [ 1.876405] usb 2-2: Product: VMware Virtual USB Hub
  30. [ 2021.712625] usb 2-2.1: new full-speed USB device number 4 using uhci_hcd
  31. [ 2021.976324] usb 2-2.1: New USB device found, idVendor=5345, idProduct=1234
  32. [ 2021.976330] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  33. [ 2021.976337] usb 2-2.1: Product: SEC S3C2410X Test B/D
  34. [ 2021.976344] usb 2-2.1: Manufacturer: System MCU
  35. [ 2581.742772] usb 2-2.1: USB disconnect, device number 4
  36. [ 2585.403354] usb 2-2.1: new full-speed USB device number 5 using uhci_hcd
  37. [ 2585.486360] usb 2-2.1: device descriptor read/64, error -84
  38. [ 2587.230472] usb 2-2.2: new full-speed USB device number 6 using uhci_hcd
  39. [ 2587.457025] usb 2-2.2: New USB device found, idVendor=067b, idProduct=2303
  40. [ 2587.457030] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  41. [ 2587.457033] usb 2-2.2: Product: USB-Serial Controller
  42. [ 2587.457035] usb 2-2.2: Manufacturer: Prolific Technology Inc.
  43. [ 2587.925406] usbcore: registered new interface driver pl2303
  44. [ 2587.927416] usbserial: USB Serial support registered for pl2303
  45. [ 2587.976964] usb 2-2.2: pl2303 converter now attached to ttyUSB0
  46. [ 2627.141646] usb 2-2.1: new full-speed USB device number 7 using uhci_hcd
  47. [ 2627.373112] usb 2-2.1: New USB device found, idVendor=5345, idProduct=1234
  48. [ 2627.373117] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  49. [ 2627.388184] usb 2-2.1: Product: SEC S3C2410X Test B/D
  50. [ 2627.388306] usb 2-2.1: Manufacturer: System MCU
  51. [ 2629.671004] usb 2-2.1: USB disconnect, device number 7
  52. [ 3843.817558] usb 2-2.1: new full-speed USB device number 8 using uhci_hcd
  53. [ 3844.046793] usb 2-2.1: New USB device found, idVendor=5345, idProduct=1234
  54. [ 3844.046799] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  55. [ 3844.046802] usb 2-2.1: Product: SEC S3C2410X Test B/D
  56. [ 3844.046804] usb 2-2.1: Manufacturer: System MCU
  57. [ 4016.716133] usb 2-2.2: USB disconnect, device number 6
  58. [ 4032.847386] usb 2-2.2: new full-speed USB device number 9 using uhci_hcd
  59. [ 4033.070119] usb 2-2.2: New USB device found, idVendor=067b, idProduct=2303
  60. [ 4033.070126] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  61. [ 4033.070128] usb 2-2.2: Product: USB-Serial Controller
  62. [ 4033.070130] usb 2-2.2: Manufacturer: Prolific Technology Inc.
  63. [ 4033.135793] usb 2-2.2: pl2303 converter now attached to ttyUSB0
  64. [ 4377.842288] usb 2-2.1: USB disconnect, device number 8
  65. [ 4381.665688] usb 2-2.1: new full-speed USB device number 10 using uhci_hcd
  66. [ 4381.906820] usb 2-2.1: New USB device found, idVendor=5345, idProduct=1234
  67. [ 4381.906830] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  68. [ 4381.906837] usb 2-2.1: Product: SEC S3C2410X Test B/D
  69. [ 4381.906839] usb 2-2.1: Manufacturer: System MCU
  70. [ 4460.920547] usb 2-2.1: USB disconnect, device number 10
  71. [ 4563.018829] usb 2-2.1: new full-speed USB device number 11 using uhci_hcd
  72. [ 4563.294295] usb 2-2.1: New USB device found, idVendor=5345, idProduct=1234
  73. [ 4563.294301] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
  74. [ 4563.294304] usb 2-2.1: Product: SEC S3C2410X Test B/D
  75. [ 4563.294306] usb 2-2.1: Manufacturer: System MCU
红色标记的43-45行说明linux系统支持USB转串口线,并且attach到ttyUSB0
3.通过第二步,我们在/dev目录下肯定能找到ttyUSB0,我们现在开始配置minicom,
    [root@vibexie dev]# minicom -s    此命令会进入minicom配置界面
    
    进入Serial port setup,我们将默认配置设置为一下配置,其中/dev/ttyUSB0就是/dev目录下的ttyUSB0,115200为波特率,数据位8,奇偶校验无,停止位1,硬件软件流控制NO
   
   保存退出后进入Modem and Dialing,将A,B,K项清空
    
    保存退出后,Save setup as df1配置文件,然后Exit from Minicom退出配置。
4.在/dev目录下修改ttyUSB0文件权限使普通用户也可以使用minicom
    [root@vibexie dev]# chmod o+r ttyUSB0
    [root@vibexie dev]# chmod o+w ttyUSB0
    [root@vibexie dev]# chmod o+x ttyUSB0
   不过这种方法是一次性的,重新开机后,又要重复以上命令才能使普通用户用minicom操作ttyUSB0
   最好使用以下方法,设置是永久性的,就是把某个普通用户加入dialout组
    [root@vibexie dev]# usermod -aG dialout vibe

5.测试minicom
    [vibe@vibexie dev]# minicom   进入minicom
    
    再启动开发板,会自动连接
    
    OK表示连接成功了。即配置minicom成功
6.关于minicom的使用
   在minicom界面先按Ctrl+A 松开这两个键,再按Z键,进入minicom命令选项
    
    这些命令式什么意思就不多说了,看得懂点英文就懂了。要说一下Q命令退出minicom
7.关于直接使用串口线连接PC
   我们就是在进入minicom配置界面的时候,在Serial port setup中将ttyUSB0改为ttyS0就好了。
阅读(1989) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~