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.

Unable to get 1 USB host and 1 USB device configuration working on DM8168

Expert 2220 points

Hello, 

I am trying to get the 1 host/1 gadget working on PSP version 13patch2 on 2.0 silicon for DM8168. I have gone through and enable OTG support, set the software directions for each port (USB 0 for device, USB 1 for gadget), selected the integra controller, enabled USB gadgets and added the file backed storage gadget. When i instert the module i get

root@dm816x-evm:~# modprobe g_file_storage file=blah                                                                                      
g_file_storage gadget: No serial-number string provided!
g_file_storage gadget: File-backed Storage Gadget, version: 1 September 2010
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget-lun0: ro=0, nofua=0, file: /home/root/blah
musb-hdrc musb-hdrc.0: MUSB HDRC host driver
musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: MUSB HDRC host driver
usb usb1: Manufacturer: Linux 2.6.37 musb-hcd
usb usb1: SerialNumber: musb-hdrc.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected

so it looks operational, but when i plug it into my  computer, it does not recognize any usb devices have been plugged in. Additionally the host port is not outputting power so it's not working either.

attached is my menuconfig setup:

4073.menuconfig.txt
--- USB support                                                                                             │ │  
  │ │                                      <*>   Support for Host-side USB                                                                             │ │  
  │ │                                      [ ]     USB verbose debug messages                                                                          │ │  
  │ │                                      [*]     USB announce new devices                                                                            │ │  
  │ │                                              *** Miscellaneous USB options ***                                                                   │ │  
  │ │                                      [*]     USB device filesystem (DEPRECATED)                                                                  │ │  
  │ │                                      [*]     USB device class-devices (DEPRECATED)                                                               │ │  
  │ │                                      [ ]     Dynamic USB minor allocation                                                                        │ │  
  │ │                                      [*]     USB runtime power management (autosuspend) and wakeup                                               │ │  
  │ │                                      -*-       OTG support                                                                                       │ │  
  │ │                                      [ ]   Rely on OTG Targeted Peripherals List                                                                 │ │  
  │ │                                      [ ]   Disable external hubs                                                                                 │ │  
  │ │                                      < >   USB Monitor                                                                                           │ │  
  │ │                                      < >   Enable Wireless USB extensions (EXPERIMENTAL)                                                         │ │  
  │ │                                      < >   Support WUSB Cable Based Association (CBA)                                                            │ │  
  │ │                                            *** USB Host Controller Drivers ***                                                                   │ │  
  │ │                                      < >   Cypress C67x00 HCD support                                                                            │ │  
  │ │                                      < >   xHCI HCD (USB 3.0) support (EXPERIMENTAL)                                                             │ │  
  │ │                                      < >   EHCI HCD (USB 2.0) support                                                                            │ │  
  │ │                                      < >   OXU210HP HCD support                                                                                  │ │  
  │ │                                      < >   ISP116X HCD support                                                                                   │ │  
  │ │                                      < >   ISP 1760 HCD support                                                                                  │ │  
  │ │                                      < >   ISP1362 HCD support                                                                                   │ │  
  │ │                                      < >   OHCI HCD support                                                                                      │ │  
  │ │                                      < >   UHCI HCD (most Intel and VIA) support                                                                 │ │  
  │ │                                      < >   SL811HS HCD support                                                                                   │ │  
  │ │                                      < >   R8A66597 HCD support                                                                                  │ │  
  │ │                                      < >   Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)                                   │ │  
  │ │                                      < >   Host Wire Adapter (HWA) driver (EXPERIMENTAL)                                                         │ │  
  │ │                                      <*>   Inventra Highspeed Dual Role Controller (TI, ADI, ...)                                                │ │  
  │ │                                              *** Platform Glue Layer ***                                                                         │ │  
  │ │                                      < >     TUSB6010                                                                                            │ │  
  │ │                                      < >     OMAP2430 and onwards                                                                                │ │  
  │ │                                      < >     AM35x                                                                                               │ │  
  │ │                                      <*>     TI81XX                                                                                              │ │  
  │ │                                            TI816X usb connector's ID pin control (from software setting)  --->                                   │ │  
  │ │                                            Force TI816X USB0 to  (Device mode)  --->                                                             │ │  
  │ │                                            Force TI816X USB1 to  (Host mode)  --->
      Driver Mode (Both host and peripheral:  USB OTG (On The Go) Device)  --->                             │ │  
  │ │                                      [ ]   Disable DMA (always use PIO)                                                                          │ │  
  │ │                                      [*]   Enable debugging messages                                                                             │ │  
  │ │                                            *** USB Device Class drivers ***                                                                      │ │  
  │ │                                      < >   USB Modem (CDC ACM) support                                                                           │ │  
  │ │                                      < >   USB Printer support                                                                                   │ │  
  │ │                                      < >   USB Wireless Device Management support                                                                │ │  
  │ │                                      < >   USB Test and Measurement Class support                                                                │ │  
  │ │                                            *** NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may ***                                          │ │  
  │ │                                            *** also be needed; see USB_STORAGE Help for more info ***                                            │ │  
  │ │                                      <*>   USB Mass Storage support                                                                              │ │  
  │ │                                      [ ]     USB Mass Storage verbose debug                                                                      │ │  
  │ │                                      < >     Datafab Compact Flash Reader support                                                                │ │  
  │ │                                      < >     Freecom USB/ATAPI Bridge support                                                                    │ │  
  │ │                                      < >     ISD-200 USB/ATA Bridge support                                                                      │ │  
  │ │                                      < >     USBAT/USBAT02-based storage support                                                                 │ │  
  │ │                                      < >     SanDisk SDDR-09 (and other SmartMedia, including DPCM) support                                      │ │  
  │ │                                      < >     SanDisk SDDR-55 SmartMedia support                                                                  │ │  
  │ │                                      < >     Lexar Jumpshot Compact Flash Reader                                                                 │ │  
  │ │                                      < >     Olympus MAUSB-10/Fuji DPC-R1 support                                                                │ │  
  │ │                                      < >     Support OneTouch Button on Maxtor Hard Drives                                                       │ │  
  │ │                                      < >     Support for Rio Karma music player                                                                  │ │  
  │ │                                      < >     SAT emulation on Cypress USB/ATA Bridge with ATACB                                                  │ │  
  │ │                                      < >   USB Attached SCSI                                                                                     │ │  
  │ │                                      [ ]   The shared table of common (or usual) storage devices                                                 │ │  
  │ │                                            *** USB Imaging devices ***                                                                           │ │  
  │ │                                      < >   USB Mustek MDC800 Digital Camera support                                                              │ │  
  │ │                                      < >   Microtek X6USB scanner support                                                                        │ │  
  │ │                                            *** USB port drivers ***                                                                              │ │  
  │ │                                      < >   USB Serial Converter support  --->                                                                    │ │  
  │ │                                            *** USB Miscellaneous drivers ***                                                                     │ │  
  │ │                                      < >   EMI 6|2m USB Audio interface support                                                                  │ │  
  │ │                                      < >   EMI 2|6 USB Audio interface support
  │ │                                      < >   ADU devices from Ontrak Control Systems                                                               │ │  
  │ │                                      < >   USB 7-Segment LED Display                                                                             │ │  
  │ │                                      < >   USB Diamond Rio500 support                                                                            │ │  
  │ │                                      < >   USB Lego Infrared Tower support                                                                       │ │  
  │ │                                      < >   USB LCD driver support                                                                                │ │  
  │ │                                      < >   USB LED driver support                                                                                │ │  
  │ │                                      < >   Cypress CY7C63xxx USB driver support                                                                  │ │  
  │ │                                      < >   Cypress USB thermometer driver support                                                                │ │  
  │ │                                      < >   Siemens ID USB Mouse Fingerprint sensor support                                                       │ │  
  │ │                                      < >   Elan PCMCIA CardBus Adapter USB Client                                                                │ │  
  │ │                                      < >   Apple Cinema Display support                                                                          │ │  
  │ │                                      < >   USB 2.0 SVGA dongle support (Net2280/SiS315)                                                          │ │  
  │ │                                      < >   USB LD driver                                                                                         │ │  
  │ │                                      < >   PlayStation 2 Trance Vibrator driver support                                                          │ │  
  │ │                                      < >   IO Warrior driver support                                                                             │ │  
  │ │                                      < >   USB testing driver                                                                                    │ │  
  │ │                                      < >   iSight firmware loading support                                                                       │ │  
  │ │                                      < >   USB YUREX driver support                                                                              │ │  
  │ │                                      <*>   USB Gadget Support  --->                                                                              │ │  
  │ │                                            *** OTG and related infrastructure ***                                                                │ │  
  │ │                                      < >   GPIO based peripheral-only VBUS sensing 'transceiver'                                                 │ │  
  │ │                                      [ ]   Generic ULPI Transceiver Driver                                                                       │ │  
  │ │                                      -*-   NOP USB Transceiver Driver 


