Report
5 years, 6 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

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
Comment on this question

2 Answers

5 years, 6 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 vinit bharadwaj 28 Nov 2014
5 years, 6 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?