Flashing through USB in ESP32S3

Kowshik_Bevara
Posts: 20
Joined: Wed Mar 02, 2022 2:39 pm

Flashing through USB in ESP32S3

Postby Kowshik_Bevara » Mon Jun 13, 2022 9:58 am

Hi,

I have a device based on ESP32S3. I'm able to see a COM port when the device is connected to a PC via USB even without having any code inside it or even with firmware that doesn't contain any USB functionalities.

So I'm able to flash the code directly via that COM port using the flash download tool.

But when I'm enabling USB MSC and CDC functionalities the COM port is getting changed and now I'm unable to program the device via the available COM port.

I have tried this: Deleted the USB MSC and CDC tasks once I'm done using them. But now I'm getting a notification from my PC saying the USB device is not recognized.

NOTE:
1. The device had different PID and VID for the firmware that has USB functionalities like MSC and CDC compared to the firmware without having USB functionalities or even without any firmware.

Thanks & Regards,
Kowshik.

rpiloverbd
Posts: 101
Joined: Tue Mar 22, 2022 5:23 am

Re: Flashing through USB in ESP32S3

Postby rpiloverbd » Mon Jun 13, 2022 12:00 pm

What's the operating system of the computer that you're using?

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

Re: Flashing through USB in ESP32S3

Postby ESP_Sprite » Tue Jun 14, 2022 1:46 am

The -S3 has both an USB-serial-JTAG device as well as a 'general-purpose' USB-OTG peripheral. The device you see on bootup is the USB-serial-JTAG unit; it does not need software to work and as such you can program the ESP32S3 directly from the factory. When you enable USB-MSC/CDC, you switch to the USB-OTG peripheral; while that can also be used to get back into flashing mode, it needs software support to do so. Perhaps the issue is there. Note that (unless you burn efuses) you can always go back into download mode (which uses USB-serial-JTAG) by grounding IO0 on reset.

Kowshik_Bevara
Posts: 20
Joined: Wed Mar 02, 2022 2:39 pm

Re: Flashing through USB in ESP32S3

Postby Kowshik_Bevara » Sun Jun 19, 2022 6:49 am

Thanks for the reply, it gives a lot of clarification.

Other than the trail I mentioned earlier, I have tried going to the download mode using software but was unable to do so.

I tried returning to download mode by setting the GPIO0 pin low from the software itself and performing a software reset.

Still, I'm unable to see the COM port.

Could you please help me with this? Is there any other way to go to the download mode using the software?

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

Re: Flashing through USB in ESP32S3

Postby ESP_Sprite » Sun Jun 19, 2022 7:34 am

Ah, in software... yeah, setting GPIO that way won't work. I think setting the RTC_CNTL_FORCE_DOWNLOAD_BOOT bit in the RTC_CNTL_OPTION1_REG register and rebooting may get you there, but I'm not sure if the USB stack is in any usable state after that.

Who is online

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