configure USB device as root hub

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

configure USB device as root hub

Jump to solution
2,427 Views
Akar
Contributor II

Hi,

I am using i.MX35 pdk with LTIB linux 2.6.31.

In the eval kit we have the USB OTG which would be connected to PC so that the OTG will work as the device always. I am using OTG as a gadget  and using gadgetfs interface.

We have a USB host port on the eval kit. To this host port i have a USB HUB connected. To the hub i would be connecting printer, camera and pen drive.

i am using libudev library to find new device plugged or unplugged from hub and i am using LIBusb user interface library to to communicate to the devices like printer camera or pen drive from i.MX35 host port.

My requirement is that what ever the devices i connect on the USB hub on host side recognised by the PC.

In other words i want to emulate a hub feature using OTG and host port in i.MX35 eval kit.

That means the OTG on the board should be configured as root hub and should have the root hub fearures. That is if printer is connected on hub i.MX35 will know that a device is conncted at host using libudev and using LIBusb i can read the device descriptors and inform the PC that a new device is connected using gadgetfs on the OTG side.

i would like to know how to configure the OTG as a root hub and inform the PC that a new device is connected and further do the data transfer using gadgetfs.

Labels (1)
0 Kudos
1 Solution
1,533 Views
richard_stulens
NXP Employee
NXP Employee

Hi Amol,

It is by definition not possible or emulate a hub through a device controller.

The reason is that devices listen to 1 address only (the address that was assigned during enu,meration) and they ignore all transactions for a differemnt address.

Hubs also have an address which is used for hub configuration/status and split transactions on high-speed hubs, but hub pass all other trafic to their downstream ports. It is this propagation that allowd the host to assign an address to all the connected devices.

So, since the device controller can only respond to 1 address, it is not possible to emulate multiple device addresses.

There is one option that might work for you. You could make it a Composite device. This is a device with multiple functions.

Ex a printer/scanner/fax machine could have a single address but still support the 3 functions.

See Chapter 5.2.3 Physical Bus Topology in the USB spec for more information.

Best regards,

Richard

View solution in original post

0 Kudos
4 Replies
1,533 Views
MorganMonks
Contributor II

HI Amol,

My company has embedded USB Hubs that are primarly designed for portable products. We offer very small low power USB2.0 HS hub with three ports. Contact me if this may help you out. I can work with you to get samples eval boards etc.

Morgan Monks

morgan.monks(at)smsc(dot)com


1,533 Views
ken_sun-b03826
NXP Employee
NXP Employee


in MX35, OTG and host ports are separate ports in physical, so it can't be configured as a hub.

Maybe you can develope software in MX35 to let it work as a hub, but it may need software engineer's help.

0 Kudos
1,533 Views
Akar
Contributor II

Hi Haifeng

Yes you are correct. I am a sowftware developer. I don’t know how to configure ithe USB OTG device as HUB, so was looking the solution in software itself.

If some body has done this ot knows how to do the HUB configuration on i.MX35 please guide me.

0 Kudos
1,534 Views
richard_stulens
NXP Employee
NXP Employee

Hi Amol,

It is by definition not possible or emulate a hub through a device controller.

The reason is that devices listen to 1 address only (the address that was assigned during enu,meration) and they ignore all transactions for a differemnt address.

Hubs also have an address which is used for hub configuration/status and split transactions on high-speed hubs, but hub pass all other trafic to their downstream ports. It is this propagation that allowd the host to assign an address to all the connected devices.

So, since the device controller can only respond to 1 address, it is not possible to emulate multiple device addresses.

There is one option that might work for you. You could make it a Composite device. This is a device with multiple functions.

Ex a printer/scanner/fax machine could have a single address but still support the 3 functions.

See Chapter 5.2.3 Physical Bus Topology in the USB spec for more information.

Best regards,

Richard

0 Kudos