SOLVED: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode

Someguy22
Posts: 9
Joined: Wed Jan 08, 2025 4:51 am

SOLVED: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode

Postby Someguy22 » Wed Jan 08, 2025 5:26 am

In the ESP-IDF extension in VSCode:

1) New Project -> select ESP-IDF-V5.5. Project name: hellotest Choose ESP-IDF Board: ESP32-C3 via builtin USB-JTAG. /dev/ttyUSB0 Chose Template

2) Choose Template: hello_world -> Create Project. Open in new window. Generate project_description.json.

3) Build Project, via the ESP-IDF icon.

4) Flash Device, via the ESP-IDF icon. "OpenOCD is not running, do you want to launch it ?" <- Yes.

```
espefuse.py v4.9.dev3
Connecting...
.

Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
.

Detecting chip type...
ESP32

=== Run "summary" command ===
Saving efuse values to /tmp/espefusejsondump.tmp


/home/me/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/bin/openocd

Open On-Chip Debugger v0.12.0-esp32-20241016 (2024-10-16-14:17)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html

/home/me/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/bin/openocd

[//Flash]
[OpenOCD]
Open On-Chip Debugger v0.12.0-esp32-20241016 (2024-10-16-14:17)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

Info : only one transport option; autoselecting 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections

❌ Error: esp_usb_jtag: could not find or open device!

❌ /home/me/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/share/openocd/scripts/target/esp_common.cfg:9: Error:
at file "/home/me/.espressif/tools/openocd-esp32/v0.12.0-esp32-20241016/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 9
Error: [esp32c3] Unsupported DTM version: -1
Error: [esp32c3] Could not identify target type.
```
Following the Troubleshooting FAQ link: https://github.com/espressif/openocd-es ... ooting-FAQ, my options are:

1) wrong board configuration file. My choice for WROOM is ESP32-C3 which I have seen others use.

2) no debug adapter is connected.
```
ls -l /dev/ttyUSB*
crw-rw----. 1 root plugdev 188, 0 Jan 7 20:56 /dev/ttyUSB0

lsusb | grep Bridge
Bus 005 Device 003: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
```
I've tried using ttyUSB0 as me, root, in group dialup and plugdev. No difference.

3) Debug adapter's driver was installed incorrectly.

4) USB-JTAG is disabled via efuses.

```
espefuse.py v4.9.dev3
Connecting...
.
.

Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
.

Detecting chip type...
ESP32

=== Run "summary" command ===
Saving efuse values to /tmp/espefusejsondump.tmp
```
There is no such file in /tmp.

```
$ kinfo
Operating System: Fedora Linux 40
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.9.0
Qt Version: 6.7.2
Kernel Version: 6.12.7-100.fc40.x86_64 (64-bit)
Graphics Platform: X11
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2

$ get-idf
Checking "python3" ...
Python 3.12.8
"python3" has been detected
Activating ESP-IDF 5.5
Setting IDF_PATH to '/home/me/Development/esp/esp-idf'.
* Checking python version ... 3.12.8
* Checking python dependencies ... OK
* Deactivating the current ESP-IDF environment (if any) ... OK
* Establishing a new ESP-IDF environment ... OK
* Identifying shell ... bash
* Detecting outdated tools in system ... Found tools that are not used by active ESP-IDF version.
For removing old versions of xtensa-esp-elf-gdb, riscv32-esp-elf-gdb, xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32 use command 'python
/home/me/Development/esp/esp-idf/tools/idf_tools.py uninstall'
To free up even more space, remove installation packages of those tools.
Use option python /home/me/Development/esp/esp-idf/tools/idf_tools.py uninstall --remove-archives.
* Shell completion ... Autocompletion code generated

Done! You can now compile ESP-IDF projects.
```
How do I make this work ?
Last edited by Someguy22 on Thu Jan 09, 2025 12:45 am, edited 1 time in total.

ESP_radurentea
Posts: 21
Joined: Thu Mar 09, 2023 8:30 am

Re: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode

Postby ESP_radurentea » Wed Jan 08, 2025 5:39 am

Hi,

From what I understand from your post, you have JTAG disabled from efuse. If that is the case you are not able to use JTAG flashing anymore. You can try to use UART Flash, which does not require running OPENOCD.

If this doesn't solve the issue, please run the command "ESP-IDF: Doctor Command" from Command Palette in VS Code (F1) and paste the output here, so I can further troubleshoot your issue.

Someguy22
Posts: 9
Joined: Wed Jan 08, 2025 4:51 am

Re: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode

Postby Someguy22 » Wed Jan 08, 2025 5:59 am

Do you want the log file or just the first part ?

Someguy22
Posts: 9
Joined: Wed Jan 08, 2025 4:51 am

Re: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode

Postby Someguy22 » Wed Jan 08, 2025 6:07 am

See attached output of ESP-IDF Doctor.
Attachments
Output.txt
(12.28 KiB) Downloaded 37 times

Someguy22
Posts: 9
Joined: Wed Jan 08, 2025 4:51 am

Re: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode

Postby Someguy22 » Wed Jan 08, 2025 5:57 pm

The eFuses have never been touched on this processor and I've been able to flash it with other IDE/toolchains.

What isn't working ?

Someguy22
Posts: 9
Joined: Wed Jan 08, 2025 4:51 am

Re: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode

Postby Someguy22 » Thu Jan 09, 2025 12:44 am

It turns out that the problem is the ESP32 WROOM board I am using don't support JTAG debugging via the USB interface. It only supports the uploading of code. The key piece of information in this regard is that the USB interface on my board is

Code: Select all

Silicon Labs CP210x UART Bridge
. The usual USB device that supports JTAG is an FT232 or a derivative thereof.

I'm so used to working with STM32 devices that I just assumed that the USB interface on my dev board supported JTAG. It does not.

Thanks for the replies.

Who is online

Users browsing this forum: No registered users and 10 guests