Flashing ESP32-C3 using built-in usb serial/jtag controller

PhilTechno
Posts: 4
Joined: Tue Nov 16, 2021 8:48 am

Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby PhilTechno » Tue Nov 16, 2021 9:11 am

Hi,

I'm using Visual Studio Code with the Espressif IDF extension on windows 10.
I have a ESP32-C3-DevKitM-1 which i was able to flash the Get-Started/blink example software using the usb connector on board.
I am now trying to flash it using the built in usb serial/jtag controller.

I have a usb cable connected as below:
Red -> 5V
Black -> GND
Green -> D+ (IO19)
White -> D- (IO18)

I am manually resetting the device into download mode by connecting IO09 to GND and resetting it.

I selected the right COM port and now when i start flashing i get this:

esptool.py v3.1-dev
Serial port COM6
Connecting...
Chip is unknown ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 84:f7:03:09:95:7c
Uploading stub...
Running stub...

And it stays there forever.

If anyone can help me, i would very appreciate it.

Here's what i get when it flashes successfully over the onboard usb:

esptool.py v3.1-dev
Serial port COM3
Connecting....
Chip is unknown ESP32-C3 (revision 3)
Features: Wi-Fi
Crystal is 40MHz
MAC: 84:f7:03:09:95:7c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00010000 to 0x00037fff...
Flash will be erased from 0x00000000 to 0x00004fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 160256 bytes to 80218...
Wrote 160256 bytes (80218 compressed) at 0x00010000 in 2.9 seconds (effective 434.9 kbit/s)...
Hash of data verified.
Compressed 19024 bytes to 11330...
Wrote 19024 bytes (11330 compressed) at 0x00000000 in 0.6 seconds (effective 259.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 319.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

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

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby ESP_Sprite » Tue Nov 16, 2021 9:20 am

What ESP-IDF version are you running?

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

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby chegewara » Tue Nov 16, 2021 10:23 am

ESP_Sprite is it possible that cp210x is keeping USB pins in state where USB/JTAG is just not working and it is required to remove resistors on board?
I think that cp210x may keep both lines high and SE1 is invalid USB state.

bobolink
Posts: 98
Joined: Mon Feb 26, 2018 4:17 pm

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby bobolink » Tue Nov 16, 2021 12:00 pm

I’ve never had any problems leaving the resistors in.
But nothing must be connected to the onboard USB connector while the patch cable is active.

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

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby chegewara » Tue Nov 16, 2021 12:05 pm

bobolink wrote:
Tue Nov 16, 2021 12:00 pm
I’ve never had any problems leaving the resistors in.
But nothing must be connected to the onboard USB connector while the patch cable is active.
Yes, thats what i mean. If board is power thru onboard usb connector then cp210x may (or may not) cause problems with USB/JTAG connected to pins. It is just idea.

PhilTechno
Posts: 4
Joined: Tue Nov 16, 2021 8:48 am

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby PhilTechno » Tue Nov 16, 2021 4:57 pm

ESP_Sprite wrote:
Tue Nov 16, 2021 9:20 am
What ESP-IDF version are you running?
I am running version 1.2.0

PhilTechno
Posts: 4
Joined: Tue Nov 16, 2021 8:48 am

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby PhilTechno » Tue Nov 16, 2021 4:59 pm

chegewara wrote:
Tue Nov 16, 2021 10:23 am
ESP_Sprite is it possible that cp210x is keeping USB pins in state where USB/JTAG is just not working and it is required to remove resistors on board?
I think that cp210x may keep both lines high and SE1 is invalid USB state.
The onboard resistors connecting the USB pins to the connector are removed by default.

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

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby ESP_Sprite » Wed Nov 17, 2021 4:06 am

I'd say enumeration would likely already fail if it's an actual physical problem... Can you take another look at your esp-idf version? '1.2.0 is super-old and I think that's a version for something else; you're more likely looking for something in the 3.x or 4.x range.

PhilTechno
Posts: 4
Joined: Tue Nov 16, 2021 8:48 am

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby PhilTechno » Thu Nov 18, 2021 2:07 am

ESP_Sprite wrote:
Wed Nov 17, 2021 4:06 am
I'd say enumeration would likely already fail if it's an actual physical problem... Can you take another look at your esp-idf version? '1.2.0 is super-old and I think that's a version for something else; you're more likely looking for something in the 3.x or 4.x range.
1.2.0 is the version of the Espressif IDF extension in visual studio code, i can,t seem to find what version of ESP-IDF it is using but it was release on 09/09/2021. Should i try flashing with a different software?

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

Re: Flashing ESP32-C3 using built-in usb serial/jtag controller

Postby ESP_Sprite » Thu Nov 18, 2021 3:00 am

It would be useful if you can use the most recent (master) esp-idf as a reference... I'm wondering if you're using some version of esp-idf that comes with an esptool that doesn't quite work with the C3 yet.

Who is online

Users browsing this forum: axellin and 133 guests