SOLVED: Can't flash hello.c on ESP32-C3 (WROOM) with ESP-IDF extension in VSCode
Posted: 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 ?
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 ?