Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 9 months ago.
mbed usb act as host and slave simultaneously
Hi guys,
I'm starting on a project which involves developing a device which can simultaneously be 1. seen as a MSD to a host (PC) 2. seen as a host to USB flash drives.
What I am trying to achieve is something like the Addonics USBcipher (http://www.addonics.com/products/cipherusb.php)
I have looked at projects such as USB MSD and Interfacing with USB flash drives and they do seem helpful.
Does anyone know how if the mbed is able to accomplish this single handedly? Or does the mbed need to be pair with another MCU?
Thanks
2 Answers
10 years, 9 months ago.
It probably can work if you dynamically destroy the USBDevice code, and create the USBHost code. No idea if that will all go correctly, and of course the connection of a USBHost and USBDevice are slightly different.
It can be possible. I have done this. But the main thing is that, they have different hardware configuration. So you install two USB ports, one for host and other for device. Do the hardware connections for both the ports as required. Now use an IC which behave like a switch, so that you can connect your mbed with only one USB port at a time, and this connection should be done by program. Now, when you use USBHost, remove USBDevice library and when you use USBDevice, remove USBHost library dynamically with your program. In this way, it will run both.
posted by 28 Nov 201410 years, 9 months ago.
NXP have a demo on one of their other boards that has concurrent USB Host & USB Slave/Device operation...
http://www.lpcware.com/content/project/Dual-USB-Host-Device-solution
This of course requires two USB peripherals in the controller (which the LPC4088 has...but doesn't currently work with the USB Host code on mbed...argh!)
This might still give you some insight into how to do it but I think you'll still have a fair bit of work to do.
Does anyone know when the USB Host support for LPC4088 is likely to be addressed?
Yes it can be possible. But the main thing is that, they have different hardware configuration. So you install two USB ports, one for host and other for device. Do the hardware connections for both the ports as required. Now use an IC which behave like a switch, so that you can connect your mbed with only one USB port at a time, and this connection should be done by program. Now, when you use USBHost, remove USBDevice library and when you use USBDevice, remove USBHost library dynamically with your program. In this way, it will run both.
posted by vinit bharadwaj 28 Nov 2014