USB Host example on ESP32-S3-DevKitC-1
USB Host example on ESP32-S3-DevKitC-1
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
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
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
https://github.com/touchgadget/esp32-usb-host-demos
Re: USB Host example on ESP32-S3-DevKitC-1
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
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
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
-
- Posts: 1
- Joined: Thu Dec 15, 2022 4:26 am
Re: USB Host example on ESP32-S3-DevKitC-1
davidbetz wrote: ↑Mon May 16, 2022 8:57 pmI 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
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...davidbetz wrote: ↑Mon May 16, 2022 8:57 pmI 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 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
davidbetz wrote: ↑Mon May 16, 2022 8:57 pmI 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
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
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
Who is online
Users browsing this forum: No registered users and 96 guests