AnsweredAssumed Answered

Trying to switch between host and device on one usb

Question asked by Daniel Winsor on Jun 15, 2017
Latest reply on Jun 19, 2017 by Daniel Chen

I have a device with one USB port.   I use it to create a virtual com port.  this works fine.

if I reconfigure the sw on my board as a usb device, I can connect my board to a PC and it looks like a storage device.

My question is, does anyone have an example of switch from host to device mode and back to host without a shutdown?


When I try to shut down the host stack and go to device mode I am ok. 

Then, when I try to shut down device mode and bring up host mode again, I get error C1 (USBERR_DEVICE_BUSY)


Here is how I shut down:


bShutdownGood = true;



Any examples of switching between host and device mode without a shutdown would be appreciated!


Thanks so much!