Skip to content
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 ESP32S3 on Arduino #12

Open
rppicomidi opened this issue May 7, 2024 · 7 comments
Open

Support ESP32S3 on Arduino #12

rppicomidi opened this issue May 7, 2024 · 7 comments

Comments

@rppicomidi
Copy link
Owner

Is your feature request related to a problem? Please describe.
@marchingband attempted to compile usb_midi_host_example.ino
and got the error Compilation error: #error "Please Select USB Stack: Adafruit TinyUSB Host"

Describe the solution you'd like
The example should also work with the Espressif ESP32S3 Dev Module + MAX3421E host shield. The other TinyUSB dual role examples work.

Describe alternatives you've considered
See discussion here

Additional context
See discussion here

@marchingband
Copy link

Just want to be clear that I am not using any shield, or additional parts, the ESP32S3 supports usb host natively.

@rppicomidi
Copy link
Owner Author

@marchingband According to the TinyUSB website, TinyUSB does not support USB Host natively for the ESP32S3. I looked at the repository for the espressif branch of tinyusb and under tinyusb/src/portable/espressif/esp32sx and found a dcd_esp32sx.c for USB device but no corresponding hcd_esp32sx.c for the host side. The esp-idf repo has a host controller interface, but my project is an extension of TinyUSB, not the esp-idf. This driver relies on TinyUSB support for host bulk and control endpoints and implements the MIDI spec on top of it. I can probably make this driver work with the MAX3421E host shield.

Unless you or someone else adds TinyUSB support for ESP32 host hardware, this driver is not the path to Arduino support for native USB host MIDI on ESP32. Should I close this issue?

@marchingband
Copy link

Sorry to hear that, thanks for looking into it!

@marchingband
Copy link

Would it be worth asking at tinyUSB to add host support? I know so little about usb I'm unclear if that's a reasonable request or not.

@rppicomidi
Copy link
Owner Author

@marchingband Up to you. I will leave this issue open here. If others want me to support the MAX3421E host shield in this driver,
I will get to it. If no one responds in a few months, I will close it due to lack of interest.

BTW, I do understand that the ESP32 is a popular ecosystem, and I see the potential benefits of it for MIDI. Nevertheless, my attraction to the RP2040 and the Pico board in particular is you can implement a USB MIDI host and a USB MIDI device at the same time with only two added resistors and a USB connector on a 4 US dollar board. For 2 dollars more, you can buy a Pico W board that adds WiFi and Bluetooth support. There are enough other I/O pins to implement UARTs for UART MIDI too.

@marchingband
Copy link

I certainly see the power of rp2040, although I havnt yet tried it. ESP32S3 makes a great audio target because of i2s and eMMC/SD peripherals, and the 8MB octal PSRAM available at $5, the newer P4 (out soon) has a 400mhz clock and will be even better at audio.

I am not sure if you've seen this repo, and I'm not sure if it uses tinyUSB, but I believe it works for S3 under Arduino https://github.com/touchgadget/esp32-usb-host-demos/blob/main/examples/usbhmidi/usbhmidi.ino

Maybe it helps.

In case you are curious here is my project, I am working on v2 currently.

https://www.sparkfun.com/products/21307

@marchingband
Copy link

hathach/tinyusb#2634

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants