# \[WP76xx\]\[HW\] Switch USB host or USB function

**URL:** <https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887>\
**Category:** Legato Linux distribution (Yocto project)\
**Created:** [December 3, 2019, 6:52am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887 "2019-12-03T06:52:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![HIROKI11976](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@HIROKI11976](https://forum.legato.io/u/HIROKI11976)\
**Post date:** [December 3, 2019, 6:52am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/1 "2019-12-03T06:52:17Z")

</div>

[WP76xx\_switch\_USBHost\_function.xlsx](https://forum.legato.io/uploads/short-url/obogiv3KgutrROuPvyltF34pfNy.xlsx) (39.9 KB)

Back Ground:  
We would like to switch the function that WP76xx was operated as USB host or USB function.  
In order to support it, we make the attached block diagram.

- How to switch: control GPIO22 and GPIO23, and supply to power SW IC to supply Micro USB IF
- How to recognize function: Check the logic via USB\_ID or GPIO25

Question:  
Please check the attached file as “WP76xx\_switch\_USBHost\_function.xlsx”.  
Can this block diagram support to switch either USB Host or USB Function?

Best Regards,

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [December 3, 2019, 8:08am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/2 "2019-12-03T08:08:24Z")

</div>

for hardware topic, please directly contact Sierra FAE.

---

<div class="post-metadata">

**Author:** ![JordanZhao](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jordanzhao/32/789_2.png) [@JordanZhao](https://forum.legato.io/u/JordanZhao)\
**Post date:** [December 5, 2019, 4:09am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/3 "2019-12-05T04:09:24Z")

</div>

Are we talking about USB OTG?

---

<div class="post-metadata">

**Author:** ![HIROKI11976](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@HIROKI11976](https://forum.legato.io/u/HIROKI11976)\
**Post date:** [December 9, 2019, 1:29am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/4 "2019-12-09T01:29:08Z")

</div>

Hi, Jordan

> > Are we talking about USB OTG?

No, I talked the following behavior that;

- USB Host: WP76xx supply voltage to external USB device
- USB function: No supply voltage, only receiving data via USB

---

<div class="post-metadata">

**Author:** ![JordanZhao](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jordanzhao/32/789_2.png) [@JordanZhao](https://forum.legato.io/u/JordanZhao)\
**Post date:** [December 9, 2019, 7:45am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/5 "2019-12-09T07:45:52Z")

</div>

OK, I see. Then it needs a help from the HW team.

---

<div class="post-metadata">

**Author:** ![tgoto](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/tgoto/32/823_2.png) [@tgoto](https://forum.legato.io/u/tgoto)\
**Post date:** [December 10, 2019, 6:01am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/6 "2019-12-10T06:01:29Z")

</div>

Hi Hiroki,  
Please make SFDC ticket for this.

---

<div class="post-metadata">

**Author:** ![HIROKI11976](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@HIROKI11976](https://forum.legato.io/u/HIROKI11976)\
**Post date:** [December 23, 2019, 6:22am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/7 "2019-12-23T06:22:59Z")

</div>

Hi, Sierra Team

As we talked with customer, they consider to switch USB function or Host as I said.  
In that case, they consider that is judged USB function or USB Host by trigger the logic of USB\_ID.

- USB\_ID: “H” or Open —\> WP760x=USB Host (Supply USB\_VBUS to external USB device)
- USB\_ID: “L” —\> WP760x=USB function (Receive USB\_VBUS from external USB device)

Question:  
Do you have the way how to monitor the logic of USB\_ID either “H” or “L” in legato App or Linux command?  
(Sorry I could not find [legato.io](http://legato.io).)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [December 23, 2019, 7:42am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/8 "2019-12-23T07:42:22Z")

</div>

do you know what device will be plugged to the USB?  
If yes, you can check “cat /sys/kernel/debug/usb/devices” for the device name.

---

<div class="post-metadata">

**Author:** ![HIROKI11976](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@HIROKI11976](https://forum.legato.io/u/HIROKI11976)\
**Post date:** [December 23, 2019, 9:33am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/9 "2019-12-23T09:33:42Z")

</div>

> > do you know what device will be plugged to the USB?

No, I could not confirm device name.

I consider the following sequence to switch USB host/function.

[1] Monitor USB\_ID “H” or “L”, instead of GPIO  
(Because our system is insufficient GPIO IF.)  
[2] If USB\_ID=“H”, WP76xx set to be worked as USB function  
[3] If USB\_ID=“L”, WP76xx set to be worked as USB Host

In order to fulfill [1], I would like to know whether USB\_ID can be monitored either “H” logic or “L” logic under legato or yocto framework.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [December 23, 2019, 9:57am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/10 "2019-12-23T09:57:28Z")

</div>

how about checking the kernel log?  
I saw that in case of USB host, when client connected, you should see this message in dmesg:  
“New USB device found”.

---

<div class="post-metadata">

**Author:** ![HIROKI11976](https://avatars.discourse-cdn.com/v4/letter/h/a9adbd/32.png) [@HIROKI11976](https://forum.legato.io/u/HIROKI11976)\
**Post date:** [December 23, 2019, 11:36pm UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/11 "2019-12-23T23:36:53Z")

</div>

> > how about checking the kernel log?

Thanks for your advise, but it could not be applied in our system.  
Because I consider that WP76xx will be switch either USB Host or USB Function before external USB device is jack-in.  
So I consider the way to switch USB Host/Function, and I assume that switching USB can be monitored USB\_ID logic.  
That’s why, I asked it.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [December 24, 2019, 1:15am UTC](https://forum.legato.io/t/wp76xx-hw-switch-usb-host-or-usb-function/4887/12 "2019-12-24T01:15:31Z")

</div>

Please contact Sierra FAE as this is more likely to be hardware stuff.
