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.

Switching power to USB in software and satisfying the VBUS constraints

We need to control the 5V USB voltage on/off during operation (we are switching a remote device in and out of “USB mode”).  We have an external switch connected to DRV_BUS with the 5V fed back to V_BUS. 

 

Here are the options we are considering – please let me know which is best and if any are invalid:

  1. Programmatically via Linux, power-up in DEVICE mode set through USB_ID (does this require a pull-up?). Then, once powered, switch to HOST mode. Will DRV_BUS then automatically switch an external power switch from OFF to ON and apply 5V to the USB connector? We would then turn it off by switching back to DEVICE mode. The assumption here is that the USB_ID pin can be overridden by software.

  2. Opposite of above: Programmatically via Linux, power-up in HOST mode. When we need to remove power from the external device, we would switch it to DEVICE mode

By the way, we do not know how to switch programmatically between DEVICE and HOST using the TI Linux build software. Any information you can provide in this area is appreciated.

  • Hi Daniel,

    I will forward this to the USB experts. Please post which Linux version you use.

  • We are using TI Linux SDK Version 6.0

  • Daniel,

    I assume

    - you use AM335x,

    - and a USB device is physically mounted on the board but you want to be able to connect/disconnect the device with 5V VBUS on/off,

    - you want to switch on or off in user space application?

    then it does not matter which option you pick, because they are fundamentally the same.

    Please try the following:

    - *directly* ground the ID pin on the board;

    - If you use USB0 port, set its mode to MUSB_HOST in musb_board_data in arch/arm/mach-omap2/board-am335xevm.c; USB1 is already set to HOST mode;

    - Apply the following patch to add an interface to disconnect the USB device e2e.ti.com/.../1425117;

    - To disconnect the device, do command 'echo f > /proc/driver/musb-hdrc.0' or 'echo f > /proc/driver/musb_hdrc.1', depending on which USB port you use;

    - To connect the device again, do command 'echo F >' to the same entry.