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.

Omap 4430/60 USB OTG Port configured as a host

Other Parts Discussed in Thread: TWL6032, TWL6030

Hi,

We have a custom Omap4460 board ( with TWL6032 PMIC) and need to use the OTG port in host mode to connect to an SMSC hub which then provides 2 external USB host ports and the interface to a 3G modem. We believe we have configured the OTG port in host mode but are not seeing any data on the OTG USB signals and as a result no device are found when the are connected.

We are also having the same problem with an Omap4430 based Pandaboard and are unable to configure the Pandaboard's USB OTG into host mode.

Any pointers would be appreciated

  • Andy,

    How did you test the OTG port on the Pandaboard?  You would need to use a micro-A USB cable for the Pandaboard to act as host.  If you are using devices such as a keyboard or mouse, you should have a self-powered USB hub as well.

    Regards,
    Gina 

  • Gina,

    We did use a micro A USB cable so the ID line is pulled low to force host mode, but we could not get any data visible on the OTGUSB signals. You would usually expect to see the idle pulses after the inital burst of device discovery data. The signals appear to be pulled to the correct state initially. The external ULPI phy is working fine.

    On the custom board power is not a problem as we have a separate USB power switch so we can supply up to 500mA per USB device, and the ID line is pulled low via a pull down, the OTGUSB connects to a hub device.

    As the USb phy is integral to the Omap4460 I am sure that this is a software configuration issue - are there any specific configuration parameters that have to be done when compiling the kernel? as I have read that in the "out of the box" configuration the OTG port is configured as a device only. We believe that we have set up the port correctly but obviously  we are missing some vital step.

    Regards

  • Gina,

    The above reply was frm my colleague as I was out of the office.

    Regards

    Andy

  • Hi.

    I also have same problems with OTG port on Variscite OM4460 SOM. When we connect device to OTG port i see that interrupts counts from TWL icnrements but D+ D- lines has't any activity.

    Variscite's support told that this is TI's kernel problem.

    WBR,

  • It's nice to know we're not alone with this problem. If you do manage to get it working would you please let me know, and if we get it working I will post the solution also.

    Regards

    Andy

  • I checked last TI's kernel release 3.4.21 form dev.omapzoom.org - OTG host mode fixed...i can see perephrial devices...at least a flash drive.

    So Andy try this release and your problem fixed

    WBR,

  • Thanks, will try it and let you know how we get on.

    Regards

    Andy

  • Could you post the link you used please.

    Regards

    Andy

  • i used TI kernel from dev.omapzoom.org. Last tag on 3.4 kernel 1489-17. Kernel version 3.4.21. So i adopted it to my platform.

    Also there is some important thing. What cable did you use? I checked 2 cables. Both have miniB plug but different pin length inside plug.

    Most length pin are +5 and GND, less ID pin and more less D+, D-.

    With this cable otg works fine.

    Oter cable have same length of ID, D+,D- and with this cable otg didnt work

  • I checked second cable again....and seems that ID line doesn't short to GND.

    In our small city there is a problem to buy correct OTG cable....in 21th century :)

    So we have to buy it in Moskow and transport to us for 2000 km...May be Santa Claus gift me it on NewYear's holidays? :)

  • Egor,

    We have tried the kernel on the Pandaboard and have got the USB OTG to work - now to merge the kernel with ours to get out custom board to work. Many thanks for your help and I hope Santa brings you a decent USB OTG cable for Christmas.

    Regards

    Andy

  • Egor,

    One more thing - if we plug a USB device directly into the Pandaboard USB OTG port, the device is enumerated and everything works fine, however if you plug a USB hub in the way then it fails - do you have the same problem with your board?

    Regards

    Andy

  • Hi, Andy.

    Yesterday i noticed same thing. I merged new tag 3.4.23 to my kernel so i will check it today again

    WBR,

  • I confirm - on 3.4.23 thare are problems with USB hub detection.

    After playing with usb hub otg doesn't detect any devices :)

    Even if i restart my board, so problems with OTG still present but at least it works sometime :)

    We bought OTG cable in Moskow....bull ***! ID and GND also doesn't shorted....yeaghhh

    The only  cable that we have working from chineese tablet for 100$....may be we have to buy some of them and take OGT cables from them ? :)

  • Egor,

    Have you got access to a soldering iron? If you short pins 4 and 5 on the micro usb connector on the board then it will force host mode regardless of what cable you use.

    We are investigating the issue at the moment - I will let you know if we have any developments.

    Regards

    Andy

  • Hi Egor Rumjantsev, i wanted to know what O.S. are you using, is just that i have a problem with Pandaboard under Android ICS, i am using 3.0.8 kernel, i cant use the OTG as Host and i saw the kernel in the dev.omapzoom.org with the USB support but it seems not to be for Android, do you know if this problem is solved for Android too?

    Thanks in advanced.

  • Hi.

    I'm using ubuntu 12.04 armhf, kernel 3.4.23.

    I installed some of android versions from Variscite's ftp. OTG port worked on Android. Thats why i started to worry for linux. In most cases Android distro works more stable than Linux :)

    So the problem with OTG sill appears. I stopped my test of OTG for a moment as i need to write other software. May be on new release Ti will fix OTG.

    WBR,

  • Hi, thanks for the reply, i would like to ask you how did you test it on Android, i mean, i powered the Pandaboard first, then,  i plugged the data lines of a touchscreen to the OTG port, then i powered the touchscreen with external supply and then i made :

    echo host > /sys/bus/platform/musb-hdrc/musb-hdrc/mode

    but there was some error with some registers, i tried both, one release from google and one from TI, and in both i found the same memory error, i could find one release of google that didn't have that memory error but there was some other error with the PVR driver so i only could see that nothing happend, not the error of the memory but the OTG wasn't as host, it was always as peripherial and idle, so i don't know how is it switched as host, i am using android ice cream sandwich by the way, and my kernel version is the 3.0.8.

    Best Regards.

  • First of all, i use Variscite's SOM OM4460, not Pandaboard. I used Android disro from their ftp site. My target was to connect usb flash drive. So i load OTG drivers and inserted flash. Flash drive was recognized by kernel. It was enough for me. In the same time linux distro with more recent kernel didn't see any usb devices at all. I contacted with Variscite's support about this problem. They said  that is TI bug. So it was a couple month ago. Current TI kernel at least detect flash drives, butdoesn't work with external hubs. May be TI will fix it later.

    WBR

  • Hi Gina, i want to know if Pandaboard must be re-configured for a micro-A connector to be able to use the micro-A USB cable?, is just that i already tried the  TI kernel from dev.omapzoom.org and a touchscreen powered externally but i couldn't get anything, and when i tried to force the musb driver to be host i got a memory error.

    Best Regards.

  • Hi Andy, i would like to know how you made the USB OTG work as host in Pandaboard, is just that i am running android ICS and i've made many tests but i havent get any success, could you help me please?. Thanks in advanced.

    Best Regards.

  • Michelle,

    We are not using android. We use the Ubuntu kernel (http://dev.omapzoom.org/?p=integration/kernel-ubuntu.git;a=summary). The latest one does seem to have partially fixed the OTG as host problem. (Thanks to Egor), but only partially! If you plug a device in directly then it seems to function as a host correctly, but if you put a hub in the way the enumeration fails - there is still a bug in the code somewhere. This is the situation we are currently at - if we move forward then I will post again on this forum. Likewise if you make any progress I would appreciate it if you would post again.

    Hope this helps

    Andy

  • Hi, i configured the MUSB as Host (using Android), i can see that in the kernel output, but when i attach a device to the port, there is no recognition. in the kernel before attaching any device i get the following:

    [ 0.529846] musb-hdrc: version 6.0, musb-dma, host
    [ 0.530151] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    [ 0.530151] musb-hdrc: MHDRC RTL version 2.0 
    [ 0.530151] musb-hdrc: setup fifo_mode 4
    [ 0.530609] musb-hdrc: 28/31 max ep, 16384/16384 memory
    [ 0.530609] musb-hdrc musb-hdrc: MUSB HDRC host driver
    [ 0.530975] musb-hdrc musb-hdrc: new USB bus registered, assigned bus number 1
    [ 0.530975] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [ 0.530975] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 0.531402] usb usb1: Product: MUSB HDRC host driver
    [ 0.531494] usb usb1: Manufacturer: Linux 3.0.8-g52f4764-dirty musb-hcd
    [ 0.531494] usb usb1: SerialNumber: musb-hdrc
    [ 0.531494] hub 1-0:1.0: USB hub found
    [ 0.532226] hub 1-0:1.0: 1 port detected
    [ 0.532226] musb-hdrc musb-hdrc: USB OTG mode controller at fc0ab000 using DMA, IRQ 124
    [ 0.532775] Switched to NOHz mode on CPU #0
    [ 0.532775] Switched to NOHz mode on CPU #1
    [ 0.533081] NET: Registered protocol family 2
    [ 0.533081] IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
    [ 0.534423] TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
    [ 0.534423] TCP bind hash table entries: 65536 (order: 8, 1572864 bytes)
    [ 0.539154] TCP: Hash tables configured (established 131072 bind 65536)
    [ 0.539154] TCP reno registered



    and when i execute:

    $ cat /proc/bus/usb/devices

    i get the follwing:

    T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 1
    B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
    D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
    P: Vendor=1d6b ProdID=0002 Rev= 3.00
    S: Manufacturer=Linux 3.0.8-g52f4764-dirty musb-hcd
    S: Product=MUSB HDRC host driver
    S: SerialNumber=musb-hdrc
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
    E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms

    i dont know exactly what driver handles the recognition of the devices, do you know what driver does that?, is just that i dont know who could i start to test and know what is wrong or if something is recognized when the devices are attached to the port, and i would like to ask you something about the cable, i am connecting the data lines and the ground to the OTG port, and the device that i am attaching to the port is being powered by an external source of 5V and its ground is connected to the one in Pandaboard, is this configuration right?

    Best Regards.

  • Michelle,

    As I mentioned before we are not using Android, so I cannot comment on the OS. One thing you didn't mention was the state of the ID pin. I know that some cable do not ground this pin and as a result the unit still thinks it's a device.

  • Hi Andy, thanks for the reply, regarding to the gnd pin i checked both, grounding it to panda and not grounding it to panda, and i didnt get anything, i put some printk's in the musb_core.c and musb_host.c to see if something happens when i plug and unplug the device, but nothing happens, so i supposed that those two are not the drivers that handle this connection, do you know where is this connection made in the kernel (regarding to drivers)?, and regarding to the ID pin, what pin are you refering to?.

    Best Regards.

  • Hi, i got it working now (the OTG as Host in Pandaboard unerd Android ICS), i had to ground the J15 in Pandaboard (the ID pin of the OTG), also i selected the Host in the kernel for the inventra controller and disable the gadged driver for the OTG, and i connected the touchpad with an OTG cable and it worked perfectly (connecting only that device), though, when i connect a HUB in that port (a HUB powered by an external source) i get the following error:

    [ 170.161193] usb 1-1: new high speed USB device number 10 using musb-hdrc
    [ 185.289184] usb 1-1: device descriptor read/64, error -110
    [ 200.525543] usb 1-1: device descriptor read/64, error -110
    [ 200.764892] usb 1-1: new high speed USB device number 11 using musb-hdrc
    [ 215.897552] usb 1-1: device descriptor read/64, error -110
    [ 231.133850] usb 1-1: device descriptor read/64, error -110
    [ 231.373138] usb 1-1: new high speed USB device number 12 using musb-hdrc
    [ 241.802825] usb 1-1: device not accepting address 12, error -110

    and it keeps enumerating and the device is never accepted, i dont know what could it be, because i am powering the HUB externally, so i dont think there could be a problem of power.

    Best Regards.

  • Hi Michelle,

    Glad you got it working. We are seing the hub problem as well - it seesm there is another bug in the kernel somewhere but we haven't got to the bottom of it yet. We have actually modded our boards so we don't have to use the OTG port, so for us it's notthat urgent anymore.

    Andy

  • Hi Andy, i was checking that error, but it seems to be the twl6030 when the ID pin of the Pandaboard that goes to that controller, is grounded, it seems that it needs to be switched in every boot for the controller to recognize that the pin was grounded, i checked it manually and the error doesn't appear anymore, i'll make a connection with a transistor to handle it with a gpio in every boot.

    Best Regards.

  • Michelle

    Did you get the hub recognised when you switched the ID pin?

    Regards

    Andy

  • Hi Andy, yes, i plugged a Hub in the OTG port and i plugged 3 devices to that Hub, and i also plugged 1 device in the USB port (the Hub of the Pandaboard, the one with the ethernet connector), and it was recognized and all the devices worked properly, i tested it with the switching (manually) at booting and i didn't get the error, if i plugged and unplugged many times when the O.S.  was running i had the error, that's why i said it had to be only once in every boot.

    Best Regards.

  • Hello,

      We have been running in to a similar issue.  If this thread isn't too old... can you list precisely what kernel/distro image you were using and if you had to make any other changes?

      I am looking to validate our Pandaboards and would prefer to find a freely available distro+kernel that should also have working OTG, even if J15 needs to be grounded at/after each boot.

  • Hi, James.

    We use stable 3.4 series kernel and Ubutntu 12.04 armhf.

    I confirm that OTG issue still exists. Somethimes it works fine, sometimes it fails to work.

    Seems that TI stopped support of OMAP4 family at all. It's a pitty.