Skip to content

JTAG programming ESP32-C3 Not Working #8334

Closed
@mjs513

Description

@mjs513

Board

ESP32-C3 Dev Board

Device Description

DIYmall NiceMCU-C3F V1.0 ESP32-C3

Hardware Configuration

RGB LED attached to GPIO8, GPIO5 and GPIO4.

GPIO18/19 attached to usb cable:
GPIO18 D- to WTH on the cable
GPIO19 D+ to GRN on the cable

Version

v2.0.9

IDE Name

Arduino IDE 2.1.1 nightly 20230529

Operating System

Windows 10 x64

Flash frequency

80Mz

PSRAM enabled

yes

Upload speed

921600

Description

For last week or so we have been trying to get Debug working using the Arduino IDE 2.x debugger with no luck. On setup is based on attacing a USB cable to pins IO18/19 with gnd to gnd and powering from the USB connector. This is based on the following:
Configure ESP32-C3 built-in JTAG Interface

We also downloaded ESP-tools so we have the correct drivers install as we saw this: Arduino IDE 2.X Debug
however even with the driver installed I am see this for the USB connected to D-/D_
Capture

When I went to manually install the driver it did not update so went in and tried a different way and gave me an error that said I needed the x64 driver???

GDB console shows the following error:

Debug: 223 62 semihosting_common.c:107 semihosting_common_init():  
Error: 224 91 esp_usb_jtag.c:642 esp_usb_jtag_init(): esp_usb_jtag: could not find or open device!
Debug: 225 91 command.c:545 run_command(): Command 'init' failed with error code -4
User : 226 92 command.c:608 command_run_line(): 
Error: 227 92 riscv.c:1755 riscv_get_gdb_arch(): Unsupported xlen: -1
Error: 228 92 esp_semihosting.c:67 target_to_esp_semihost_data(): Unknown target arch!
Debug: 229 92 riscv.c:490 riscv_deinit_target(): riscv_deinit_target()
Debug: 230 92 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
[2023-06-19T17:27:37.548Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Sketch

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/

#define LED_BUILTIN 8

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}


### Debug Message

