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.

PROCESSOR-SDK-AM335X: USB error

Part Number: PROCESSOR-SDK-AM335X


Hi,

Our intention was to disable ADP OTG pulsing which happens every 2 seconds and instead when the user presses a key, enable the VBUS. This was implemented using the patches from the above thread. One peculiar scenario we face is as follows:

Steps followed are as below

a) Plug in USB flash drive onto our unit

b) Give the command, echo 1 > /sys/kernel/debug/musb-hdrc.0/softconnect

c) Mount the USB and follow it up with USB file copy etc

d) Run a script which unmounts the USB and gives the command mentioned below to disconnect the USB flash drive

# echo 0 > /sys/kernel/debug/musb-hdrc.0/softconnect

e) At times after we run this command, we see the below logs:

usb usb1-port1: Cannot enable. Maybe the USB cable is bad?

If after doing step $d (with the flash drive still connected), we were to follow from step b onwards, the flash drive doesn't get mounted properly. Below is the log we get:

usb 1-1: USB disconnect, device number 41
usb 1-1: new high-speed USB device number 42 using musb-hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected

A typical detection log is as below:

[ 9805.649560] usb 1-1: new high-speed USB device number 41 using musb-hdrc
[ 9805.827479] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 9805.843293] scsi host0: usb-storage 1-1:1.0
[ 9807.269776] sd 0:0:0:0: [sda] 30274560 512-byte logical blocks: (15.5 GB/14.4 GiB)

[ 9807.270630] sd 0:0:0:0: [sda] Write Protect is off

[ 9807.270691] sd 0:0:0:0: [sda] Mode Sense: 45 00 00 00
[ 9807.271091] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 9807.284501] sda: sda1

F) If instead of immediately following up with step b after step d, we were to wait about 5-8 seconds then the flash drive gets detected properly. It appears that the logs shows the below line about 4 - 5 times and then the device gets disconnected:

[ 9865.519665] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 9869.839760] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 9874.159678] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 9878.479809] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?

[ 9878.480145] usb 1-1: USB disconnect, device number 43

After getting the disconnect device number.." log, we were to do enable the softconnect command, things work as expected. My question is why do I get the line "Cannot enable. May be the USB cable is bad" How do I overcome the delay before it gives the "USB disconnect, device number.." log.

Regards,

Fariya