USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Lalith1011
Posts: 6
Joined: Fri May 13, 2022 9:23 am

USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby Lalith1011 » Thu Aug 25, 2022 9:48 am

I have tried to run the example files for "USB DEVICE" like usb_serial_device and usb_console on ESP32-S2FH4. I flashed the code and connected the device to my PC. I got an error "CODE 43 : DEVICE DESCRIPTOR REQUEST FAILED". I tried with multiple PCs, with multiple ESP32-S2FH4 boards and with multiple USB cables. The issue remains the same. I went in depth into the example files and there was a task that logs the "event-id" of the USB.

Event id is 1 in case of new USB connection, 6 in case PC sends data to the device, 7 if data from the ESP chip is transmitted. What I observed from the logs is that event id is continuously remaining "1" even after connection has been made and not switching to "6". This is a clear indication that ESP is not taking the request sent by PC. How can I resolve this?

Below is the link of the examples projects I used:

https://github.com/espressif/esp-idf/tr ... usb/device

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby ESP_Sprite » Fri Aug 26, 2022 12:02 am

How do you connect the boards to the PC; are you sure you don't have D+/D- reversed? If you want to know if this is a software or hardware issue: if you force the ESP into download mode (by pulling IO0 low during reset) the ROM should make the device show up as a valid USB device independent of what software is loaded.

Lalith1011
Posts: 6
Joined: Fri May 13, 2022 9:23 am

Re: USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby Lalith1011 » Fri Aug 26, 2022 5:31 am

Thanks for the reply! We soldered the usb wires to the dev-board and connected it to the PC. I cross checked the wires, and D+,D- are connected well. I performed the test you said in which I made the device to go into boot/program mode. My device manager on my pc got reset and it could not identify the device i.e, it showed the same error "Device descriptor request failed". So do you think this is a hardware issue?

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby ESP_Sprite » Fri Aug 26, 2022 11:21 am

Unless you did something with eFuses, that indicates it's a hardware issue indeed.

john11
Posts: 14
Joined: Wed Jan 13, 2021 7:37 pm

Re: USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby john11 » Fri Aug 26, 2022 12:04 pm

Can you provide schematics if it's a custom board?
Do you have any cap on d+/- lines?

-- john

Lalith1011
Posts: 6
Joined: Fri May 13, 2022 9:23 am

Re: USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby Lalith1011 » Mon Aug 29, 2022 10:52 am

Thanq so much for your replies guys! The issue is resolved. On our PCB, we added resistors( zero ohms) and capacitors on the D+, D- lines as suggested by espressif. But, we are using esp32s2 controller and NOT soc. This leaves all our resistors and capacitors(maybe) prone to external noise,thus resulting in the malfunctioning of USB. Removing these resistors and capacitors on D+,D- lines and making a direction connection resolved the issue. USB is working fine now!

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby ESP_Sprite » Mon Aug 29, 2022 11:00 am

Hint for next time: if you checked the devboard schematics and saw the resistors and caps there, they were likely marked 'NC' and possibly also had their value greyed out. This means that there's a location for them on the devboard (for various purposes) but the device itself is not populated on the final board. If you copy a schematic, better to leave those components out as well.

john11
Posts: 14
Joined: Wed Jan 13, 2021 7:37 pm

Re: USB issue on ESP32S2 MINI1 (ESP32-S2FH4)

Postby john11 » Mon Aug 29, 2022 7:01 pm

Lalith1011 wrote:
Mon Aug 29, 2022 10:52 am
Thanq so much for your replies guys! The issue is resolved. On our PCB, we added resistors( zero ohms) and capacitors on the D+, D- lines as suggested by espressif. But, we are using esp32s2 controller and NOT soc. This leaves all our resistors and capacitors(maybe) prone to external noise,thus resulting in the malfunctioning of USB. Removing these resistors and capacitors on D+,D- lines and making a direction connection resolved the issue. USB is working fine now!
Good it's been resolved. I suspected you had caps on the data lines that caused this (perhaps in the nF/uF range instead of pF).

-- john

Who is online

Users browsing this forum: Bing [Bot] and 123 guests