BELOW IS THE USB GADGET SUPPORT MENU
=================================================================================================================
--- USB Gadget Support                                                                                      │ │  
  │ │                                      [ ]   Debugging messages (DEVELOPMENT)                                                                      │ │  
  │ │                                      [ ]   Debugging information files (DEVELOPMENT)                                                             │ │  
  │ │                                      [ ]   Debugging information files in debugfs (DEVELOPMENT)                                                  │ │  
  │ │                                      (2)   Maximum VBUS Power usage (2-500 mA)                                                                   │ │  
  │ │                                            USB Peripheral Controller (Inventra HDRC USB Peripheral (TI, ADI, ...))  --->                         │ │  
  │ │                                      <M>   USB Gadget Drivers                                                                                    │ │  
  │ │                                      < >     Gadget Zero (DEVELOPMENT)                                                                           │ │  
  │ │                                      < >     Audio Gadget (EXPERIMENTAL)                                                                         │ │  
  │ │                                      < >     Ethernet Gadget (with CDC Ethernet support)                                                         │ │  
  │ │                                      < >     Gadget Filesystem (EXPERIMENTAL)                                                                    │ │  
  │ │                                      < >     Function Filesystem (EXPERIMENTAL)                                                                  │ │  
  │ │                                      <M>     File-backed Storage Gadget                                                                          │ │  
  │ │                                      [*]       File-backed Storage Gadget testing version                                                        │ │  
  │ │                                      <M>     Mass Storage Gadget                                                                                 │ │  
  │ │                                      < >     Serial Gadget (with CDC ACM and CDC OBEX support)                                                   │ │  
  │ │                                      < >     MIDI Gadget (EXPERIMENTAL)                                                                          │ │  
  │ │                                      < >     Printer Gadget                                                                                      │ │  
  │ │                                      < >     CDC Composite Device (Ethernet and ACM)                                                             │ │  
  │ │                                      < >     Multifunction Composite Gadget (EXPERIMENTAL)                                                       │ │  
  │ │                                      < >     HID Gadget                                                                                          │ │  
  │ │                                      < >     EHCI Debug Device Gadget                                                                            │ │  
  │ │                                      < >     USB Webcam Gadget 

