USB gadget serial hotplug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB gadget serial hotplug

3,454 Views
coilnpark
Contributor IV

Hi~

I am using kernel version 4.1.15.2.0.1 with imx6solosabresd custom board.

Until now, I could use USB gadget serial very well.. but I am faced with new usb issue.

while using usb gadget serial, if I pull the usb cable out from the usb port, USB will not recognize that usb cable is not connected.

As below, I am using the below modules and fsl-imx-fb image.

u_serial.ko

usb_f_acm.ko

usb_f_obex.ko

usb_f_serial.ko

g_serial.ko

I found the solution as below.

1. After disconnecting the usb cable, I did "rmmod g_serial.ko".

2. After connecting the usb cable, I did "insmod g_serial.ko"

 

But, I would like the custom board to do insmod and rmmod itself when the usb cable is connected or not.

So, I made udev rule in /etc/udev/rules.d/10-local.rules

ACTION=="add", KERNEL=="ttyGS0", SUBSYSTEM=="tty", RUN+="/etc/udev/rules.d/automount.sh"

ACTION=="remove", KERNEL=="ttyGS0", SUBSYSTEM=="tty", RUN+="/etc/udev/rules.d/autounmount.sh"

in automount.sh file,

insmod g_serial.ko

in autounmount.sh file,

rmmod g_serial.ko

But, it is not working. ㅜ.ㅜ

I need your help..

Best regards,

Colin Park

Labels (4)
0 Kudos
Reply
3 Replies

2,326 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Colin,

Have you considered the ID pin on your hardware/software?

You could take a look to the following links for related issues:

https://community.nxp.com/message/835504

https://community.nxp.com/message/874540


Hope this will be useful for you.
Best regards!
/Carlos
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,326 Views
coilnpark
Contributor IV

Thank you for your reply.

I modified the "imx6qdl.dts" file as below

pastedImage_1.png

I could build the kernel image and then I tried to do porting, but porting was stopped while u-boot booting as below.

Could you give me more advice?

pastedImage_2.png

0 Kudos
Reply

2,326 Views
coilnpark
Contributor IV

U-boot problem was my fault.

Anyway, I tried to change dr_mode = "host" and ""peripheral" but they are not working.

pastedImage_1.png

0 Kudos
Reply