-
Notifications
You must be signed in to change notification settings - Fork 49
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is ESP32 S2/S3 support realistic? #15
Comments
well this implementation is really dirty and probably wrong on many levels but after some fiddling I had a keyboard successfully detected on an ESP32-S2 https://github.com/tobozo/ESP32-USB-Soft-Host/releases/tag/v0.1.2 I didn't succeed at using opcodes with the S2, memory management is different and disabling memory protection wasn't enough to prevent it from crashing. The ugly fix for the ESP32-S2 is to use a substitute for #define NOP() asm volatile ("nop")
void IRAM_ATTR cpuDelay(uint32_t cycles_count )
{
if( cycles_count > 0 ) {
while( cycles_count-->1 ) NOP();
}
} I'm quite sure the maths don't add up though, maybe this works on a misunderstanding? |
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:
BLINK_GPIO
, tried the builtin led pin, scl pin, random pins and got not changecpu_ll_enable_cycle_count();
is needed in functionusb_process()
, enabling/disabling produces no changemakeOpcodes()
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:
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 鉂わ笍
The text was updated successfully, but these errors were encountered: