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.

How does the firmware of OMAPL138 determine whether a peripheral or a host is plugged in ?

Other Parts Discussed in Thread: OMAPL138, OMAP-L138

Here I use otg mode to mean that the usb controller (hardware) is not determined its role when there is nothing plugged into the usb port.

And in otg mode, does the firmware need to set SESSION bit? If yes, does that mean we have assumed that the usb controller is a host?

In the userguide, it says that USB0_ID pin will determine the role of the usb controller, but I cannot find a register to read the status of this pin.

the procedure of role determination is very confusing in the userguide. Can anybody clarify the whole procedure during the role determination from both the respective of hardware and firmware in OMAPL138?

 

  • Sheng Hu,

    Sheng Hu said:
    In the userguide, it says that USB0_ID pin will determine the role of the usb controller, but I cannot find a register to read the status of this pin.

    The role of the USB_ID pin is not defined by the OMAP-L138 USB Implementation, but rather by the USB 2.0 OTG Specification. You can download the USB Specification from USB-IF. In particular role of the USB_ID pin is defined in the "On-The-Go and Embedded Host Supplement to the USB 2.0 Specification" included in the USB 2.0 Package Specification.

    If you pull the pin low and the device senses that the resistance is less than 10 Ohms, the device should act as a host, otherwise a device I believe. You should check with the USB2.0 OTG Supplement to verify.

  • Hi,

    Thanks for your reply.

    I know (1) if OMAPL138 is a peripheral, in the initialization the firmware needs to set SOFTCONN bit in POWER register and waits for the omapl138 setting SESSION bit in DEVCTL.

    and (2) if OMAPL138 is a host, the firmware will set SESSION bit in DEVCTL register by itself, after that it can sense the CONN and DISCON interrupts when the usb peripheral is plugged in/out from the usb port.

    All above is referred to example 1 in SPRUFM9F.

    So the question is how the firmware knows which one is going to execute, (1) or (2), when it is in OTG mode? Here OTG mode means that there is nothing plugged into the usb port, OMKAPL138 does not determine this role yet.

    I want to know once something (could be a usb host or be a usb peripheral) is plugged into usb port, is there any register or interrupt such that can identify a usb host or be a usb peripheral is connected. 

     

    thanks!

  • Sheng,

        I'm not up to speed with the USB OTG spec, but there might be something in that specifies that the device should initialize as a host mode, then it can negotiate when it detects that something is inserted?, but I'm not sure.

       I would guess that there is something in the OTG spec that requires a OTG compliant devices to assume the role of host first, then change to device when necessary - but again, I will defer you to the USB 2.0 OTG spec for clarifications.

  • Hi,

    It looks there is no interrupt to know whether the OTG is going to operate in Device/Host mode.

    Is DEVCTL.BDEVICE  doesn't provide information regarding A Device / B Device mode? (Non_Interrupt )

    Thank You & Regards,

    GSR