ESP32-S3 in device mode with host stack support #124
Replies: 2 comments 1 reply
-
pi pico arduino and tinyusb support the rp2040 USB OTG port in host mode. There is an example here. https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/examples/Host/Simple/host_device_info/host_device_info.ino I do not know if tinyusb supports hubs in host mode. |
Beta Was this translation helpful? Give feedback.
-
@ohmyboroda I will try to answer your questions from the RP2040 side. I have never used the ESP32. The diagram is almost feasible. A USB host port can only be directly wired to one USB device at a time. You need to insert a USB hub between the Pico's PIO host port and your multiple HID devices. Once you do that, it should work provided that you configure Pico-PIO-USB driver to use GPIO 26 as DP (GPIO 27 as DM follows the DP value). I have never used RP2040 ADC GPIO pins for USB. I would prototype a USB HID Host example (see TinyUSB library examples) before designing final hardware in case there are issues with pin types. I would recommend using a more evolved host driver than the one in the examples given here. TinyUSB supports hubs in host mode for both Pico PIO USB and native USB hardware. Your software will have to identify which HID device is what and multiplex the data over the UART port. If all 3 HID devices are different, you can use the VID/PID identifiers for each device to tell them apart. If all devices are the same, you will have to figure out which device is wired to which hub port. That said, @touchgadget's comment is valid. Your diagram does not show the RP2040's native USB port used for anything. If you do not need the RP2040's native USB port in device mode, you might consider using the RP2040's native USB port in host mode and save the GPIO pins, the PIO resources, and the multi-core complexity. HID host examples are available in the TinyUSB library. If you are a very skilled software developer, it MIGHT be possible to implement 3 USB host ports on one Pico board. Each Pico PIO USB port now only consumes one PIO module. The RP2040 has two. Add the native USB hardware, and you get 3. But there exists no software support for this today as far as I am aware, and in the end, it is not likely to be feasible. This implementation will also consume 4 GPIO pins plus the native USB port. I do not recommend this. I hope this feedback is timely enough to be useful to you. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings everyone! 👋
I am working on developing a prototype device based on the ESP32-S3 that functions in HID Device mode (emulating a gamepad) for a host (such as a console or PC), while also allowing the connection of up to three additional HID devices. One of these devices will operate in passthrough mode for authentication on consoles like the PS5 or Xbox. I have a few questions regarding the feasibility of this setup (please refer to the attached diagram):
Necessity of a Separate Host:
From my understanding, a separate host, possibly based on the RP2040, is necessary for this configuration rather than using the MAX3421E, to facilitate the connection of multiple devices. It might be possible to avoid using the RP2040, but it seems the Arduino firmware for ESP32-S3 does not support the Host Stack.
TinyUSB Compatibility:
Is it feasible to implement this scheme using the current TinyUSB library?
Additional Details:
A very similar project has been implemented in a popular library https://github.com/OpenStickCommunity/GP2040-CE, but it does not solve the specific problem I am facing. And here I found a similar reference using RP204 #75
I would greatly appreciate any assistance or guidance on this matter!
P.S.: I've attached the diagram for your reference.
Beta Was this translation helpful? Give feedback.
All reactions