Hi and million thanks for your awesome library 👍
An idea came up while I was playing with an ESP32-C3 and esp32-arduino-lib-builder to produce a package with memory protection disabled, and accidentally built for ESP32 S2/S3 too.
Although S2/S3 already have builtin USB support, this support is limited to either host or device role, but what if esp32_usb_soft_host is used along with tinyUSB acting as a device?
I chose to focus on ESP32S2/esp32_usb_soft_host alone, I don't have a broken out ESP32-S3 and tinyUSB considerations can wait.
Adapting the code was mostly adding || defined CONFIG_IDF_TARGET_ESP32S2
to #if CONFIG_IDF_TARGET_*
conditional blocks and assigning pins.
However checkPins()
detection fails, and now the doubt is there 🤔
Some thoughts:
- not sure what value to assign to
BLINK_GPIO
, tried the builtin led pin, scl pin, random pins and got not change
- not sure if
cpu_ll_enable_cycle_count();
is needed in function usb_process()
, enabling/disabling produces no change
- using the
makeOpcodes()
from ESP32 works fine, maybe ESP32S2 wants different opcodes
(In the event the situation is realistic)
Possible use cases of an ESP32S2 using esp32_usb_soft_host/tinyUSB and acting both as host+device:
- Gaming: DIY dongle for joypad/joystick auto fire + programming
- Security research: HID MITM keylogger, mouselogger, injector, etc
- ...
So here's my question:
Is it a xxx limitation prevents yyy feature
situation or is it worth researching further?
Thanks again for creating this project, it brought hours of fun ❤️