USB Host example on ESP32-S3-DevKitC-1

davidbetz
Posts: 9
Joined: Fri May 13, 2022 7:19 pm

USB Host example on ESP32-S3-DevKitC-1

Postby davidbetz » Fri May 13, 2022 7:27 pm

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?

davidbetz
Posts: 9
Joined: Fri May 13, 2022 7:19 pm

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

Postby davidbetz » Mon May 16, 2022 3:45 pm

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?

gdsports
Posts: 15
Joined: Wed Aug 02, 2017 12:17 am

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

Postby gdsports » Mon May 16, 2022 6:09 pm

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

davidbetz
Posts: 9
Joined: Fri May 13, 2022 7:19 pm

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

Postby davidbetz » Mon May 16, 2022 7:59 pm

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.

davidbetz
Posts: 9
Joined: Fri May 13, 2022 7:19 pm

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

Postby davidbetz » 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

josecastillo
Posts: 1
Joined: Thu Dec 15, 2022 4:26 am

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

Postby josecastillo » Thu Dec 15, 2022 4:40 am

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

HeadHodge
Posts: 3
Joined: Thu Feb 02, 2023 3:28 am

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

Postby HeadHodge » Tue Feb 14, 2023 11:51 pm

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

mediaRif
Posts: 10
Joined: Tue Mar 22, 2022 5:04 am

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

Postby mediaRif » Sat Apr 01, 2023 5:05 am

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) ...

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

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

Postby chegewara » Mon Apr 03, 2023 7:49 am

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

Suxsem
Posts: 3
Joined: Mon Jun 26, 2023 5:47 pm

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

Postby Suxsem » Mon Jun 26, 2023 5:56 pm


Who is online

Users browsing this forum: No registered users and 48 guests