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.

AM3894 USB1 port does not work as device???

Other Parts Discussed in Thread: AM3894

Hi,

I was testing my customized board with AM3894 processor & having some issue with USB1 port to work as device.

CASE 1:

I have configured USB0 port as host, in this case both USB0 port & USB1 port works fine as HOST.

CASE 2:

I have configured USB0 port as device, in this case USB0 port works fine as a device & USB1 port doesn't work as host or device.

My requirement in the design is:

USB0 port should work as HOST & USB1 should work as a device & I have provided the host & device connector accordingly.

But USB1 is not working as device presently. Please can you let me know whether there is any work around to work USB1 port as device?

Thanks in advance.

Best Regards,

Roshan D'souza

  • Hello,

    Can you please provide output logs for the failure case?

    One thing you can try is to press the EVM reset button for a long time(3 to 5 sec) before releasing it.  Also, please refer to this forum thread:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/139884.aspx

    Regards,
    Marc

  • Hi Marc,

    I tried by pressing the reset switch for around 5sec in EVM board, but the no improvement & tried the same in our custom board the result is same.

    As per "DM81xx_C6A81xx_AM38xx_USB_User_Guide.pdf" in page 3 its mentioned that USB1 can not be configured as gadget/device mode.

    Below is the copied text from the user manual & also the the user guide is attached.(page 3)

    3833.DM81xx_C6A81xx_AM38xx_USB_User_Guide.pdf

    Driver Features List
    • The Mentor USB driver can be built as module or built-in to kernel
    • Support both PIO and DMA mode (The DMA mode not applicable for control endpoint)
    • Support two instances musb controller in host mode (both usb0 and usb1 controller in host mode).
    • Support USB gadget/device mode (Only USB0 controller can be configured as Gadget and USB1 cannot be
    configured as gadget mode)

    Regarding the output logs for the failure case, I didnt get any error message(No response).

    Please can you let me know is there any workaround to work USB1 port as Device?

    Thanks & regards,

    Roshan D'souza


     

  • Hi Marc,

    Is there any update regarding this issue?

    Thanks & regards,

    Roshan D'souza

  • Hi,

    Here is an update:

    The PSP release 4.00.01.13 has support to configure USB0/USB1 port to either device mode or host mode through menuconfig, refer to user's guide for more info.  The PSP release 4.00.00.12 supports only usb0 in device mode.

    Regards,
    Marc

  • Dear Marc ,

    We have downloaded 04.00.01.13 (Linux kernel version 2.6.37) from git repository. (configured using ti8168_config from arch/arm/configs folder)

    In this we are getting option for configuring both ports as OTG using sotftware settings.

    In this case also only USB0 is working as a HOST & also as device but USB1 port doesn't work neither as a host nor as a device.

    We have checked this in both DM816x EVK board as well as our custom board & the result is same.

    Any idea what may be the reason for this. 

    Best Regards,
    Roshan D'souza

  • Roshan

    In 4.00.01.13 PSP release, Both ports USB0/USB1 can be configured as host/device mode. The USB can be configured through menuconfig

    1)       Host only mode (where two ports work in host mode)

    2)       Device only mode (only usb0 in device mode and usb1 is not used)

    3)       Dual/OTG configuration, all the below combinations are possible (available only from 4.00.1.13 onwards), there is menuconfig selection to select mode for each port0 and port1.

     

    USB0 Mode

    USB1 Mode

    1

    Host

    Host

    2

    Host

    Device

    3

    Device

    Host

     

    Please refer to User’s guide for detail information http://processors.wiki.ti.com/index.php/DM81xx_AM38XX_USB_User_Guide#The_driver_supports_the_following_features_for_Dual_host.2Fgadget_.28DM816X.2FDM814X.29

    Regards

    Ravi B

  • Hi Ravi,

    We checked the above user guide and checked once again, still its not working.

    Regards,

    Sachin 

  • Sachin

    For one port as host and other as device configuration, have you followed steps at http://processors.wiki.ti.com/index.php/Usbgeneralpage#One_port_as_host_and_other_port_as_Gadget_.28for_DM81XX.29. check for step 7 & 8.

    You need to insert two gadget module one for port0 and other for port1. You might have inserted one gadget module, which enables only port0.  To enable port1 you need to insert one more gadget module (either g_ether.ko, g_file_storage, g-zero etc..).

    Make sure for device mode you need to connect appropriate cable to PC. (A-A cable).

    Regards

    Ravi B

     

  • Sachin

    Is it working for you now.

    Regards

    Ravi B

  • Yes, after following the above steps , i am now able to use both USB ports

    Currently, i am using USB port 0 as host, inserted g_zero.ko and using pen drive

    and for USB1 as device, inserted g_multi.ko and using RNDIS and mass storage.

    There also when mulit gadget was used, the kernel was crashing when the usb cable

    was connected from pc to usb device port 1 of  board.

    there was "disable dma"  option in the make menuconfig under usb section, which was enabled

    after disabling that option i am able to use multi gadget for usb device for port 1

    I am facing a different issue now,  ping between pc and board  fails after sometime.

    In TI816x-PSP-04.00.00.10-ReleaseNotes.pdf,
    It is reported that below issue is resolved.
    => SDOCM00077379 USB/RNDIS: Flood Ping of 512 bytes from windows xp to
    TI816XEVM stops after few seconds

    But when g_multi / g_ether gadget is loaded and when board & windows
    pc is given static Ip address,
    and when ping is done between board & the pc. it fails after different
    interval of time
    then on the board we need to make the interface down and up to make ping work (sometimes
    only this works).
    in some times when we observe ifconfig, we can see RX packets
    incremented but TX is not incrementing

    We tried with the latest release also, TI816x-PSP-04.00.00.13,
    but the result is same. There is no error reported on the board side.

    Please suggest a soultion for the ping failure issue.

    Regards,

    Sachin.m.Kurawatti

     

     

  • Please note that multi gadget is not supported in PSP releases, refer to USB User's guide for list of supported gadget drivers.  Can you check with CDC/RNDIS gadget driver. The latest PSP release available is 4.00.02.14. http://arago-project.org/git/projects/?p=linux-omap3.git;

  • Below behavior is observed in case of latest linux kernel for usb.

    Case 1:

    USB0 [g_zero.ko loaded] and USB1 [ g_ether.ko loaded]
    ping from PC to USB 1 port(board) and vice versa is working properly.
    had done overnight test.

    Case 2.
    USB0 [g_zero.ko loaded] and USB1 [ g_ether.ko loaded]
    ping from PC to USB 1 port(board) working properly.
    Some times, connection fails but recovers and ping continues.
    In this test case, once USB cable is connected to PC,
    Input cannot be given on Console [Hyperterminal], look like hanged !!!
    but ping from pc to board happens successfully.

    In case 2 why the console hangs is not clear,
    USB and console are no way related to each other.
    looks code is in a infinite loop.

    Regards,

    SMK

  • Can you confirm for case-2, the console is back to normal when ping is stopped. What is the PSP release version used?

  • This issue is now resolved. we were using PSP-04.00.01.14, a correction needs to be done in cppi41_dma.c file txdma_completion_work(), there is a while loop, which was causing the problem.

    We have observed another ISSUE as described below

    When g_zero.ko is inserted, we are able to use the USB0 as host, pen drive is detecting without any problem.

    But it works only the first time. when the pen drive is removed and inserted again, the pen drive is not detecting.

    Please let us know if the this is the expected behavior  ?or any new patches are available ?

  • Can you share console prints when device inserted again. Can you check with unmounting the device before device removal.

  • Hi Ravi,

    When we Re-insert the Device again, no prints are coming. In dmesg also no debug prints are displayed.

    We also tried by unmounting the device before device removal but it doesn’t work.

    When we check the cat /proc/interrupts , its not incrementing the interrupt number too.

    Please let us know solution for this problem as soon as possible.

    Regards,

    Roshan

  • Can you try "echo F > /proc/drivers/musb_hdrc.0 or 1 after inserting the device.