ttyUSB0,linux下USB转串口驱动

turmud 2014-12-04 03:14:31
usb 1-1.1: new full-speed USB device number 5 using ehci-pci
usb 1-1.1: New USB device found, idVendor=067b, idProduct=2303
usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.1: Product: USB-Serial Controller
usb 1-1.1: Manufacturer: Prolific Technology Inc.
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver pl2303
usbserial: USB Serial support registered for pl2303
usb 1-1.1: pl2303 converter now attached to ttyUSB0


[root@node3 vincent]# ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Dec 4 14:38 /dev/ttyUSB0


已经显示连上了,波特率什么的也都设置好了,但是不管用minicom还是自己写的open函数去读/dev/ttyUSB0,都读不到任何数据,请问是什么原因,我已经是root权限了。
...全文
639 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
turmud 2014-12-05
  • 打赏
  • 举报
回复
引用 1 楼 lee244868149 的回复:
没有用虚拟机吧
本来放了一台windows笔记本在那里收集数据的,但是太麻烦了,刚好旁边有服务器,就直接插到服务器的USB上去了,可是不管是minicom还是自己写的,都读不到数据
turmud 2014-12-05
  • 打赏
  • 举报
回复
引用 3 楼 q3733353520 的回复:
首先 linux下串口是不需要用户自己去装的 所以要么是你调波特率没保存好 要么是你串口有问题
串口肯定没问题,在windows上用过了,本来放了一台windows笔记本在那里收集数据的,但是太麻烦了,刚好旁边有服务器,就直接插到服务器的USB上去了,可是不管是minicom还是自己写的,都读不到数据
zhxianbin 2014-12-04
  • 打赏
  • 举报
回复
有发送端吗,串口线对吗?
  • 打赏
  • 举报
回复
首先 linux下串口是不需要用户自己去装的 所以要么是你调波特率没保存好 要么是你串口有问题
奔跑的路 2014-12-04
  • 打赏
  • 举报
回复
没有用虚拟机吧
奔跑的路 2014-12-04
  • 打赏
  • 举报
回复
没有用虚拟机吧
Install driver for USB-UART bridge converter on Linux Ubuntu12.04 Ubuntu下USB串口芯片驱动程序安装,支持cp210x,pl2303等 Reference: Fixing the cp210x open - Unable to enable UART Error When you plugin your USB-UART converter, and run "> ls /dev/tty*", if you don't see the /dev/ttyUSB0 (or similar), your Linux does not detect your USB-UART device. We need to install the driver for your device. Here we use Ubuntu12.04, and Updated the source to 3.2.0 version. If there is difference about version Number from your OS platform, please try to modify it into yours. 1.Download the Linux Source Code Open a terminal and execute the following commands. Note that your version of Linux may differ slightly -- adjust accordingly. $ cd ~ $ sudo apt-get install build-essential linux-source $ cp /usr/src/linux-source-3.2.0.tar.bz2 . $ bunzip2 linux-source-3.2.0.tar.bz2 $ tar xf linux-source-3.2.0.tar $ cd ~/linux-source-3.2.0 2.Recompile and Reinstall the cp210x Driver From within a terminal, execute: $ cd ~/linux-source-3.2.0 $ make oldconfig $ make prepare $ make scripts $ cp /usr/src/linux-headers-3.2.0-34-generic-pae/Module.symvers . Here, I have the "3.2.0-29" version also, I launched the command above, but not the below: "cp /usr/src/linux-headers-3.2.0-29-generic-pae/Module.symvers ." Recompile and Reinstall the cp210x Driver Here, We can actually install many kinds of USB-UART converter drivers. We take cp210x as the example. From within a terminal, execute: $ make M=drivers/usb/serial $ sudo mv /lib/modules/$(uname -r)/kernel/drivers/usb/serial/cp210x.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/cp210x.ko.old $ sudo cp drivers/usb/serial/cp210x.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial/ $ sudo modprobe -r cp210x $ sudo modprobe cp210x Reboot Linux system. Run Terminal: $ ls /dev/tty* The we can see the device is detected by Linux Host OS: 【技术】Ubuntu下USB串口芯片驱动程序安装cp210x,pl2303 Reference: http://pharos.ece.utexas.edu/wiki/index.php/Fixing_the_cp210x_open_-_Unable_to_enable_UART_Error_-_04/17/2011 Then, We can configure the minicom to communicate with our target board. ====================================================== Here is an example of configure the parameters of minicom for TLL6527M PAL board: I just copied it here hardly without any font editing. Sorry about that. Serial Communications from Host-PC to TLL6527M Target Hardware The TLL System Design Environment (SDE) running on the host PC comes pre-configured with the required settings for serial-UART communications between the host PC and the TLL6527M base module. Generally, for use with TLL6527M the settings need not to be changed (Note: From the SDE OS version 0.3.2, the serial terminal program Minicom is set to open /dev/ttyUSB0 with the needed configuration as mentioned above.). To start serial communication from host to the TLL6527M, open the serial communication terminal program Minicom. Just open a terminal window on your Linux SDE running on the host PC and type the command "minicom" at the command prompt on your host PC terminal console. The TLL6527M on power-up is set by default to the following serial-UART communication settings: Bits per second = 115200 Data bits = 8 Parity = None Stop Bits = 1 Flow control = None Make sure that the TLL6527M's USB-UART port has been mapped to a ttyUSBx device node in the /dev folder on the host PC SDE. See following example: 【技术】Ubuntu下USB串口芯片驱动程序安装cp210x,pl2303 Now make sure that this "ttyUSBx" is set as the destination port, baud rate is 115200, and 8N1 mode for minicom, by running the command 'minicom -s'. Note that running the "minicom -s" command as a normal user will only apply the settings for the current session. In order to make the settings permanent, these commands need to be run with root privileges.See example below: 【技术】Ubuntu下USB串口芯片驱动程序安装cp210x,pl2303 The following window will appear on your host PC terminal window: 【技术】Ubuntu下USB串口芯片驱动程序安装cp210x,pl2303 Go to ‘Serial port setup’, following screen will appear, make sure that serial device is set to ‘/dev/ttyUSB0’ and bps/par/bits is set to 115200 8N1: 【技术】Ubuntu下USB串口芯片驱动程序安装cp210x,pl2303 Now go back to the main menu and choose ‘save setup as dfl’. This will save the configuration settings and from next time onwards user can directly run ‘minicom’ command without the option ‘–s’ and it will load settings from the saved file. 【技术】Ubuntu下USB串口芯片驱动程序安装cp210x,pl2303 RESET the target by using the SDE's TLL6527M reset utility or by pressing the RESET button on the target. Following messages will be displayed on the terminal. By default, U-Boot is setup to automatically start booting the OS after waiting for a few seconds for the user to interrupt the automatic launch by pressing any key. So to stop U-Boot from loading uClinux and provide U-Boot command prompt, just hit any key. (This is assuming TLL6527M is flashed with u-boot and uClinux. TLL6527Ms are pre-flashed with firmware before shipping).

1,317

社区成员

发帖
与我相关
我的任务
社区描述
主要是开发驱动技术
社区管理员
  • 驱动程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