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.

Adding an USB2.0 highspeed switch(480Mbps) on DM355 USB

Other Parts Discussed in Thread: TS3USB30E

HI!

I have a big problem, I use Dm355 as a camera with wifi function. so I select an usb wifi module(ralink RT3070 chip). this usb wifi is working very nice on DM355. but my camera is also connected with PC by USB cable, 

Because this usb wifi must be in the body,and DM355 has only one USB controller, so I have to use a high speed usb switch to switch usb D+,D- .

when the camera is working at usb cable mode(connected with PC), usb wifi is powered off,  a fig can show this.

1: DM355 as a slave device, PC as a host, everything is good, whatever which usb switch is used.

2:if DM355 as a host, it cann't communicte with usb wifi module(usb switch is on the bus)

3:but if usb switch is removed, Dm355 can communicate with usb wifi module,

This usb switch is also TI product, TS3USB30E.

It seems that the Ron resistance of usb switch disturb the usb line, and the DM355 cannot drive the usb wifi module.

Can any body give me some advice?

Thanks!

  • David,

    In your configuration I assume the product will either work with PC (as a device) or with Wifi (as host) over USB at a given time.

    In the above layout I see that the ID pin from the connector is not connected to the ID pin of the DM355 usb controller (ID pin at device connector is going to TV out, ID pin at host connector is getting grounded).  Without the ID pin sense DM355 usb controller will not swith modes and probably explains the problem you are experiencing.

    Having said that you would also need to set the DM355 usb driver in the correct mode when you are switching the D+/D- pins.  For this you would need to build the USB driver in OTG mode.  This will enable the USB controller to sense the ID pin and accordingly the USB driver can switch mode dynamically.

    In summary there are 2 issues as below

    • ID pin not connected to the DM355 USB controller
    • USB driver not built in OTG mode.

    regards

    swami 

  • thanks a lot!

    you are right!

    USB controller is not OTG mode in my product. in fact,  I have a extra pin to judge the power mode,  if powered by usb cable (connected with pc), ID pin is pulled up, and Dm355 as a device.

    usb over network driver  file is inserted. if powered by battery, ID pin is pulled down, and usb wifi KO driver is inserted. then DM355 is a host.

     

     


  • David,

    I believe you should be able to achieve your end goal without radically changing your configuration.  When you are loading your related .ko's can you also build the USB driver as module and reload it too?

    Meaning build the usb controller as a kernel module (musb_hdrc.ko) and everytime you are switching the roles unload the existing musb_hdrc.ko module and reload the new musb_hdrc.ko module (that has been built to support the new mode).

    If the above is not possible then the only option left is to built the usb driver in OTG mode.

    regards

    swami

  • DM355 as host, if usb swtch is removed from pcb(direct through), DM355 can drive the usb wifi module,and it is working ok!

    all testing is done, my concern is Dm355 usb driving issue as a host!

  • Thanks a lot!

    yes , I get gadget ko driver and musb_hdrc_ko_host ko driver seperately.

    but, in fact  I think DM355 driving may be have some issue, an usb switch shouldn't give any effect on usb fucntion. can you forward this issue to TI hardware engineer and give some advice.

    beacuse wifi module must be in the body, cannot removed just like usb cable, so an usb switch must use to select.  

     

    thanks!

     

  • Hi,

    Not sure if I fully understand your question. I have more questions than suggestions. My understanding is that using a TS3USB30E switch, a PC based configuration works with your system but a DM355 based configuration does not work. It is not clear to me as to what your configuration looks like.

    I do not have any knowledge of the switch device you are using. Assuming that the switch is non-intrusive and works well switching back and forth between the two devices you are accessing, could this be a s/w issue? Have you tried to capture the packets on the bus to insure that you are doing a similar access as a PC does?

    You mentioned that the DM355 works well with both targets independently. Can you try placing the switch and access only a single target? It would also be a good idea if you present your question to the TS3USB30E support too.

    Best regards, Zegeye

     

  • Hi,

    Not sure if I fully understand your question. I have more questions than suggestions. My understanding is that using a TS3USB30E switch, a PC based configuration works with your system

    yes,because pc as a host and DM355 is a slave device, in fact, DM355 is simulated as a network by RNIDS driver.usb over network.

    but a DM355 based configuration does not work. It is not clear to me as to what your configuration looks like.

    If DM355 as a host, the usb switch will be swicthed to wifi connector by GPIO usb_sel, and usb_id is also pulled up by other gpio. so DM355 can be as a host.

    the , insmod usbcore.ko and musb_hdrc_ko_host.ko, I can see some trace info from console.  if usb swicth(u9) is removed, usb wifi module will be ok, otherwise fail.

    I do not have any knowledge of the switch device you are using. Assuming that the switch is non-intrusive and works well switching back and forth between the two devices you are accessing, could this be a s/w issue? Have you tried to capture the packets on the bus to insure that you are doing a similar access as a PC does?

    in fact ,the usb switch will increase resistance by 6 ohm(one line) ,compared with 45ohm,it will have 15%,but it shouldn't have any effect high usb signal.  I can insure the s/w is good. I will go to an angilent lab to test USB signal tomorrow.

    You mentioned that the DM355 works well with both targets independently. Can you try placing the switch and access only a single target? It would also be a good idea if you present your question to the TS3USB30E support too.

    yes, DM355 (as a slave) connect with PC, whatever usb switch exists or not, it will be ok. but if Dm355(as a host) connect usb wifi by usb switch, it fail, if remove usb switch, it will be ok.

    I should send this issue to TS3USB30E support, it is good suggestion, thank you!

    Best regards, Zegeye

  • HI!

    Can you give me usb test code?  I will test DM355 USB signal (host mode)in angilent lab.  


  • Hi,

    Coding H/W supported test mode is very direct.

    For TEST_SE0_NAK: TESTMODE=1

    For TEST_J: TESTMODE=2

    For TEST_K: TESTMODE=4

    For TEST_PACKET: Load 53 Bytes Packet onto FIFO0; TESTMODE=8; CSR0.TXPKTRY=1

    test_packet[53] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x7F,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0xFC,0x7E,0xBF,0xDF,0xEF,0xF7,0xFB,0xFD,0x7E};

    Best regards, Zegeye

  • hi Zegeye,

    I want to enter DM355 USB test mode to test the usb diagram for both host and device. Following is the bash file I wrote to test the packet.

     

    #!/bin/sh

    echo "test start!"

    # 0x0 is device mode, 0x1 is host mode?
    ./areg -w /dev/areg 0x01c64460 0x0

    # write packet
    i=0
    while [ $i -lt 9 ]
    do
     i=`expr $i + 1`
     echo $i
     ./areg -w /dev/areg 0x01c64420 0x0
    done

    i=0
    while [ $i -lt 8 ]
    do
     i=`expr $i + 1`
     echo $i
     ./areg -w /dev/areg 0x01c64420 0xaa
    done

    i=0
    while [ $i -lt 8 ]
    do
     i=`expr $i + 1`
     echo $i
     ./areg -w /dev/areg 0x01c64420 0xee
    done

    ./areg -w /dev/areg 0x01c64420 0xfe

    i=0
    while [ $i -lt 11 ]
    do
     i=`expr $i + 1`
     echo $i
     ./areg -w /dev/areg 0x01c64420 0xff
    done

    ./areg -w /dev/areg 0x01c64420 0x7f
    ./areg -w /dev/areg 0x01c64420 0xbf
    ./areg -w /dev/areg 0x01c64420 0xdf
    ./areg -w /dev/areg 0x01c64420 0xef
    ./areg -w /dev/areg 0x01c64420 0xf7
    ./areg -w /dev/areg 0x01c64420 0xfb
    ./areg -w /dev/areg 0x01c64420 0xfd
    ./areg -w /dev/areg 0x01c64420 0xfc
    ./areg -w /dev/areg 0x01c64420 0x7e
    ./areg -w /dev/areg 0x01c64420 0xbf
    ./areg -w /dev/areg 0x01c64420 0xdf
    ./areg -w /dev/areg 0x01c64420 0xef
    ./areg -w /dev/areg 0x01c64420 0xf7
    ./areg -w /dev/areg 0x01c64420 0xfb
    ./areg -w /dev/areg 0x01c64420 0xfd
    ./areg -w /dev/areg 0x01c64420 0x7e

    # enter test mode
    ./areg -w /dev/areg 0x01c6440c 0x8000000
    # set TxPktRdy ready
    ./areg -w /dev/areg 0x01c64410 0x20000

    echo "test done!"

    Here are the questions I want to know

    1.  Can I run this file to test both device mode and host mode? How?

    2. On device mode, Do I need to send command SET_FEATURE to DM355 first?  On host mode, what do I need to do before run the scipt?

    3. Is there any mistake I make or Can you give me some advice? as I can't see the diagram by running the scirpt.

    Thanks,

    Best regards,

    Jian

     

  • Swami,


    I am trying to bring up Leopard board as host for MSC class.

    With me I am leopard board version 1.6 with kernel 2.6.32

    Going through the forums, following are the steps that I trying out.

    1. Remove USB driver from kernel.

    2. Removed jumper J2/J3 so that peripheral comes up as OTG

    3. at Linux, I add jumpers J2/J3 for power as well as to configure as Host

    4. Insert Module musb)hdrc.ko

    5. Attach USB device (I am using 2.0 thumbdriver, is this the issue?)

     

    Post this I am expecting device to show up. But current nothing.

     

    Yr help will me much apprciated.

     

    Ajay

    Silvan Innovation Labs.

    ajay@silvanlabs.com