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.

OMAP-L138 C6748 USB0

Other Parts Discussed in Thread: OMAPL138

We have no OS running on our target hardware.

We want to use USB0 to connect to peripherals. When connecting the peripheral we see the connect interrupt, see debug output below. However it is unclear to me as to how to proceed, do you have an example. I believe after the connect the next step is to reset the peripheral by pulling down the D+,D- lines. Is this correct and how do I do it?

***************************************************************************
>>> Resetting the USB controller
DEVCTL = 0x00000098
DEVCTL - B device found
DEVCTL - VBUS above valid

<<< controller reset
>>> Hold PHY in reset for a few clock cycles
<<< Releasing PHY from reset
>>>Wakeup USB module
>>>Wakeup completed
>>> Setting up USB interrupts
<<< USB intterupt setup complete
>>> Start session
DEVCTL = 0x00000019
DEVCTL - A devicefound
DEVCTL - VBUS above valid
DEVCTL - SESSION
ISR:DRVVBUS

<<< Session started....VBUS should be high now
CFGCHIP2 = 0x00032872
CFGCHIP2[17] - Status of USB2.0 PHY - GOOD
CFGCHIP[16]2 - Status of USB2.0 PHY VBUS sense - VBUS voltage found
CFGCHIP2[15] - USB2.0 PHY not in reset
CFGCHIP2[14-13] - USB2.0 OTG subsystem mode - Override phy values to force USB host operation.
CFGCHIP2[12] - USB1.1 PHY reference clock is sourced by output of USB2.0 PHY
CFGCHIP2[11] - USB2.0 PHY reference clock (AUXCLK) is internally generated from the PLL
CFGCHIP2[10] - USB2.0 PHY is enabled and is in operating state (normal operation)
CFGCHIP2[9] - OTG SS is enabled and is in operating state (normal operation)
CFGCHIP2[8] - Differential data polarities are inverted (USB_DP is connected to D- and USB_DM is connected to D+)
CFGCHIP2[7] - Needs to be 0 whenever USB1.1 PHY is unpowered
CFGCHIP2[6] - USB2.0 PHY is prevented from stopping the 48 MHz clock during USB SUSPEND
CFGCHIP2[5] - Session End comparator is enabled
CFGCHIP2[4] - All VBUS line comparators are enabled
CFGCHIP2[3-0] - USB0REF_FREQ 24 MHz
DEVCTL = 0x0000003D
DEVCTL - A devicefound
DEVCTL - Low speed device detected
DEVCTL - VBUS above valid
DEVCTL - HOST mode
DEVCTL - SESSION
ISR:Device Connected

  • Hi,

    DEVCTL = 0x0000003D
    DEVCTL - A devicefound
    DEVCTL - Low speed device detected
    DEVCTL - VBUS above valid
    DEVCTL - HOST mode
    DEVCTL - SESSION
    ISR:Device Connected

    Is this your own code?

    If you wish to run "no OS" code then you can refer TI starterware code for USB0 example for mass storage device.

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

    http://processors.wiki.ti.com/index.php/Quick_Start_Guide_StarterWare_01.10.XX.XX_%28supports_OMAPL138%29

    OMAPL138_StarterWare_1_10_03_03/examples/evmOMAPL138/usb_host_msc/usb_host_msc.c

  • Hi Rex,

    Rex says said:
     I believe after the connect the next step is to reset the peripheral by pulling down the D+,D- lines. Is this correct and how do I do it?

    yes, correct the next step is to reset signal on the USB bus.

    These code snippets are part of USB starterware ( non OS ) package of OMAPL138

    .....

    #define USB0_BASE    SOC_USB_0_BASE

    .....

    #define USB_O_POWER             0x00000001  // USB Power

    ..

    #define USB_POWER_RESET         0x00000008  // RESET Signaling

     

    void USBHCDReset(unsigned int ulIndex)

    {

    // Start the reset signaling.  

    USBHostReset(USB0_BASE, 1);   

    // Wait 20ms

    delay(20);

    // End reset signaling on the bus.

    USBHostReset(USB0_BASE, 0);   

    // Need to wait at least 10ms to let the device recover from

    // the reset.  This is the delay specified in the USB 2.0 spec.   

    // We will hold the reset for 20ms.

    // 

    delay(20);

    }

     

    void USBHostReset(unsigned int ulBase, tBoolean bStart)

    {     /* Check the arguments. */    

         ASSERT(ulBase == USB0_BASE);

         /* Send a reset signal to the bus. */    

        if(bStart)

        {        

           HWREGB(ulBase + USB_O_POWER) |= USB_POWER_RESET;

        }

        else

        {         HWREGB(ulBase + USB_O_POWER) &= ~USB_POWER_RESET;

        }

    }

     

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------