```plain
Debug: 223 62 semihosting_common.c:107 semihosting_common_init():  
Error: 224 91 esp_usb_jtag.c:642 esp_usb_jtag_init(): esp_usb_jtag: could not find or open device!
Debug: 225 91 command.c:545 run_command(): Command 'init' failed with error code -4
User : 226 92 command.c:608 command_run_line(): 
Error: 227 92 riscv.c:1755 riscv_get_gdb_arch(): Unsupported xlen: -1
Error: 228 92 esp_semihosting.c:67 target_to_esp_semihost_data(): Unknown target arch!
Debug: 229 92 riscv.c:490 riscv_deinit_target(): riscv_deinit_target()
Debug: 230 92 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
[2023-06-19T17:27:37.548Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Here is the entire log

[2023-06-19T17:27:37.378Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
�[92m"C:\\Users\\Merli\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\openocd-esp32\\v0.11.0-esp32-20221026/bin/openocd" -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "d:\\Users\\Merli\\Documents\\Arduino\\Blink_rgb" -f "F:/Arduino-2-0/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl" -f debug.cfg -d3
�[0mOpen On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:48)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
User : 3 3 options.c:52 configuration_output_handler(): debug_level: 3
User : 4 3 options.c:52 configuration_output_handler(): 
Debug: 5 3 options.c:233 add_default_dirs(): bindir=/builds/idf/openocd-esp32/_build/../openocd-esp32/bin
Debug: 6 4 options.c:234 add_default_dirs(): pkgdatadir=/builds/idf/openocd-esp32/_build/../openocd-esp32/share/openocd
Debug: 7 4 options.c:235 add_default_dirs(): exepath=C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin
Debug: 8 4 options.c:236 add_default_dirs(): bin2data=../share/openocd
Debug: 9 4 configuration.c:33 add_script_search_dir(): adding C:/Users/Merli/AppData/Roaming/OpenOCD
Debug: 10 4 configuration.c:33 add_script_search_dir(): adding C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/site
Debug: 11 5 configuration.c:33 add_script_search_dir(): adding C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/scripts
Debug: 12 5 command.c:155 script_debug(): command - gdb_port 50000
Debug: 13 5 command.c:155 script_debug(): command - tcl_port 50001
Debug: 14 5 command.c:155 script_debug(): command - telnet_port 50002
Debug: 15 5 command.c:155 script_debug(): command - ocd_find F:/Arduino-2-0/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl
Debug: 16 6 configuration.c:88 find_file(): found F:/Arduino-2-0/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl
User : 17 10 options.c:52 configuration_output_handler(): CDRTOSConfigureUser : 18 10 options.c:52 configuration_output_handler(): 
Debug: 19 10 command.c:155 script_debug(): command - ocd_find debug.cfg
Debug: 20 11 configuration.c:88 find_file(): found debug.cfg
Debug: 21 11 command.c:155 script_debug(): command - ocd_find interface/esp_usb_jtag.cfg
Debug: 22 12 configuration.c:88 find_file(): found C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/scripts/interface/esp_usb_jtag.cfg
Debug: 23 12 command.c:155 script_debug(): command - adapter driver esp_usb_jtag
Info : 24 13 transport.c:107 allow_transports(): only one transport option; autoselect 'jtag'
Debug: 25 13 command.c:155 script_debug(): command - espusbjtag vid_pid 0x303a 0x1001
Info : 26 13 esp_usb_jtag.c:890 esp_usb_jtag_vid_pid(): esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Debug: 27 13 command.c:155 script_debug(): command - espusbjtag caps_descriptor 0x2000
Info : 28 13 esp_usb_jtag.c:901 esp_usb_jtag_caps_descriptor(): esp_usb_jtag: capabilities descriptor set to 0x2000
Debug: 29 13 command.c:155 script_debug(): command - adapter speed 40000
Debug: 30 14 adapter.c:251 adapter_config_khz(): handle adapter khz
Debug: 31 14 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 32 14 adapter.c:215 adapter_khz_to_speed(): convert khz to adapter specific speed value
Debug: 33 14 command.c:155 script_debug(): command - ocd_find target/esp32c3.cfg
Debug: 34 15 configuration.c:88 find_file(): found C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/scripts/target/esp32c3.cfg
Debug: 35 16 command.c:155 script_debug(): command - transport select jtag
Warn : 36 16 transport.c:276 jim_transport_select(): Transport "jtag" was already selected
Debug: 37 17 command.c:155 script_debug(): command - ocd_find bitsbytes.tcl
Debug: 38 18 configuration.c:88 find_file(): found C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/scripts/bitsbytes.tcl
Debug: 39 19 command.c:155 script_debug(): command - expr 1 << $x
Debug: 40 19 command.c:155 script_debug(): command - expr $x + 1
Debug: 41 19 command.c:155 script_debug(): command - expr 1 << $x
Debug: 42 19 command.c:155 script_debug(): command - expr $x + 1
Debug: 43 19 command.c:155 script_debug(): command - expr 1 << $x
Debug: 44 20 command.c:155 script_debug(): command - expr $x + 1
Debug: 45 20 command.c:155 script_debug(): command - expr 1 << $x
Debug: 46 20 command.c:155 script_debug(): command - expr $x + 1
Debug: 47 21 command.c:155 script_debug(): command - expr 1 << $x
Debug: 48 21 command.c:155 script_debug(): command - expr $x + 1
Debug: 49 21 command.c:155 script_debug(): command - expr 1 << $x
Debug: 50 21 command.c:155 script_debug(): command - expr $x + 1
Debug: 51 21 command.c:155 script_debug(): command - expr 1 << $x
Debug: 52 21 command.c:155 script_debug(): command - expr $x + 1
Debug: 53 21 command.c:155 script_debug(): command - expr 1 << $x
Debug: 54 21 command.c:155 script_debug(): command - expr $x + 1
Debug: 55 22 command.c:155 script_debug(): command - expr 1 << $x
Debug: 56 22 command.c:155 script_debug(): command - expr $x + 1
Debug: 57 22 command.c:155 script_debug(): command - expr 1 << $x
Debug: 58 22 command.c:155 script_debug(): command - expr $x + 1
Debug: 59 22 command.c:155 script_debug(): command - expr 1 << $x
Debug: 60 22 command.c:155 script_debug(): command - expr $x + 1
Debug: 61 22 command.c:155 script_debug(): command - expr 1 << $x
Debug: 62 23 command.c:155 script_debug(): command - expr $x + 1
Debug: 63 23 command.c:155 script_debug(): command - expr 1 << $x
Debug: 64 23 command.c:155 script_debug(): command - expr $x + 1
Debug: 65 23 command.c:155 script_debug(): command - expr 1 << $x
Debug: 66 23 command.c:155 script_debug(): command - expr $x + 1
Debug: 67 23 command.c:155 script_debug(): command - expr 1 << $x
Debug: 68 23 command.c:155 script_debug(): command - expr $x + 1
Debug: 69 23 command.c:155 script_debug(): command - expr 1 << $x
Debug: 70 24 command.c:155 script_debug(): command - expr $x + 1
Debug: 71 24 command.c:155 script_debug(): command - expr 1 << $x
Debug: 72 24 command.c:155 script_debug(): command - expr $x + 1
Debug: 73 24 command.c:155 script_debug(): command - expr 1 << $x
Debug: 74 24 command.c:155 script_debug(): command - expr $x + 1
Debug: 75 24 command.c:155 script_debug(): command - expr 1 << $x
Debug: 76 24 command.c:155 script_debug(): command - expr $x + 1
Debug: 77 25 command.c:155 script_debug(): command - expr 1 << $x
Debug: 78 25 command.c:155 script_debug(): command - expr $x + 1
Debug: 79 25 command.c:155 script_debug(): command - expr 1 << $x
Debug: 80 25 command.c:155 script_debug(): command - expr $x + 1
Debug: 81 25 command.c:155 script_debug(): command - expr 1 << $x
Debug: 82 25 command.c:155 script_debug(): command - expr $x + 1
Debug: 83 25 command.c:155 script_debug(): command - expr 1 << $x
Debug: 84 25 command.c:155 script_debug(): command - expr $x + 1
Debug: 85 25 command.c:155 script_debug(): command - expr 1 << $x
Debug: 86 26 command.c:155 script_debug(): command - expr $x + 1
Debug: 87 26 command.c:155 script_debug(): command - expr 1 << $x
Debug: 88 26 command.c:155 script_debug(): command - expr $x + 1
Debug: 89 26 command.c:155 script_debug(): command - expr 1 << $x
Debug: 90 26 command.c:155 script_debug(): command - expr $x + 1
Debug: 91 26 command.c:155 script_debug(): command - expr 1 << $x
Debug: 92 26 command.c:155 script_debug(): command - expr $x + 1
Debug: 93 27 command.c:155 script_debug(): command - expr 1 << $x
Debug: 94 27 command.c:155 script_debug(): command - expr $x + 1
Debug: 95 27 command.c:155 script_debug(): command - expr 1 << $x
Debug: 96 27 command.c:155 script_debug(): command - expr $x + 1
Debug: 97 27 command.c:155 script_debug(): command - expr 1 << $x
Debug: 98 27 command.c:155 script_debug(): command - expr $x + 1
Debug: 99 27 command.c:155 script_debug(): command - expr 1 << $x
Debug: 100 28 command.c:155 script_debug(): command - expr $x + 1
Debug: 101 28 command.c:155 script_debug(): command - expr 1 << $x
Debug: 102 28 command.c:155 script_debug(): command - expr $x + 1
Debug: 103 28 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 104 28 command.c:155 script_debug(): command - expr $x * 2
Debug: 105 28 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 106 28 command.c:155 script_debug(): command - expr $x * 2
Debug: 107 29 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 108 29 command.c:155 script_debug(): command - expr $x * 2
Debug: 109 29 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 110 29 command.c:155 script_debug(): command - expr $x * 2
Debug: 111 29 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 112 29 command.c:155 script_debug(): command - expr $x * 2
Debug: 113 29 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 114 29 command.c:155 script_debug(): command - expr $x * 2
Debug: 115 30 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 116 30 command.c:155 script_debug(): command - expr $x * 2
Debug: 117 30 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 118 30 command.c:155 script_debug(): command - expr $x * 2
Debug: 119 30 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 120 30 command.c:155 script_debug(): command - expr $x * 2
Debug: 121 30 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 122 30 command.c:155 script_debug(): command - expr $x * 2
Debug: 123 31 command.c:155 script_debug(): command - expr 1024 * $x
Debug: 124 31 command.c:155 script_debug(): command - expr $x * 2
Debug: 125 31 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 126 31 command.c:155 script_debug(): command - expr $x * 2
Debug: 127 31 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 128 31 command.c:155 script_debug(): command - expr $x * 2
Debug: 129 31 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 130 32 command.c:155 script_debug(): command - expr $x * 2
Debug: 131 32 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 132 32 command.c:155 script_debug(): command - expr $x * 2
Debug: 133 32 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 134 32 command.c:155 script_debug(): command - expr $x * 2
Debug: 135 32 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 136 32 command.c:155 script_debug(): command - expr $x * 2
Debug: 137 33 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 138 33 command.c:155 script_debug(): command - expr $x * 2
Debug: 139 33 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 140 33 command.c:155 script_debug(): command - expr $x * 2
Debug: 141 33 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 142 33 command.c:155 script_debug(): command - expr $x * 2
Debug: 143 34 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 144 34 command.c:155 script_debug(): command - expr $x * 2
Debug: 145 34 command.c:155 script_debug(): command - expr 1024 * 1024 * $x
Debug: 146 34 command.c:155 script_debug(): command - expr $x * 2
Debug: 147 34 command.c:155 script_debug(): command - ocd_find memory.tcl
Debug: 148 35 configuration.c:88 find_file(): found C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/scripts/memory.tcl
Debug: 149 37 command.c:155 script_debug(): command - expr $RWX_R_ONLY + $RWX_W_ONLY
Debug: 150 37 command.c:155 script_debug(): command - expr $RWX_R_ONLY + $RWX_X_ONLY
Debug: 151 37 command.c:155 script_debug(): command - expr $RWX_R_ONLY + $RWX_W_ONLY + $RWX_X_ONLY
Debug: 152 37 command.c:155 script_debug(): command - expr $ACCESS_WIDTH_8 + $ACCESS_WIDTH_16 + $ACCESS_WIDTH_32
Debug: 153 37 command.c:155 script_debug(): command - ocd_find mmr_helpers.tcl
Debug: 154 39 configuration.c:88 find_file(): found C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/scripts/mmr_helpers.tcl
Debug: 155 40 command.c:155 script_debug(): command - ocd_find target/esp_common.cfg
Debug: 156 40 configuration.c:88 find_file(): found C:/Users/Merli/AppData/Local/Arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/../share/openocd/scripts/target/esp_common.cfg
Debug: 157 41 command.c:155 script_debug(): command - add_help_text program_esp write an image to flash, address is only required for binary images. verify, reset, exit, compress, restore_clock are optional
Debug: 158 42 command.c:155 script_debug(): command - add_usage_text program_esp <filename> [address] [verify] [reset] [exit] [compress] [no_clock_boost] [restore_clock]
Debug: 159 42 command.c:155 script_debug(): command - add_help_text program_esp_bins write all the images at address specified in flasher_args.json generated while building idf project
Debug: 160 43 command.c:155 script_debug(): command - add_usage_text program_esp_bins <build_dir> flasher_args.json [verify] [reset] [exit] [compress] [no_clock_boost] [restore_clock]
Debug: 161 43 command.c:155 script_debug(): command - add_help_text esp_get_mac Print MAC address of the chip. Use a `format` argument to return formatted MAC value
Debug: 162 43 command.c:155 script_debug(): command - add_usage_text esp_get_mac [format]
Debug: 163 44 command.c:155 script_debug(): command - jtag newtap esp32c3 cpu -irlen 5 -expected-id 0x00005c25
Debug: 164 44 tcl.c:558 jim_newtap_cmd(): Creating New Tap, Chip: esp32c3, Tap: cpu, Dotted: esp32c3.cpu, 4 params
Debug: 165 44 tcl.c:582 jim_newtap_cmd(): Processing option: -irlen
Debug: 166 44 tcl.c:582 jim_newtap_cmd(): Processing option: -expected-id
Debug: 167 44 core.c:1478 jtag_tap_init(): Created Tap: esp32c3.cpu @ abs position 0, irlen 5, capture: 0x1 mask: 0x3
Debug: 168 44 command.c:155 script_debug(): command - target create esp32c3 esp32c3 -chain-position esp32c3.cpu -rtos FreeRTOS
Debug: 169 45 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 170 45 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 171 45 FreeRTOS.c:1396 freertos_create(): freertos_create
Debug: 172 45 command.c:289 register_command(): command 'esp' is already registered
Debug: 173 46 command.c:289 register_command(): command 'esp32c3 esp' is already registered
Debug: 174 46 command.c:155 script_debug(): command - esp32c3 configure -event reset-assert-post  esp32c3_soc_reset 
Debug: 175 46 command.c:155 script_debug(): command - esp32c3 configure -event halted 
    esp32c3_wdt_disable

Debug: 176 46 command.c:155 script_debug(): command - esp32c3 configure -event examine-end 
    # Need this to handle 'apptrace init' syscall correctly because semihosting is not enabled by default
    arm semihosting enable
    arm semihosting_resexit enable
    if { [info exists _SEMIHOST_BASEDIR] } {
        if { $_SEMIHOST_BASEDIR != "" } {
            arm semihosting_basedir $_SEMIHOST_BASEDIR
        }
    }

Debug: 177 47 command.c:155 script_debug(): command - esp32c3 configure -event gdb-attach 
    # 'halt' is necessary to auto-probe flash bank when GDB is connected and generate proper memory map
    halt 1000
    if { [esp32c3_memprot_is_enabled] } {
        # 'reset halt' to disable memory protection and allow flasher to work correctly
        echo "Memory protection is enabled. Reset target to disable it..."
        reset halt
    }
    # by default mask interrupts while stepping
    riscv set_maskisr steponly

Debug: 178 48 command.c:155 script_debug(): command - esp32c3 configure -work-area-phys 0x40380000 -work-area-virt 0x40380000 -work-area-size 0x4000 -work-area-backup 1
Debug: 179 48 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 180 48 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 181 49 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 182 49 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 183 49 command.c:155 script_debug(): command - esp32c3 configure -alt-work-area-phys 0x3FC84000 -alt-work-area-virt 0x3FC84000 -alt-work-area-size 0x20000 -alt-work-area-backup 1
Debug: 184 49 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 185 50 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 186 50 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 187 50 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
Debug: 188 50 command.c:155 script_debug(): command - flash bank esp32c3.flash esp32c3 0x0 0 0 0 esp32c3
Debug: 189 50 command.c:289 register_command(): command 'esp' is already registered
Debug: 190 51 tcl.c:1305 handle_flash_bank_command(): 'esp32c3' driver usage field missing
Debug: 191 51 command.c:155 script_debug(): command - flash bank esp32c3.irom esp32c3 0x0 0 0 0 esp32c3
Debug: 192 51 command.c:289 register_command(): command 'esp' is already registered
Debug: 193 51 command.c:289 register_command(): command 'esp appimage_offset' is already registered
Debug: 194 51 command.c:289 register_command(): command 'esp compression' is already registered
Debug: 195 51 command.c:289 register_command(): command 'esp verify_bank_hash' is already registered
Debug: 196 52 command.c:289 register_command(): command 'esp flash_stub_clock_boost' is already registered
Debug: 197 52 tcl.c:1305 handle_flash_bank_command(): 'esp32c3' driver usage field missing
Debug: 198 52 command.c:155 script_debug(): command - flash bank esp32c3.drom esp32c3 0x0 0 0 0 esp32c3
Debug: 199 52 command.c:289 register_command(): command 'esp' is already registered
Debug: 200 52 command.c:289 register_command(): command 'esp appimage_offset' is already registered
Debug: 201 53 command.c:289 register_command(): command 'esp compression' is already registered
Debug: 202 53 command.c:289 register_command(): command 'esp verify_bank_hash' is already registered
Debug: 203 53 command.c:289 register_command(): command 'esp flash_stub_clock_boost' is already registered
Debug: 204 53 tcl.c:1305 handle_flash_bank_command(): 'esp32c3' driver usage field missing
Debug: 205 53 command.c:155 script_debug(): command - riscv set_reset_timeout_sec 2
Debug: 206 54 command.c:155 script_debug(): command - riscv set_command_timeout_sec 5
Debug: 207 54 command.c:155 script_debug(): command - riscv set_mem_access sysbus progbuf abstract
Debug: 208 55 command.c:155 script_debug(): command - riscv set_ebreakm on
Debug: 209 55 command.c:155 script_debug(): command - riscv set_ebreaks on
Debug: 210 55 command.c:155 script_debug(): command - riscv set_ebreaku on
Info : 211 59 server.c:292 add_service(): Listening on port 50001 for tcl connections
Info : 212 60 server.c:292 add_service(): Listening on port 50002 for telnet connections
Debug: 213 60 command.c:155 script_debug(): command - init
Debug: 214 60 command.c:155 script_debug(): command - target init
Debug: 215 60 command.c:155 script_debug(): command - target names
Debug: 216 61 command.c:155 script_debug(): command - esp32c3 cget -event gdb-flash-erase-start
Debug: 217 61 command.c:155 script_debug(): command - esp32c3 configure -event gdb-flash-erase-start reset init
Debug: 218 61 command.c:155 script_debug(): command - esp32c3 cget -event gdb-flash-write-end
Debug: 219 61 command.c:155 script_debug(): command - esp32c3 configure -event gdb-flash-write-end reset halt
Debug: 220 62 command.c:155 script_debug(): command - esp32c3 cget -event gdb-attach
Debug: 221 62 target.c:1659 handle_target_init_command(): Initializing targets...
Debug: 222 62 riscv.c:444 riscv_init_target(): riscv_init_target()
Debug: 223 62 semihosting_common.c:107 semihosting_common_init():  
Error: 224 91 esp_usb_jtag.c:642 esp_usb_jtag_init(): esp_usb_jtag: could not find or open device!
Debug: 225 91 command.c:545 run_command(): Command 'init' failed with error code -4
User : 226 92 command.c:608 command_run_line(): 
Error: 227 92 riscv.c:1755 riscv_get_gdb_arch(): Unsupported xlen: -1
Error: 228 92 esp_semihosting.c:67 target_to_esp_semihost_data(): Unknown target arch!
Debug: 229 92 riscv.c:490 riscv_deinit_target(): riscv_deinit_target()
Debug: 230 92 target.c:2225 target_free_all_working_areas_restore(): freeing all working areas
[2023-06-19T17:27:37.548Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed



### Other Steps to Reproduce

Settings:
Core Debug Level: DEBUG
JTAG Adapter: Integrated USB JTAG
Note I do not see an optimization level
-----------------------------

Other info:  
Fuse summary

espefuse.py v4.5.1
Connecting....
Detecting chip type... ESP32-C3

=== Run "summary" command ===
EFUSE_NAME (Block) Description = [Meaningful Value] [Readable/Writeable] (Hex Value)

Calibration fuses:
TEMP_SENSOR_CAL (BLOCK2) Temperature calibration = -3.2 R/W (0b100100000)
ADC1_MODE0_D2 (BLOCK2) ADC1 calibration 1 = -208 R/W (0xb4)
ADC1_MODE1_D2 (BLOCK2) ADC1 calibration 2 = 356 R/W (0x59)
ADC1_MODE2_D2 (BLOCK2) ADC1 calibration 3 = -44 R/W (0x8b)
ADC1_MODE3_D2 (BLOCK2) ADC1 calibration 4 = 292 R/W (0x49)
ADC2_MODE0_D2 (BLOCK2) ADC2 calibration 5 = -472 R/W (0xf6)
ADC2_MODE1_D2 (BLOCK2) ADC2 calibration 6 = 296 R/W (0x4a)
ADC2_MODE2_D2 (BLOCK2) ADC2 calibration 7 = -388 R/W (0xe1)
ADC2_MODE3_D2 (BLOCK2) ADC2 calibration 8 = 32 R/W (0x08)
ADC1_MODE0_D1 (BLOCK2) ADC1 calibration 9 = 44 R/W (0b001011)
ADC1_MODE1_D1 (BLOCK2) ADC1 calibration 10 = 96 R/W (0b011000)
ADC1_MODE2_D1 (BLOCK2) ADC1 calibration 11 = 52 R/W (0b001101)
ADC1_MODE3_D1 (BLOCK2) ADC1 calibration 12 = 8 R/W (0b000010)
ADC2_MODE0_D1 (BLOCK2) ADC2 calibration 13 = 0 R/W (0b000000)
ADC2_MODE1_D1 (BLOCK2) ADC2 calibration 14 = 0 R/W (0b000000)
ADC2_MODE2_D1 (BLOCK2) ADC2 calibration 15 = 0 R/W (0b000000)
ADC2_MODE3_D1 (BLOCK2) ADC2 calibration 16 = 0 R/W (0b000000)

Config fuses:
DIS_ICACHE (BLOCK0) Disables ICache = False R/W (0b0)
DIS_DOWNLOAD_ICACHE (BLOCK0) Disables Icache when SoC is in Download mode = False R/W (0b0)
DIS_FORCE_DOWNLOAD (BLOCK0) Disables forcing chip into Download mode = False R/W (0b0)
DIS_CAN (BLOCK0) Disables the TWAI Controller hardware = False R/W (0b0)
VDD_SPI_AS_GPIO (BLOCK0) Set this bit to vdd spi pin function as gpio = False R/W (0b0)
BTLC_GPIO_ENABLE (BLOCK0) Enable btlc gpio = 0 R/W (0b00)
POWERGLITCH_EN (BLOCK0) Set this bit to enable power glitch function = False R/W (0b0)
POWER_GLITCH_DSENSE (BLOCK0) Sample delay configuration of power glitch = 0 R/W (0b00)
DIS_DIRECT_BOOT (BLOCK0) Disables direct boot mode = False R/W (0b0)
DIS_USB_SERIAL_JTAG_ROM_PRINT (BLOCK0) Disables USB-Serial-JTAG ROM printing = False R/W (0b0)
UART_PRINT_CONTROL (BLOCK0) Sets the default UART boot message output mode = Enabled R/W (0b00)
FORCE_SEND_RESUME (BLOCK0) Force ROM code to send a resume command during SPI = False R/W (0b0)
bootduring SPI boot
ERR_RST_ENABLE (BLOCK0) Use BLOCK0 to check error record registers = without check R/W (0b0)
DISABLE_WAFER_VERSION_MAJOR (BLOCK0) Disables check of wafer version major = False R/W (0b0)
DISABLE_BLK_VERSION_MAJOR (BLOCK0) Disables check of blk version major = False R/W (0b0)
BLOCK_USR_DATA (BLOCK3) User data
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W

Efuse fuses:
WR_DIS (BLOCK0) Disables programming of individual eFuses = 0 R/W (0x00000000)
RD_DIS (BLOCK0) Disables software reading from BLOCK4-10 = 0 R/W (0b0000000)

Flash Config fuses:
FLASH_TPUW (BLOCK0) Configures flash startup delay after SoC power-up, = 0 R/W (0x0)
unit is (ms/2). When the value is 15, delay is 7.
5 ms

Identity fuses:
SECURE_VERSION (BLOCK0) Secure version (used by ESP-IDF anti-rollback feat = 0 R/W (0x0000)
ure)
MAC (BLOCK1) Factory MAC Address
= 60:55:f9:25:c7:cc (OK) R/W
WAFER_VERSION_MINOR_LO (BLOCK1) WAFER_VERSION_MINOR least significant bits = 3 R/W (0b011)
PKG_VERSION (BLOCK1) Package version = 0 R/W (0b000)
BLK_VERSION_MINOR (BLOCK1) BLOCK version minor = 1 R/W (0b001)
WAFER_VERSION_MINOR_HI (BLOCK1) WAFER_VERSION_MINOR most significant bits = 0 R/W (0b0)
WAFER_VERSION_MAJOR (BLOCK1) WAFER_VERSION_MAJOR = 0 R/W (0b00)
OPTIONAL_UNIQUE_ID (BLOCK2) Optional unique 128-bit ID
= 17 34 a4 98 f4 eb e6 3a 7a 48 96 74 c2 99 62 5b R/W
BLK_VERSION_MAJOR (BLOCK2) BLOCK version major = With calibration R/W (0b01)
CUSTOM_MAC (BLOCK3) Custom MAC Address
= 00:00:00:00:00:00 (OK) R/W
WAFER_VERSION_MINOR (BLOCK0) calc WAFER VERSION MINOR = WAFER_VERSION_MINOR_HI = 3 R/W (0x3)
<< 3 + WAFER_VERSION_MINOR_LO (read only)

Jtag Config fuses:
SOFT_DIS_JTAG (BLOCK0) Software disables JTAG. When software disabled, JT = 0 R/W (0b000)
AG can be activated temporarily by HMAC peripheral
DIS_PAD_JTAG (BLOCK0) Permanently disable JTAG access via pads. USB JTAG = False R/W (0b0)
is controlled separately.

Security fuses:
DIS_DOWNLOAD_MANUAL_ENCRYPT (BLOCK0) Disables flash encryption when in download boot mo = False R/W (0b0)
des
SPI_BOOT_CRYPT_CNT (BLOCK0) Enables encryption and decryption, when an SPI boo = Disable R/W (0b000)
t mode is set. Enabled when 1 or 3 bits are set,di
sabled otherwise
SECURE_BOOT_KEY_REVOKE0 (BLOCK0) If set, revokes use of secure boot key digest 0 = False R/W (0b0)
SECURE_BOOT_KEY_REVOKE1 (BLOCK0) If set, revokes use of secure boot key digest 1 = False R/W (0b0)
SECURE_BOOT_KEY_REVOKE2 (BLOCK0) If set, revokes use of secure boot key digest 2 = False R/W (0b0)
KEY_PURPOSE_0 (BLOCK0) KEY0 purpose = USER R/W (0x0)
KEY_PURPOSE_1 (BLOCK0) KEY1 purpose = USER R/W (0x0)
KEY_PURPOSE_2 (BLOCK0) KEY2 purpose = USER R/W (0x0)
KEY_PURPOSE_3 (BLOCK0) KEY3 purpose = USER R/W (0x0)
KEY_PURPOSE_4 (BLOCK0) KEY4 purpose = USER R/W (0x0)
KEY_PURPOSE_5 (BLOCK0) KEY5 purpose = USER R/W (0x0)
SECURE_BOOT_EN (BLOCK0) Enables secure boot = False R/W (0b0)
SECURE_BOOT_AGGRESSIVE_REVOKE (BLOCK0) Enables aggressive secure boot key revocation mode = False R/W (0b0)
DIS_DOWNLOAD_MODE (BLOCK0) Disables all Download boot modes = False R/W (0b0)
ENABLE_SECURITY_DOWNLOAD (BLOCK0) Enables secure UART download mode (read/write flas = False R/W (0b0)
h only)
BLOCK_KEY0 (BLOCK4)
Purpose: USER
Encryption key0 or user data
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK_KEY1 (BLOCK5)
Purpose: USER
Encryption key1 or user data
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK_KEY2 (BLOCK6)
Purpose: USER
Encryption key2 or user data
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK_KEY3 (BLOCK7)
Purpose: USER
Encryption key3 or user data
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK_KEY4 (BLOCK8)
Purpose: USER
Encryption key4 or user data
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK_KEY5 (BLOCK9)
Purpose: USER
Encryption key5 or user data
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK_SYS_DATA2 (BLOCK10) System data (part 2)
= 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W

Spi_Pad_Config fuses:
SPI_PAD_CONFIG_CLK (BLOCK1) SPI CLK pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_Q (BLOCK1) SPI Q (D1) pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_D (BLOCK1) SPI D (D0) pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_CS (BLOCK1) SPI CS pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_HD (BLOCK1) SPI HD (D3) pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_WP (BLOCK1) SPI WP (D2) pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_DQS (BLOCK1) SPI DQS pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_D4 (BLOCK1) SPI D4 pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_D5 (BLOCK1) SPI D5 pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_D6 (BLOCK1) SPI D6 pad = 0 R/W (0b000000)
SPI_PAD_CONFIG_D7 (BLOCK1) SPI D7 pad = 0 R/W (0b000000)

Usb Config fuses:
DIS_USB_JTAG (BLOCK0) Disables USB JTAG. JTAG access via pads is control = False R/W (0b0)
led separately
DIS_USB_DEVICE (BLOCK0) Disables USB DEVICE = False R/W (0b0)
USB_EXCHG_PINS (BLOCK0) Exchanges USB D+ and D- pins = False R/W (0b0)
DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE (BLOCK0) Disables USB-Serial-JTAG download feature in UART = False R/W (0b0)
download boot mode

Wdt Config fuses:
WDT_DELAY_SEL (BLOCK0) Selects RTC WDT timeout threshold at startup = False R/W (0b0)

PS D:\Espressif\frameworks\esp-idf-v5.0.2>


### I have checked existing issues, online documentation and the Troubleshooting Guide

- [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions