Page 1 of 3

ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Wed May 19, 2021 3:50 pm
by BrianP
Hello and thanks in advance for the help.

I recently received my ESP32-C3 mini development kit. I am pretty sure it is configured to use the CP2102 USB interface and so R1 and R4 are installed. I would like to use the internal USB JTAG interface which I understand requires the removal of R1 and R4 and installation of R2 and R3 (though I am not sure this is the case). This would also free up RXD and TXD, which I need to use.

I have not been able to find documentation on how to use the Devkits with the USB JTAG, nor have I been able to determine the location of R1, R2, R3, R4. I have tried "beeping out" the circuit but would prefer not to ruin my board.

Is there any guidance as to where those components are and/or how to use USB JTAG.

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Wed May 19, 2021 11:33 pm
by ESP_Sprite
The PCB layout of that devboard can be found here. As far as I can see, you need to rotate those resistors 90 degrees: move them from the red to the green position in this image:
c3_builtin.png
c3_builtin.png (246.05 KiB) Viewed 21155 times
You probably also want to disconnect the RxD/TxD pins from the CP2104 to the ESP32C3 if you want to use those pins. You can do that by removing R21/R22, I marked those in blue.

The builtin USB thing should more-or-less work as an extra UART inside the ESP32C3 and as a generic CDC-ACM serial port (=no drivers required) on the PC side. You do need to use the latest master of ESP-IDF to get full support for it, and you specifically want to select the device as your console output UART in menuconfig, otherwise your debug messages will go to UART0.

On the JTAG side, just use esp_usb_jtag.cfg as your JTAG adapter config file in OpenOCD and you should be good.

If you need any more help, feel free to post it here. Support for the built-in USB-to-JTAG thing on the C3 is pretty new, so I'd be interested in seeing how you fare with it.

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Wed May 19, 2021 11:47 pm
by BrianP
Thanks for the reply! That's exactly what I was looking for. For some reason I was not able to find the information but now I have it. Thanks again!

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Thu May 20, 2021 4:23 am
by chegewara
Is not that you need devkit rev 3 to get USB to JTAG to work? I thought it was broken in older versions.

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Thu May 20, 2021 5:54 am
by ESP_Sprite
The chip itself needs to be at least ECO3, indeed. Not sure if that somehow matches with a certain version of devboard, but given the fact that all non-ECO3 chips were pre-releases, I imagine that if you buy a mass-production board by now you're sure to have that rev.

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Thu May 20, 2021 12:12 pm
by BrianP
I'll try the mod later today and let you know.

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Fri May 21, 2021 2:31 pm
by BrianP
Alas, I am not used to working with SMT parts as small as those resistors. I removed them OK but I could not solder anything in place. I used an ultra-fine pitch iron but the parts kept sticking to the iron instead of the board. I ended up screwing up the tracks.

Fortunately, I bought two development boards and I know I can fix my problem, either by soldering to the USB connector or the external pins.

Now I am struggling with installing the ESP-IDF. It installs OK but the installation menu at the end does not correspond to the directions on the website. When I try and compile "helloworld" for the C3 I either get toos not found or some other error in Eclipse.

I am now trying offline installation.

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Wed Dec 22, 2021 6:18 pm
by MIKHAIL
Can anybody provide step-by-step instruction on any platform that you managed to flash the device on with Magic Built in USB JTAG? (ESP-idf Eclipse, VS Code platform IO)

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Thu Dec 23, 2021 2:05 am
by ESP_Sprite
If you mean the USB-serial-JTAG device, it should simply show up as another serial port; you'd flash in the same way as you would over a 'standard' USB to serial adapter. (Note under Linux and macOS the device nodes may be named different, e.g. /dev/ttyACM0 instead of /dev/ttyUSB0)

Re: ESP32-C3 Mini Devkit: Configure for Built in USB JTAG?

Posted: Thu Dec 23, 2021 2:07 am
by BrianP
Try this https://www.esp32.com/viewtopic.php?f=40&t=22365

I have put this aside for a few months to work on a second processor used on my project.