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:
_int_disable();
_usb_host_bus_control(host_handle,USB_ASSERT_BUS_RESET);
_usb_host_shutdown(host_handle);
bShutdownGood = true;
_int_enable();
Any examples of switching between host and device mode without a shutdown would be appreciated!
Thanks so much!
Dan.