-
Notifications
You must be signed in to change notification settings - Fork 7.6k
JTAG programming ESP32-C3 Not Working #8334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@mjs513 - I have the same issue with a different C3 module: https://www.amazon.com/dp/B0BWN14X65 I have also tried hooking it up to an RPI Pico board. running as a CMIS-DAP JTAG using https://github.com/ataradov/free-dap So far they are not talking. It is unclear to me how to configure the IDE to support this? |
@mjs513 your configuration is correct. Did you make sure that before starting debug you actually built and uploaded the sketch that you want to debug? This must be done any time you restart the IDE/reopen the sketch. Necessary because some files need to be copied to the sketch folder and ELF to be picked up by GDB. Use only the top 3 buttons of the IDE to compile and start debug. |
@me-no-dev thanks for getting back to us so fast. The answer to your question is yes I uploaded the sketch first and then hit the debug button on the top of the IDE. As @KurtE said he tried it with a different board than I have as well as trying to use the JTAG connectors. At this point do not know where to go from here. As you said it should work. edit: Think whats bothering me is that its not seeing the debug port as a USB/JTAG port. EDIT2: It might be related to #7295, followed the same procedure to update driver. it shows driver is installed but my x64 machine is not seeing it or not recognizing that the driver is associated the port. |
@me-no-dev and @KurtE |
Understood, but when the USB connection did not works, I thought I would try the other option. LIke what is described in: Note some of their instructions for using the USB Port version: Their cable made no sense to me as I believe they are the same pins that hook up to the actual USB connector: Wondering when the board boots up and I open up the Serial Monitor window, I see a bunch of text messages:
If this is related with JTAG stuff or potentially some internal debug stuff that is outputting by default? Thanks |
@KurtE |
Not sure if this pertains to the current issue or not. After some more googling I found this basically it adds the following command arg to opencd: |
Thanks, today I have had some luck at least getting the debugger up. My ESP32-c3 board has external 4mb flash and I need to configure the flash to DIO mode instead of QIO mode. Now at least the debugger comes up. Not sure what the configuration should be if the ESP32-c3 has internal flash. WIll hopefully find out soon, as other one(s) arrive in a few days. Note, I don't think it is working overly well, as if you try to step or the like it sort of hangs or restarts... Wonder if some of these issues are due to differences between Arm Cortex versus risc-v |
I just found this related to wifi: espressif/esp-at#615 (comment) |
Arduino 2.0.9 uses IDF 4.4, therefore this fix is already included. |
Thanks - need to make sure. But I just received a ESP32-C3 WROOM DevKitC-02 and connected it up and it works out of the box - the second serial port shows as USB Serial that pins 18/19 are connected with the USB cable so it has to be something with the board. |
Just to close the loop I finally tracked down the issue with JTAG not working on this paticular board. Turns out its a hardware issue - pins18/19 are shorted together even though there does not seem to be a solder bridge on my soldering on the header pins. Pulled out my multimeter and tested. Tried it a different board (came in a package of three) and it worked so going to close out this issue. |
@me-no-dev @mjs513 - I can start up the debugger on a couple of the different boards, but wondering does any of it actually work? Once it starts up can you get it to set a breakpoint and have it be hit. And if it is hit, can you continue from this location? If I try to get the code to continue, the gdb-server panel starts producing lots of debug output. I am running the c3 devkit m... Kurt |
@KurtE I am running the BlinkRGB example with a extra Serial.print right before the endif. I hit continue button and I get
in the GDB window. If I hit it again then the spew starts and goes on endlessly. Here is the sketch I am using:
also seems to break in setup at Serial.begin(115200) on the first continue button push and then on the second the infinite loop:
|
@me-no-dev Can you please help with triage and possibly close this issue? Thanks |
@VojtechBartoska we need to investigate all outcomes and provide a good info/tutorial on using JTAG with Arduino. The last message clearly states that the JTAG hit the I want to make clear that we are mere users of what Espressif offers as OpenOCD/GDB and what Arduino.cc offers as IDE2+cortex-debug. Our configurations were vetted by the IDF team and should work as best as possible on the current platform. It's the nuances between the chips/architecture/interface that are most important to figure out and document. When using external debugger (as required for ESP32 and ESP32-S2) there are far less issues and debugging works much more as expected. Having the USB-JTAG internal, means that the interface gets restarted with the chip and more. |
Hello, Due to the overwhelming volume of issues currently being addressed, we have decided to close the previously received tickets. If you still require assistance or if the issue persists, please don't hesitate to reopen the ticket. Thanks. |
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_
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:
Sketch
Here is the entire log
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>
The text was updated successfully, but these errors were encountered: