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.

DM814x USB device mode: cable remove detect

Hello,

I worked on a J5 (DM814x) board USB device driver.  I set USBn_INTRUSB register bit5: DISCON.  But when the USB device port cable disconnect from USB host, I only can get the SUSPEND interrupt. I can't get the device disconnect interrupt.

DM814x Technical Reference Manual(sprugz8b.pdf) mentioned USB[5] Interrupt for device disconnected (host mode). I think that why I can't get the device disconnect interrupt.

My question are:

-- When DM814x USB works on the device mode, how to detect if the USB device disconnect?

--  And if VBUS connect external 5V for ipod role switch,how to detect if the USB device disconnect?    

I also test on AM335x board. AM335x Technical Reference Manual(spruh73f.pdf) mentioned USB[5] Interrupt for device disconnected (host mode) too. But when the USB device cable removed, I can get the USB device disconnect interrupt.

Thanks, Jian

  • Jian

    As per spec, In device mode INTRUSB.D5 disconnect interrupt will not occur when the device is connected to Host, if the host disconnect the the bus or removes the session then device should get the interrupt.

    But i have not verified this scenario, can you check whether the host is disconnected or session is removed and device gets disconnect interrupt.

    As you explained, you can also use the suspend interrupt to simulate your iPod device disconnect use case.

    Have you checke removing the cable do you see the disconnect interrupt?

    Regards

    Ravi B

     

  • Hi Ravi,

    As you mentioned, in device mode,  INTRUSB.D5 disconnect interrupt will not occur when the device is disconnect to Host.  Do you know if DM814x supports other way to detect the device disconnect in USB device mode?

    My scenario is: first DM814x USB controller works as the host mode. When ipod plug in DM814x USB port, USB host controller detects ipod, then USB host driver will be killed.   After ipod do the role switch, DM814x USB device driver will be start. At this time, ipod will be host and DM814x will be device. Once ipod plug out, DM814x USB device driver will detect ipod disconnected, then USB device driver will be killed and USB host driver will be start.

    So my question is how DM814x driver can detect the ipod disconnection?

    I think the suspend state just means host no action. I can't use the suspend interrupt instead of the disconnect interrupt.  Actually I tried this before, but got other issue.

    Thanks,

    Jian       

      

  • Hi Ravi,

    Any update for this question?

    Thanks,

    Jian

     

  • Hi Ravi,

    I am also facing the same problem of getting a disconnect interrupt. I have used the suspend interrupt workaround but this is a serious violation of USB Standards. The USB certification tests fail if we add this workaround. Can you please confirm if this is a hardware limitation or if there is actually a way to work this out. Thank You.

    Regards,

    Mughees Chohan

  • When DM814x acts as device, whether VBUS is still supplied by DM814x. Can you try turn off VBUS when DM814x as device mode.

    Regards

    Ravi B