Gadget detect VBUS condition

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Gadget detect VBUS condition

2,806 次查看
gyuanh
Contributor I

Hi :

I am using iMX53 qsb with Linux 2.6.35 kernel now. I enable USB gadget function(g_hid) to send data from board device(gadget) to PC host. The data transfer function is OK. but when I plug out device(gadget), I can't receive any "device(gadget) plug out" message from system, also including "device(gadget) plug in". Are there any APIs in user space or any modification in drivers to help to receive plug condition?

Any pointers or idea would be greatly appreciated.

Thenk you.

标签 (2)
0 项奖励
回复
6 回复数

1,735 次查看
YixingKong
Senior Contributor IV

Gyuan Hsieh, does the answer from Weidong help you? If yes, please click Correct Answer.

0 项奖励
回复

1,735 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello,gyuan,

      Did you install driver for i.MX53 on windows ? If not, you can download MFG Tool for FSL'S offical website . After decompressing MFG Tool, you can find driver path. Here is Freescale iMX53 BULK IO driver.

      So please install it , then try it on your application.

Regards

Weidong

0 项奖励
回复

1,735 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

hello,Gyuan,

      OK, Got it !

       When plug USB OTG cable, The level on USB_OTG_ID pin will be changed, it is connect it to PC USB, the level should be 2.5V, if it is disconnected ,the level should be Low, so if you select "USB OTG pin detect support" in linux kernel, you should detect OTG cable status.

Regards.

Weidong

0 项奖励
回复

1,735 次查看
gyuanh
Contributor I

Hello Weidong:

According to this article "USB gadget drivers hangs when the USB connector is unplugged: i.MX53 Quick Start Board"

(https://community.freescale.com/thread/248703), I need to disable "USB OTG pin detect support" to avoid hang problem,

maybe I should  append a GPIO to detect VBUS contion.

Thank you of your reply.

0 项奖励
回复

1,735 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello,gyuan,

      Yes, I agree with you ,too. you can use a gpio , I drew a simple schematic and pasted it here for you a reference.

Regards,

Weidong

0 项奖励
回复

1,735 次查看
gyuanh
Contributor I

Dear Weidong :

I need to know gadget(g_hid) plug state in Linux, not in Window, I don't know why to use BULK driver, and g_hid is Interrupt tranfer type.

Reference to "i.MX53 Multimedia Applications Processor Reference Manual" p4484 VBUSVLD bit may show VBUS condition, but I don't know how to read it currently.

Best regards.

0 项奖励
回复