This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB enumeration change

Hello all, I've an AM335x board with Android 4.1.2 and a MU609 Huawei GPRS/GSM
module.
When start up, the USB will see the module as 5 tty serial ports:

[    9.097778] usb 1-1: new high-speed USB device number 2 using musb-hdrc
[    9.250244] usb 1-1: New USB device found, idVendor=12d1, idProduct=1573
[    9.257354] usb 1-1: New USB device strings: Mfr=5, Product=4, SerialNumber=0
[    9.264892] usb 1-1: Product: HUAWEI Mobile
[    9.269317] usb 1-1: Manufacturer: Huawei Technologies
[    9.279113] cdc_ether 1-1:2.0: eth1: register 'cdc_ether' at usb-musb-hdrc.1-1, CDC Ethernet Device, 00:a0:c6:03:81:30
[    9.291595] option 1-1:2.2: GSM modem (1-port) converter detected
[    9.298522] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[    9.306488] option 1-1:2.3: GSM modem (1-port) converter detected
[    9.313323] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[    9.321197] option 1-1:2.4: GSM modem (1-port) converter detected
[    9.327972] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[    9.335815] option 1-1:2.5: GSM modem (1-port) converter detected
[    9.342620] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[    9.350494] option 1-1:2.6: GSM modem (1-port) converter detected
[    9.357208] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4

The relevant ports are:
ttyUSB0 is used for sending AT command
ttyUSB3 is used for getting GPS NMEA strings
ttyUSB4 is used for sending AT commands to GPS

ttyUSB1 and ttyUSB2 are used for debug or other sftuffs...

If the modem stops to works, we have to  disconnect it to the system turning it off
via GPIO pin...
when we turn on the module again, the enumeration of the tty USB will change:

[   63.169250] usb 1-1: new high-speed USB device number 3 using musb-hdrc
[   63.311859] usb 1-1: New USB device found, idVendor=12d1, idProduct=1573
[   63.318878] usb 1-1: New USB device strings: Mfr=5, Product=4, SerialNumber=0
[   63.326354] usb 1-1: Product: HUAWEI Mobile
[   63.330749] usb 1-1: Manufacturer: Huawei Technologies
[   63.353393] option 1-1:2.2: GSM modem (1-port) converter detected
[   63.360382] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   63.368194] option 1-1:2.3: GSM modem (1-port) converter detected
[   63.374908] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   63.382568] option 1-1:2.4: GSM modem (1-port) converter detected
[   63.389190] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   63.396881] option 1-1:2.5: GSM modem (1-port) converter detected


[   63.403533] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4
[   63.411163] option 1-1:2.6: GSM modem (1-port) converter detected
[   63.417816] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB5
[   83.155975] cdc_ether 1-1:2.0: eth1: CDC: unexpected notification 01!

In this case, the ttyUSB3 is not more available and GPS application do not works...

There is a way to force the system to hold the original enumeration?

Thanks

M. Sangalli

  • I suspect the issue is because when you disconnect the module, the GPS application still holds ttyUSB3, so while the module is re-enumerated, ttyUSB3 is still locked, so the next available ttyUSB4 is allocated.

    You probably want to close your GPS app first to free the tty before re-plug the module, or even better, the GPS app should not hard link to ttyUSB3, it should quire all the ttys to find which one is for GPS then open it.

  • Yes,the ttyUSB3 port is in use by the gps library... and so the ttUSB2 used by RIL, but this port
    is opened and closed as needed, so it do not cause troubles.
    The question is: why the system allows the driver to close a resource and
    leave a process with an unusefull handle?
    There is a way to notify that the resource is gone ?
    Mario