主题 : USB转串口模块要插拔一次才可以被识别 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 97315
精华: 0
发帖: 13
金钱: 65 两
威望: 13 点
贡献值: 0 点
综合积分: 26 分
注册时间: 2013-10-18
最后登录: 2013-12-06
楼主  发表于: 2013-10-23 13:00

 USB转串口模块要插拔一次才可以被识别

我现在使用一个USB转串口模块(FT232RL),插在tiny210V2的USB接口上,系统开机或者重启之后,打开串口的时候打开失败,将模块插拔一次以后在此打开的时候就可以了.
请问我想开机或者重启之后不用插拔就可以成功打开应该如何编程?
板子上跑的是android 编程用java打开串口时使用的是FriendlyARM提供的hardwarecontrol.so 库
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2013-10-23 15:15

 回 楼主(liuxia198720) 的帖子

能否把插着FT232RL开机的内核调试信息(可以在命令行上用dmesg命令)贴出来?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2013-10-24 11:19
<6>[    2.612628] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
<6>[    2.619051] usb 1-1.3: Detected FT232RL
<6>[    2.622725] usb 1-1.3: Number of endpoints 2
<6>[    2.628057] Registered gadget driver 'android_usb'
<6>[    2.632723] usb 1-1.3: Endpoint 1 MaxPacketSize 64
<6>[    2.638734] usb 1-1.3: Endpoint 2 MaxPacketSize 64
<6>[    2.641264] mousedev: PS/2 mouse device common for all mice
<6>[    2.646792] usb 1-1.3: Setting MaxPacketSize 64
<6>[    2.651981] input: gpio-keys as /devices/platform/gpio-keys/input/input0
<6>[    2.658655] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0

从这个看,插着设备开机的时候设备应该是检测到了。我想你可以写一个C程序直接调用open()在这种情况下打开"/dev/ttyUSB0"节点看看是否成功。如果成功,说明应该不是驱动的问题。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."