VMware虚拟机Linux下的USB转串口使用

关于在VMware虚拟机Linux系统下,USB转串口线使用的配置方法:

  1. 在Windows安装好USB转串口的驱动程序。

  2. 关闭虚拟机下的Linux系统,在VMware下选择VM——>Setting,在Hardware栏点击Add,选择Serial Port,添加完毕后,记住该串口号,这里显示是:Serial Port2 (稍后会在minicom的参数配置中使用到)。
    VMware虚拟机Linux下的USB转串口使用_第1张图片 VMware虚拟机Linux下的USB转串口使用_第2张图片 VMware虚拟机Linux下的USB转串口使用_第3张图片 VMware虚拟机Linux下的USB转串口使用_第4张图片 VMware虚拟机Linux下的USB转串口使用_第5张图片

  3. 将USB转串口线与开发板连接,并启动虚拟机上的Linux系统。

  4. 在Linux系统上,打开终端,进入root权限,输入minicom -s,选择Serial Port setup,设置Serial Devices: /dev/ttyS1(VMware中的Serial Port1 对应于ttyS0,依次类推 ),其它配置根据实际情况设置,设置完毕后,选择Save setup as dfl。
    VMware虚拟机Linux下的USB转串口使用_第6张图片
    VMware虚拟机Linux下的USB转串口使用_第7张图片
    VMware虚拟机Linux下的USB转串口使用_第8张图片
    VMware虚拟机Linux下的USB转串口使用_第9张图片

  5. 在minicom中输入命令,验证通讯是否正常(开发板为嵌入式Linux系统)。
    VMware虚拟机Linux下的USB转串口使用_第10张图片

附:在Linux下,启动minicom有时会出现:”Device /dev/ttySx is locked” 的现象,解决办法:

root@ubuntu: ls /var/lock
LCK..ttyS0 subsys
root@ubuntu: kill 0
root@ubuntu: ls /var/lock
subsys

道理如下:
This means that someone else (or some other process) is supposedly using the serial port. There are various ways to try to find out what process is “using” it. One way is to look at the contents of the lockfile (/var/lock/LCK…). It should be the process id. If the process id is say 100 type “ps 100” to find out what it is. Then if the process is no longer needed, it may be gracefully killed by “kill 100”. If it refuses to be killed use “kill -9 100” to force it to be killed, but then the lockfile will not be removed and you’ll need to delete it manually. Of course if there is no such process as 100 then you may just remove the lockfile but in most cases the lockfile should have been automatically removed if it contained a stale process id (such as 100)

你可能感兴趣的:(ZYNQ-7000)