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.

AM1808 EVM configured as USB mass storage device

Other Parts Discussed in Thread: AM1808, OMAP-L138

Hi -

I want to connect an AM1808 Zoom DK running Linux to a PC and have it show up on the PC as a mass storage device (USB thumb drive).   I tried using a USB cable with miniB plug on one end and full-size A plug on the other end to connect the DK board to the PC.  I connected the miniB end of the cable to J6 (miniAB socket) on the Zoom DK board and full-size A plug end of the cable to a USB host port on my PC.  The AM1808 Zoom DK board was running the standard Linux build that came with the DK board.  When I plugged the cable into the PC, the host port of the PC did not detect any USB device connection.  Basically nothing happened.

Question - How can I configure / create a Linux build or the AM1808 Zoom development kit that has support for USB mass storage device mode?   I am a Linux nubie so detailed instructions are greatly appreciated.

Thanks,

Doug

  • Getting a Linux box to looks like a USB Device is not easy. Key words to search for is USB File Storage Gadget. Try here and at the TI Wiki, http://processors.wiki.ti.com. Some hits:

    http://processors.wiki.ti.com/index.php/USB_File_Storage_Gadget
    http://processors.wiki.ti.com/index.php/USB_OTG_on_DaVinci
    http://www.linux-usb.org/gadget/file_storage.html

    First, the kernel has to be configured for USB Gadget functionality. Your kernel may already have it and your file system may already have the loadable modules. Off the top of my head, I can't emember the exact commands. The link above and posts on this forum show what to try. Tricky bit it trying to access the backing store from the target and host at the same time. Never quite got that working myself. Also OTG is not in the earlier kernels.

     

  • You need to enale File Storage gadget in Drivers->USB support-> Gadget-> as modules and then after booth insert this module "insmod g_file_storage.ko file=/dev/mmcblk0p1" stall=0.

    Regards,
    Ajay

  • Hi Norman and Ajay,

    Thanks for your helpful suggestions.  I have read through the various instructions in the links provided by Norman this weekend.  This morning a software team member configured a kernel and partitioned an SD card with the backing store per the instructions.  The instructions were very helpful and we found several settings that we had missed in previous attempts.   Anyway, long story short, we still had no success in getting the PC to even recognize the Zoom DK board when we connect it.   I think we have the kernel configured correctly (according to the instructions) and have the module installed properly after boot.

    The strange thing to me is that the PC doesn't even recognize that a USB device (let alone a mass storage device) is connected when we connect the DK board to the PC.   That seems like a hardware problem rather than a software installation problem to me, but maybe I'm wrong.  Some of the links to which Norman referred discuss hardware modifications that are necessary before using certain DK boards in device mode.   It appeared, however, that these instructions were very specific to particular DK boards and that they were NOT for the AM1808 Zoom DK board.

    Are we breaking new ground here?  Has anyone actually used the ZOOM DK board with AM1808 SOM in USB device mode as a mass storage device?  Does anyone know for sure whether hardware modifications to the DK board are required?

    Would someone at TI be willing to grab a ZOOM DK board with AM1808 SOM and attempt to set this up? 

    Thanks again for all the help!  Much appreciated.

    Doug

  • Doug,

    How are you connecting the board to PC? I believe you might be using mini-B plug to std-A plug for this purpose. Please also provide the output of "cat /proc/driver/musb_hdrc". This would need you to enable debugging option at Drivers->USB support -> Inventra -> Enable debug

    Ajay

  • Hi Ajay,

    Yes, we are using a standard USB cable with mini-B plug on one end and std-A plug on the other end.  The mini-B plug is connected to the DK board.  The std-A plug connects to the host port of a PC.  It is the same type of cable as one would use to connect a digital camera to a PC. 

    I'm not at work right now (it's 12:15 AM here in Iowa) but I will have our software guys enable the debugging output per your suggestion and post the result tomorrow AM.

    -BR

    Doug

  • Hi Ajay - 

    Below is the debug output you requested.  I should point out that there was not an option titled "Drivers->USB support -> Inventra -> Enable debug" per se.  But there was something to the effect of "enable debugging", which we already had configured and the output appears below.   I'm pretty sure this is what you wanted.  Note that the OTG state is b_idle; inactive regardless of whether the USB cable is disconnected or plugged into the host.

    I can't help but wonder if there is some sort of hardware modification or jumper setting change that we need to make to the Zoom DK board in order to enable USB OTG support in hardware....

    Doug

    Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=99)

    OTG state: b_idle; inactive

    Options: pio, otg (peripheral+host), debug=0 [eps=5]

    Peripheral address: 03

    Root port status: 00000000

    DaVinci: ctrl=00 stat=0 phy=ef590000

    rndis=00000 auto=0000 intsrc=00000000 intmsk=01ff1e1f

    Gadget driver: g_file_storage

    ep0 (hw0): 1buf, csr 0000 maxp 0000

    (queue empty)

  • I believe Logic PD's AM1808 basebaord is the same as their OMAP-L138 baseboard. Likely the SOM is exactly the same as well. There are a few posts of OMAP-L138 EVMs and eXperimenter boards USB problems. Most dealing with high-speed problems. Have you checked the Windows Device Manager to see if anything got recognized but failed to load?

  • Hi Norman,

    Yes, I believe you are correct about the OMAP-L138 being the same as the Logic PD AM1808 board.   I don't know how one is supposed to know that for a certainty, however.  I've never seen it written down anywhere that the two are one and the same. All the documentation that comes with the kit from Logic PD says "Zoom AM1808 EVM Development Kit"

    As to Windows Device Manager - nothing whatsoever shows up when we connect the Zoom AM1808 EVM Development Kit to the PC.  It is as if there is nothing connected at all.  Exactly as if one plugged in a cable to the PC with nothing on the other end of the cable.   That is why I think there must be some hardware setup step that we are missing.  Also that is why I'd like to know if anyone has ever gotten USB device mode to work with this board.

    -BR

    Doug

  • Does sound like a connection problem of some kind. The USB OTG controller is not pinmux'ed so that can't be it. The DVSDK version of the Linux kernel does connect a couple of GPIOs for VBUS and OverCurrent. I think the Linux driver does use VBUS to detect the host. Which version of Linux are you using? Maybe try the WinCE demo to see if it responds. Or another SOM or baseoard if you've got one. From what I've seen it takes quite a while for the TI guy with a AM1808 EVM to be found. Perhaps the Logic PD forum might be more responsive.

     

  • Doug,

    There is nothing unusual in output of "cat /proc/driver/musb_hdrc". Can you enable debug log as given below and provide the output of logs.

    1. Boot the kernel

    2. Insert the g_file_storage.ko with parameters

    3. enable debug using "echo D8 > /proc/driver/musb_hdrc"

    4. connect cable to PC and send us the log after this.

    Ajay

  • Doug,

    I finally had a chance to try this out on my EVM and it worked without any issues.  Sorry it took so long -- I ran into all kinds of minor issues that made this take about 10x longer than it should have!  For example, I didn't have the LCD panel with me at home and Linux would hang on the "calibrating touch screen" at startup!  Dumb stuff like that.  I finally grabbed all my stuff and came to the office so I could try it out here!  It worked the first time (or the 128th time if you count all the failed attempts at home!).  :)

    Have you properly formatted the backing file using the instructions here?

    I've attached my .config file for comparison with your own.

    Brad

  • Ajay said:
    You need to enale File Storage gadget in Drivers->USB support-> Gadget-> as modules and then after booth insert this module "insmod g_file_storage.ko file=/dev/mmcblk0p1" stall=0.

    I could only get this to work if I took an actual file and used fdisk to create a partition.  The Windows PC would never even recognize that something had been connected when I tried using /dev/mmcblk0p1.  I also tried the mount point, i.e. /media/mmcblk0p1 and that didn't work either.  Using a file seemed to always work consistently.

  • All,

    Thanks to all for the continued help with this issue.  

    Unfortunately we're still having problems getting device mode to work on our Zoom AM1808 DK board.  It seems to be very sensitive to the size of the file used for the backing store.  We're working on it though and will post once we have it working.  Still no joy for now, but at least Brad has actually gotten this working on his DK board.  

    For now we are attempting to enable USB device support (only) when we build the kernel.  In practice though we will eventually need to enable OTG support since sometimes (on boot up) we need to act as a USB device to an external host PC and other times (on boot) we need to act as a USB host to some on-board peripherals.  We have a couple of looming concerns...

    1 - Obviously we need to get device mode only working first.  As I mentioned we're still battling that, but at least Brad has shown that it can work.

    2 - In the process of configuring for USB device only, one of the steps was to enable DMA for USB, which we did.   However, we know for a fact that enabling USB DMA transfers in host-mode doesn't work properly.  We were forced to disable DMA transfers in order to get USB host mode working with our peripherals.  TI is supposedly investigating this but its been a few months since that investigation began and we've not heard any word back on progress.   If we must enable USB DMA in order for USB device mode to function properly, then we're in a Catch22 because that will surely break USB host mode.

    3 - A few days ago, In the process of trying to get USB device mode to work, we experimented with enabled OTG mode thinking that might be the key.  We noticed that not only did this not "fix" device mode and get that to work but it "broke" host mode.  

    It appears to be a long row to hoe before we get a system configured that can operate in either host or device mode as determined at boot time.

    Doug

  • Brad,

    Is a mmc card recognized when you used "/dev/mmcblk0p1" in file storage? You should not use mount point and make sure that the disk is not mounted locally while using it for file storage parameter.

    Doug,

    What DMA problem are you pointing here? There was a known issue with DMA in host mode with WiFi devices and is currently resolved. We are in process or updating bug fix patches to arago kernel souces. If you face aby other issue in DMA mode then please let us know.

    Regards,
    Ajay

  • Hi Ajay,

    The problem with USB DMA transfers in host mode was observed when using a Hauppauge! 950Q USB TV Stick. It was reported to TI around September 22, 2011. Brad was in touch with a developer at TI in (unknown name) who was working on a fix - (maybe that developer was you Ajay?).  I believe the developer received one of the Hauppauge! 950Q USB TV Sticks and was tasked with diagnosing and fixing the issue. The developer suggested that we disable USB DMA transfers, did work around the problem.

    Above you mention that a known issue with DMA in host mode with WiFi devices has been recently resolved. Do you know if that also resolved the issue with the Hauppauge! 950Q USB TV Stick that we reported?  

    Brad - can you get hold of the developer working on the DMA transfer issue with the Hauppauge! 950Q USB TV Stick and see if the problem has been resolved?

    Thanks,

    Doug

     

  • Doug,

    I haven't received and worked on Hauppauge! 950Q USB TV Stick. We need to test this TV stick with the bugfix patches for WiFi and hopefully your issue should also get fixed with it.

    Brad, Can you send more details to me on this?

    Regards,
    Ajay

  • Ajay,

    I was working this issue with Matt Porter from the Dallas SW Apps team.  Here's the last communication I received from him on the issue:

    The 950Q I have is unable to discover the tuner instance at i2c address 0x61. I notice this is something that others have run into as well and it occurs on both an x86 system and our board. That's made it difficult for me to recreate the customer problem in the short-term. Seeing as the problem is specific to the CPPI 4.1 DMA support (based on customer verification that PIO mode is fully functional), our recommendation is to use only PIO mode with the OTG port on AM180x. I will be escalating a more easily reproduced error case (with USB Ethernet device) to the kernel team so they can address the issue for an future release.

    Please let us know as soon as you've posted the patches that fix this USB DMA issue so Doug can try them out.  We've been working under the assumption that the issues are one in the same, but we need to prove that out as soon as possible.

    Best regards,
    Brad

  • Hi everyone,

    Well, I'm very embarrassed to report that the reason we could not get USB device mode working on our system was, in the end, a bad USB cable.   Cable replaced.  USB device mode working.  The PC sees the AM1808 as USB mass storage device when we connect the two.  Even if we had started with a good cable, we still would have needed a lot of the help we received here on this forum and directly from Brad to get the kernel configured properly, the backing file set up and so forth. 

    Next week we'll go on to try this with USB DMA disabled and using OTG mode rather than device-only mode.  Fingers crossed.

    Thanks a bunch to everyone that has helped us with this.  We'll try extra hard in the future to check the obvious things before we request help.

    Doug