cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 as Hub in USB Device mode

epikur
Associate
Posted on August 27, 2013 at 16:57

Hello!

I'm planning to use STM32F405 MCU in my project and now wonder if it can support the functionality I need. What I need is: USB device (not OTG or Host) composite, HID + several MSD functions. MSD functions are turned on and off after receiving commands through HID. The perfect way is to have onboard virtual HUB with other functions behind it. So USB host doesn't even knows that there are MSD present when they are not turned on.

Is it possible to program STM32F4xx as a virtual USB Hub?

Is it possible to do it using external PHY tranciever?

Thanks in advance for your replies )

#virtual-usb-hub
3 REPLIES 3
dthedens23
Associate II
Posted on August 27, 2013 at 17:32

You want two separate devices, one HID, one MSD? Or a composite HID + MSD?

If composite, then you cannot turn on and off MSD on the fly.  That is not how USB works.

The device is enumerated at bus reset, and only at bus reset.

So if you have a composite HID and MSD device. Why would you want to turn off MSD?

If two separate devices, then you need a real HUB and then use both Device ports on the F4, one for HID, one for MSD.  And if the HUB is bus powered, then each device can only draw 100ma.

epikur
Associate
Posted on August 27, 2013 at 18:05

Ideally I need two devices: one complex HID+MSD (always on) and the other is MSD (turnable on and off). Optionally there could be even third MSD... yes... Both devices are expected to operate at High Speed. The first MSD is mapped to onboard NAND flash and containes control software, logs and other. So the user doesn't need to download and install software on every PC in order to use my product. And the second MSD is mapped to microSD slot and should only be visible to the host when there is a microSD card attached. 

I prefer not to use an additional physical USB hub chip since I allready need PHY tranciever for High Speed operations, and two external chips is just too much.

Posted on August 27, 2013 at 18:44

How about one MSD with multiple logical units (LUN)?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..