Cheers,

Ben

  • After reading a little more carefully I saw that i needed to instert a second module for the host side. Now host side is working on USB1 but i still cannot get my computer to recognize that a device has been plugged in using the file backed storage gadget. Any ideas why this might be the case? I am using windows 7, could this have something to do with it?

    Thanks,

    Ben

  • Hi BenM,

    I have encountered the same problem. The host mode can work well but gadget doesn't work. It seems that the module was inserted well according to the print, but i still cannot get my computer to recognize. How did you solve the problem in the last.

  • Hi Gouhua,

    Can you try with g_mass_storage.ko instead of g_file_storage.ko? Make sure you have be aligned with the below wiki:

    processors.wiki.ti.com/.../Usbgeneralpage

    BR
    Pavel
  • Gouhua,

    I was able to configure USB0 in host mode (insert USB flash drive) and USB1 in device/gadget mode (connect it to Ubuntu PC). Make sure in step 3 of the wiki page you set:

    <*> TI81XX
    TI81XX usb connector's ID pin control (from software setting) --->
    Force TI81XX USB0 to (Host mode) --->
    Force TI81XX USB1 to (Device mode) --->
    Driver Mode (Both host and peripheral: USB OTG (On The Go) Device) --->

    In step 8, when insert g_ether.ko, I plug my USB flash drive and I have /dev/sda created in the DM816x device filesystem. Then I insert g_file_storage.ko file with the below format:

    #insmod g_file_storage.ko file=/dev/sda stall=0 buflen=65536

    Then I can see my USB flash drive mapped and accessible from the Ubuntu PC.

    Regards,
    Pavel

  • Hi Pavel,

    Thanks for your reply. I recompiled the kernel according to the user guide step by step, now it works.

    Thanks you very much!

    Regards,

    Guohua

  • Hi Gouhua,

    I met the same problem with you ;

    " insmod: error inserting 'g_hid.ko': -1 No such device "

    How do you solve this problem ?

    Regards,

    Ternence
  • Hi Ternence,

    You should update the kernel on your target board when you reconfigure and rebuild the kernel. And reference to TI81XX_PSP_UBOOT_User_Guide.pdf to update your target's kernel.

    Regards,

    Guohua

  • Hi Guohua ,

    Thanks for your reply .

    When I compile the kernel, I will be to load the kernel image file ;
    Now I can put my hands DM8168 boards as a U disk access to PC ;
    I want to achieve the goal of DM8168 as a keyboard devices connected to the PC;
    At the time of loading 'g_hid. Ko', the above error.

    Do you have any good Suggestions?

    Regards,

    Ternence
  • Hi Ternence,

    Did you modify the file hid.c since you should register the platform device? If no, you can do it refer to kernel\linux-dvr-rdk\Documentation\usb\gadget_hid.txt.

    Regards,

    Guohua