AnsweredAssumed Answered

USB gadget serial hotplug

Question asked by Coiln Park on Sep 5, 2017
Latest reply on Sep 7, 2017 by Coiln Park


I am using kernel version 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.







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/"

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


in file,

insmod g_serial.ko


in file,

rmmod g_serial.ko


But, it is not working. ㅜ.ㅜ

I need your help..


Best regards,

Colin Park