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.

AM335x USB DISCONNECT interrupt in DEVICE mode

Hello,

When AM335x USB is working as DEVICE, and USB cable is disconnected from the HOST,
does MUSB generate DISCONNECT interrupt ?

TRM says that...
www.ti.com/.../spruh73l.pdf
P2576 "Interrupt status for device disconnected (host mode)"

but in this e2e
e2e.ti.com/.../1130113
Bin Liu says that "When unplugged the USB cable,
MUSB generates DISCONNECT interrupt".

In my study of StarterWare usb_dev_bulk,
When USB cable is disconnected, a function HandleDisconnect() is called.

So I think MUSB generates DISCONNECT interrupt even in DVICE mode. am I right ?

Regards,
Takeshi Matsuzaki

  • Hi Matsuzaki-san,

    Bin Liu's post (his last post on the thread you refer) is correct:

    "When unplugged the USB cable, MUSB generates DISCONNECT interrupt, the device driver should handle this event and teardown the driver state for both MUSB and the gadget driver."

  • Hi Biser-san,
    Thank you for your reply.

    If the MUSB generates DISCONNECT interrupt even in DVICE mode,
    what does TRM description of below mean ?

    "Interrupt status for device disconnected (host mode)"
    (P2576 SPRUH73L)

    Regards,
    Takeshi Matsuzaki

  • Matsuzaki-san,

    I think my messages in the other post is misleading.

    In short, the TRM is correct, the DISCONNECT interrupt does not generate in device mode when disconnecting from host, for example, by removing the USB cable. (But DISCONNECT irq might be generated in some OTG protocol, for example hnp. The Linux MUSB driver has many places where DISCONNECT irq is handled in OTG b_peripheral state.)

    takeshi matsuzaki said:
    In my study of StarterWare usb_dev_bulk,
    When USB cable is disconnected, a function HandleDisconnect() is called.

    In this case, MUSB SUSPEND interrupt will be generated. You might want to check if HandleDisconnect() is invoked in the SUSPEND irq handling. I am not familiar with StarterWare.

  • Liu-san,
    Thank you for your reply.

    Pherhaps I need to study more to clear why HandleDisconnect() is called,
    I understood the DISCONNECT interrupt does not generate in device mode.

    Thanks a lot,
    Takeshi Matsuzaki