Getting TinyUSB/Streaming UVC Cam to work on XIAO ESP32S3

I’m trying to get a TinyUSB project to working with a streaming USB/UVC camera running on a XIAO-ESP32S3 board. I have the project running successfully on an Espressif USB-OTG dev. board. But TinyUSB fails to detect a camera device on the USB bus. I’m powering the XIAO and camera from a 5V supply (with a diode on the EPS32 5V pin). And the camera is getting 5V power.
I soldered the D+/D- pads on the bottom of the XIAO board to D+/D- (respectively) on the USB camera. But lacking a USB protocol analyzer (i.e. Beagle?), I really can’t monitor USB comms. Does anyone have any experience with the D+/D- pads on the XIAO that can pass along some pointers? Thanks in advance for your replies.

Hi there,
Wow, that sounds like a task.
You have some code to show? Post it up using the code tags above, “</>” paste it in there.
The power setup is more than likely the issue if I were making a guess.
Can you post a picture of the setup?
HTH
GL :slight_smile: PJ :v:

Hey PJ, thanks for the reply and interest. From a code standpoint, I’m just using an ESP-IDF repo that sets up a streaming cameras (UVC MJPEG). Here’s a link to what I used for a starting point. esp-idf/examples/peripherals/usb/host/uvc at master · espressif/esp-idf · GitHub
I’ve got it working great on an Espressif USB/OTG dev board (as I mentioned). And next I modified the code to match the XIAO board. I know for a fact that on the XIAO board, the USB initialization (via TinyUSB) completes successfully. But the call to uvc_find_device fails on the XIAO board.
I pasted a rough diagram of how I wired the XIAO board. I’m sure the camera is getting powered (I have a USB power monitor installed). So my guess is there is a issue with the D+/D- pads on the underside of the XIAO board. I don’t see any technical documentation regarding usage of this pads. I just striped a stock USB cable and soldered D+/D- to the XIAO pads and to a USB breakout board. It’s a short, shield standard USB cable. I just pasted a image, but didn’t see it show up. So I’ll check back. Thanks again for the response and interest.

Hi there,
Hmmm, Looks pretty good,
The USB D+ and D- wires on the ESP32-S3 are connected to GPIO20 and GPIO19, respectively:

Pin Function
GPIO20 D+
GPIO19 D-

If the board doesn’t have a USB connector, you can connect the D+ and D- pins directly to the host using a cable. Some cables may use non-standard colors, and some drivers can work with swapped D+ and D- connections. If your device isn’t detected, you can try swapping the cables.

If the ESP32-S3 is a self-powered device, you’ll need to connect VBUS through a voltage divider or comparator. The VBUS signal monitors the voltage level, and a device can be fully functional even without a USB connection if it’s self-powered. So if battery powered it won’t look like a USB device on a OTG port, but ESpressif has changed it a bit , also some strapping pins may be required, but i think that’s just to use jtag only no usb (D+, D-)
Your close you’ll get it.
HTH
GL :slight_smile: PJ :v:

I would try A USB power bank plugged into Xiao USB-C port. :crossed_fingers:

Hey PJ, I just wanted to give a quick update. I just got the firmware working on a 2nd Espressif board, the ESP32S3-DevKitC-1. Sometime ago I found a post (in github) from another guy that recommended a cable like the one you described. The ESP32S3-DevKitC-1 has 2 USB ports, so I’m able to run and debug. So my only (next) challenge is to figure out why it’s not working on the Seeed XIAO board. Have a great evening. BTW, I’m in the panhandle of FL. My daughter is in Boyton Beach. I will be down to see her at Thanksgiving. Let’s stay in touch.

1 Like

Well final update for anyone interested in interfacing USB streaming cameras. I finally got this project to run on the XIAO ESP32S3. So that make the 3rd of 3 different ESP32S3 boards I’ve used in this effort. In the end, the XIAO board is the easiest to interface. Basically all you need to do is the power the board with a 5V supply (following Seeeduino instruction). This will result in 5V appearing on the USB-C connector. So it seems the device automatically goes into “USB host mode”. This isn’t apparent and I couldn’t find any documentation (but it may exist somewhere). Nor did it seem to be apparent in the schematics. But I verified this operation with a USB power monitor. And the firmware implemented with the TinyUSB library detects and runs successfully on all boards including the XIAO. Good luck to anyone with a similar goal.

1 Like