-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for 1-level USB hub in USB host implementation (IDFGH-11416) #12554
Comments
Hi @dordnung, Thank for the request! Yes, that is true that it would be handy to support external HUBs and we have this task in TODO list. Meanwhile, do you have any specific request regarding external HUBs or any ideas that could help us to make the better requirements for implementation? Thanks. |
Hello @roma-jam good to hear that it's already on the todo list. Currently I don't have any specific requirements for the implementation, except that it should happen in the background and no user control should be necessary |
Hi @dordnung , Thanks for the information. Right, that is exactly how it suppose to be! After the implementation is available, there will be an update in this ticket. Thanks again for you request. |
Following |
following |
Following |
Also interested. |
when it will be available ? |
still not available ? |
"Status: In Progress" nice! |
I don't know if it helps, but there are other libraries with USB HUB implementation, like this:
|
Also waiting for hub support. Thanks! |
I remembered another library that implements a USB Hub, it is the simplest library I found about Hub, apparently it expands the variables (arrays) to serve more than one device, which is why it seems to be so difficult to understand, and transparent at the same time: |
Still no news about this? |
Hi @rtek1000, Still in progress. |
Hey @roma-jam, good to hear that it's still in progress! In the meantime, I've been trying to handle it on my own, and I feel like I've hit a wall. I can send commands to the HUB to get the HUB Descriptor, and I also send the PORT_RESET feature to reset the port and start the communication to the connected device. However this is where my issue is. When I use GET_DESCRIPTOR it returns the HUB descriptor instead of the device. From what I've read, after the PORT_RESET command, the connected device is assigned to the default address 0. I suspect the GET_DESCRIPTOR is returning the HUB Descriptor because I'm passing the saved device handle, which on the background has an address of not 0?
I tried using the SET_ADDRESS command but it didn't seem to do much. Do I have to close and open the handle again with the new address? Even if that's the case, I suspect the SET_ADDRESS command will run on the HUB and not the device, since again I'm passing the deviceHandle as seen above (which is the HUB handle)? Since I'm handling the enumeration by myself, do I have to call usb_host_device_open by myself to get the connected device handle? Can I have two handles open at the same time, or does this mean that I can't "Only supports a single device, but the Host Library's API is designed for multiple device support"? If I try to use usb_host_device_open on address 0, I get the error: (0x102): Invalid argument By using the usb_host_device_addr_list_fill command, I can only see one device which is the HUB at address 1, even after using the SET_ADDRESS to change it. Lastly, if I try to use GET_DESCRIPTOR after SET_ADDRESS, I get an error: USBH: Dev 1 EP 0 Error Sorry for the lengthy reply, any tip is highly appreciated, thank you! I'm using the Arduino IDE by the way. Edit: I tried calling SET_ADDRESS and setting it to 2, and on its response I tried calling usb_host_device_open, and I got the error: (0x105): Requested resource not found. Actually this happens on every command I try to send, after SET_ADDRESS. I somehow have to call the enumeration again from scratch? How do I do that? |
Following |
Me too, i have to do it to send 3 hubs connected each other and 1 stm32 for each hub through wifi, usb ip as you said |
Please, there is no need to stress, the important thing is to achieve it, take as much time as you need. Thank you. |
looking forward for it. I have several project that can use multiple USB and the HUB is really an important feature. |
I'm watching this thread 😆 By the way, I tried ESP32-S3 multi device plug and play. https://x.com/devemin/status/1806618148449472649?t=dUanlXj-NXaKhUdyFNlA8A&s=19 I can't wait your supporting the USB Hub! |
@devemin i saw your video, you are running one device at time but the idea is to run multi device and multi hubs at the same time of course |
@roma-jam Any updates? |
We may need to see if there are resources for multiple HUB levels, such as RAM. At first, I believe that it is already interesting to be able to operate with just 1 HUB (1 Level) and 4 devices. Note: A 7-port HUB usually has 2 HUB levels. |
Maybe for that let the user decide what levels and devices should be available. |
Hi @archef2000 , Its currently in the review state. Took a bit longer, than expected, but we are closer to complete this ticket than ever. There will be a multiple Hubs support with a configurable option to have only 1 layer supported. |
Oh thats great to hear. I am looking forward to trying it out. |
I see that
|
You can talk to the hub but not the attached to it. It is not in any official release. |
I remembered another driver that supports HUB, which might be a source of research: ChibiOS Forum
http://forum.chibios.org/viewtopic.php?f=16&t=2968&sid=afd037349cc1b55f54a428350fc8f5fc Note: Unfortunately, there is a physical problem in STM32 IC so you may not be able to use HUB (appears to be related only to the internal PHY), but it is interesting to know that the code exists. |
It is already implemented in esp-idf master just not released as a version. https://github.com/espressif/esp-idf/blob/master/components/usb/private_include/ext_hub.h#L75 |
Hi @bwhitman , There will be the second part regarding external hubs’ ports available soon. Sorry for the inconveniences. |
@roma-jam i see that the status is done, where is the release ? thanks |
Hi @maaamcube , The feature was added internally and usually it takes some time to pass the tests and synchronize them with the public repo. |
Is your feature request related to a problem?
The ESP32-S3 has only one USB port and furthermore some USB ICs integrate several devices/ports in one chip via a USB hub interface. The XR22800IL32TR-F, for example, has a USB 2.0 hub with 3 downstream ports. However, the host hub implementation currently only supports the root hub. It looks like the
usbh.c
already supports multiple devices via a USB hub, for example there are already methods likeusbh_hub_add_dev
. However, the hub implementation itself only supports the root hub. As a result, there are currently no options for integrating more than one device or accessing a specific device behind a hubDescribe the solution you'd like.
It would be handy if the USB host implementation would support at least a 1-level USB hub to connect more than one device to the ESP32 or to use ICs that use an internal USB hub interface
Describe alternatives you've considered.
TinyUSB already supports a 1-level hub in the host implementation, but TinyUSB does not provide host support for the ESP32. Unfortunately I do not have enough understanding of the USB specification to port the implementation of TinyUSB into the esp-idf implementation
Additional context.
No response
The text was updated successfully, but these errors were encountered: