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.

USB Mass Storage on OMAPL138

Other Parts Discussed in Thread: OMAPL138, OMAP-L138

USB Mass Storage on OMAPL138


Hi all!

Our application, based on OMAP-L138, requires USB Mass Storage support.

We ported StarterWare'code in our environment (proprietary realtime RTOS) and doing normal correct actions everything seems to work.
If tested in extreme conditions, sometimes system hangs (eg .: extraction of the USB stick while you are reading or writing a file).
In particular, two situations may occur:
1) The system stops waiting for an HW condition that will not occur (for example cpp41dma.c line 533, but is not the only while case).
2) The USB starts generating interrupt continuously (one every 10 usec). USB0HostIntHandler() read 0 from INTSRCR (no interrupt pending?) and the final write of 0 to EOIR immediately retrigger a new interrupt.

Thinking of porting problems in our environment we did tests with your example application (OMAPL138_StarterWare_1_10_04_01\examples\lcdkOMAPL138\ usb_host_msc).
Simply removing the USB stick while the cat of a file is ongoing hangs the system in the above described case 1).

Questions:
* Don't you should avoid potentially endless waiting situation? (can we use a timeout? how long? which action shoud be taken on timeout?)
* How is it possible to have interrupts while INTSRCR is read as 0?
* Inside the function USBHostIntHandlerInternal() variable ulStaus is OR-ed with the return value of the function USBIntStatusControl (). I cannot find any doocumentation for registers accessed in that function inside OMAP-L138 TRM (spruh77a.pdf). What do I miss?
* Is the driver designed to correctly manage unplug while working? (We can accept problems on the USB key's filesystem if not correctly synced but I would expect no problem on the host side).
* Is there any available update for the driver?

Thanks in advance.

Andrea

  • Hi Andrea,

    Apologize for the delayed response.

    If tested in extreme conditions, sometimes system hangs (eg .: extraction of the USB stick while you are reading or writing a file).
    In particular, two situations may occur:
    1) The system stops waiting for an HW condition that will not occur (for example cpp41dma.c line 533, but is not the only while case).
    2) The USB starts generating interrupt continuously (one every 10 usec). USB0HostIntHandler() read 0 from INTSRCR (no interrupt pending?) and the final write of 0 to EOIR immediately retrigger a new interrupt.

    * Is the driver designed to correctly manage unplug while working? (We can accept problems on the USB key's filesystem if not correctly synced but I would expect no problem on the host side).

    Actually the OMAPL138 starterware code does not support error handling such as removing pendrive while accessing (read/write) etc.,

    So if we did any abrupt change while working with usb starterware code, we could face unexpected behavior.

    * Don't you should avoid potentially endless waiting situation? (can we use a timeout? how long? which action should be taken on timeout?)

    Yes, you can use timeout. If any abrupt change or pendrive removal then clear out all the interrupts and re-init the required section like interrupt source etc.,

    * How is it possible to have interrupts while INTSRCR is read as 0?

    It is not possible but it could be interrupted due to bad variable changes when abrupt change happens on USB.

    * Inside the function USBHostIntHandlerInternal() variable ulStaus is OR-ed with the return value of the function USBIntStatusControl (). I cannot find any doocumentation for registers accessed in that function inside OMAP-L138 TRM (spruh77a.pdf). What do I miss?

    Those information would come from USB driver file located at "OMAPL138_StarterWare_1_10_04_01/drivers/usb.c"

    You can refer to the following TI wiki for USB starterware implementation.

    http://processors.wiki.ti.com/index.php/StarterWare_USB

    * Is there any available update for the driver?

    As of now, we don't have plan to do that.

  • Hi Andrea,

    For the low level code you could as well look at the OMAP-L13x Linux driver provided in the MCSDK.
    I think that there are more error handling scenario supported in the Linux driver compare to the Starterware.

    Linux kernel and docs for OMAP-L13x/AM180x can be found at:
    http://processors.wiki.ti.com/index.php/DaVinci_%28ARM9%29_PSP_Releases#AM18x
    The release note will point you to the actual tree. The complete SW is called BIOSLINUXMCSDK-OMAPL13X.

    If you use the OMAP-13x LCDK board (http://www.ti.com/tool/tmdxlcdk138) you should be able to run both the Linux kernel from MCSDK (BIOSLINUXMCSDK-OMAPL13X) and starterware on this board and compare the behavior. This might help you to understand what is possible to do in term of USB SW.

    Keep in mind that the mUSB controler is originally a Mentor graphics IP and being used by on different TI devices:
    http://processors.wiki.ti.com/index.php/Inventra_HDRC_USB_Controller

    Anthony