Page 1 of 1

USB Host example on ESP32-S3-DevKitC-1

Posted: Fri May 13, 2022 7:27 pm
by davidbetz
I am trying to run the IDF usb_host_lib example on a ESP32-S3-DevKitC-1 and am not seeing any devices detected when I plug a USB device into the OTG cable I have connected to the USB port on the dev board. I set the USB_PHY_SEL fuse to 1. Is there anything else I need to do for this example to run?

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Mon May 16, 2022 3:45 pm
by davidbetz
It looks my problem is that the ESP32-S3 USB Port does not have an option for providing 5v to the device plugged into it. Is there any way to do that?

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Mon May 16, 2022 6:09 pm
by gdsports
Look at the link for how to wire up a USB host connector on S2/S3. A USB OTG host cable is not sufficient because the USB port does not provide VBUS 5V output.

https://github.com/touchgadget/esp32-usb-host-demos

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Mon May 16, 2022 7:59 pm
by davidbetz
Thanks! I'll try the breakout board approach. After having this problem with the DevKitC board, I bought a ESP32-S3-USB-OTG board and apparently it has the same problem. It doesn't supply 5v on the female USB connector either. I had thought it would work since the device is supposed to be for USB-OTG development. Maybe I've missed some configuration option.

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Mon May 16, 2022 8:57 pm
by davidbetz
I did some searching and got the ESP32-S3-USB-OTG device to work by adding this code to enable power on the host USB connector.

gpio_set_direction(12, GPIO_MODE_OUTPUT);
gpio_set_direction(13, GPIO_MODE_OUTPUT);
gpio_set_direction(17, GPIO_MODE_OUTPUT);
gpio_set_direction(18, GPIO_MODE_OUTPUT);

gpio_set_level(12, 1); // DEV_VBUS_EN
gpio_set_level(13, 0); // BOOST_EN
gpio_set_level(17, 1); // IDEV_LIMIT_EN
gpio_set_level(18, 1); // USB_SEL

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Thu Dec 15, 2022 4:40 am
by josecastillo
davidbetz wrote:
Mon May 16, 2022 8:57 pm
I did some searching and got the ESP32-S3-USB-OTG device to work by adding this code to enable power on the host USB connector.

gpio_set_direction(12, GPIO_MODE_OUTPUT);
gpio_set_direction(13, GPIO_MODE_OUTPUT);
gpio_set_direction(17, GPIO_MODE_OUTPUT);
gpio_set_direction(18, GPIO_MODE_OUTPUT);

gpio_set_level(12, 1); // DEV_VBUS_EN
gpio_set_level(13, 0); // BOOST_EN
gpio_set_level(17, 1); // IDEV_LIMIT_EN
gpio_set_level(18, 1); // USB_SEL

Hello David, I bought an ADAfruit esp32-s3 which is supposed to have the native usb support (apparently it has otg) but i can not power external devices as well. I saw your last code, i just wonder if this can be implemented on my board as well, because it looks like my board does not have some gpio that the devkit has like, for example GPIO19 and 20 for USB_D+ and USB_D-. there is also a 5v pin that i dont have but on my board i have a vbus, that is marked for "USB" I am confused with this and i want to power an external midi controller. Also, can you elaborate where did you add the code on the last message? Thanks

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Tue Feb 14, 2023 11:51 pm
by HeadHodge
davidbetz wrote:
Mon May 16, 2022 8:57 pm
I did some searching and got the ESP32-S3-USB-OTG device to work by adding this code to enable power on the host USB connector.

gpio_set_direction(12, GPIO_MODE_OUTPUT);
gpio_set_direction(13, GPIO_MODE_OUTPUT);
gpio_set_direction(17, GPIO_MODE_OUTPUT);
gpio_set_direction(18, GPIO_MODE_OUTPUT);

gpio_set_level(12, 1); // DEV_VBUS_EN
gpio_set_level(13, 0); // BOOST_EN
gpio_set_level(17, 1); // IDEV_LIMIT_EN
gpio_set_level(18, 1); // USB_SEL
I was quite excited buying a eps32-s3-usb-otg board, because it seemed like a fully loaded Ford F-150 pickup truck that could do everything...

I got an usb-msc ram drive working great on the boards usb-dev interface when connected to my laptop.

Then after setting the gpio pins (as shown above), I was able to get an usb cdc host working great on the boards usb-host interface, when connected to an usb cdc serial dongle I have.

Then I discovered that by setting the gpio 18 pin, it totally disables the boards usb-dev interface and along with it my working usb-msc ram drive. 😆

Without both usb-dev and usb-host interfaces working concurrently, it makes my app useless 😖

Can anyone confirm if this a hardware limitation, or something that could be improved with updated firmware .

thanks

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Sat Apr 01, 2023 5:05 am
by mediaRif
davidbetz wrote:
Mon May 16, 2022 8:57 pm
I did some searching and got the ESP32-S3-USB-OTG device to work by adding this code to enable power on the host USB connector.

gpio_set_direction(12, GPIO_MODE_OUTPUT);
gpio_set_direction(13, GPIO_MODE_OUTPUT);
gpio_set_direction(17, GPIO_MODE_OUTPUT);
gpio_set_direction(18, GPIO_MODE_OUTPUT);

gpio_set_level(12, 1); // DEV_VBUS_EN
gpio_set_level(13, 0); // BOOST_EN
gpio_set_level(17, 1); // IDEV_LIMIT_EN
gpio_set_level(18, 1); // USB_SEL

Wondering if anyone has been able to find information on this possibility for the ESP32-S3-DevKitC-1? (If this is possible without the breakout board, It would be ideal for a project I'm working on) ...

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Mon Apr 03, 2023 7:49 am
by chegewara
I believe you can find all you need in this repo
https://github.com/espressif/esp-dev-ki ... _guide.rst

The minimum is to set GPIO12 high

Code: Select all

gpio_set_direction(12, GPIO_MODE_OUTPUT);
gpio_set_level(12, 1); // DEV_VBUS_EN

Re: USB Host example on ESP32-S3-DevKitC-1

Posted: Mon Jun 26, 2023 5:56 pm
by Suxsem