Skip to content

Troubleshooting FAQ

Alexey Gerenkov edited this page Nov 10, 2021 · 14 revisions

Generic Issues

OpenOCD crashes at startup with message 'jtag_checks: Assertion `jtag_trst == 0' failed.'

OpenOCD log looks like below.

Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6014, description '*', serial '*' at bus location '*'

Reason 1

No debug adapter is connected.

Solution

Check that debug adapter USB device is present in the system.

OS Actions
Windows Go to Device Dispatcher and check that device is detected by the system.
Linux Use lsusb to list all connected USB devices. Make sure that you configured udev rules for the device
MacOS TBD

Reason 2

Debug adapter's driver was installed incorrecly.

Reported issues

https://github.com/espressif/openocd-esp32/issues/174

Solution

OS Actions
Windows Install driver using IDF Tools Installer
Linux n/a
MacOS n/a

OpenOCD reports 'JTAG scan chain interrogation failed'

OpenOCD log looks like below.

Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...

Reason 1

JTAG wires are connected improperly.

Solution

Check JTAG wires are connection.

Reason 2

Application reconfigured JTAG pins for some other purpose (e.g. SPI or SDMMC).

Solution

If possible make your application using other pins.

Reason 3

JTAG wires are too long.

Solution

Try to use shorter wires for JTAG.

Uploading FW via JTAG does not work

OpenOCD log at startup looks like below.

WARNING: ESP flash support is disabled!
WARNING: ESP flash support is disabled!

Reason 1

Flash support is disabled becasue it has not been implemented for that chip yet.

Solution

Flash FW over UART.

Reason 2

Flash support is disabled via OpenOCD command line by option -c 'set ESP_FLASH_SIZE 0'.

Solution

Flash FW over UART.

GDB reports 'unrecognized item "timeout" in "qSupported" response'

GDB output looks like below.

Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Remote replied unexpectedly to 'vMustReplyEmpty': PacketSize=4000;qXfer:memory-map:read+;qXfer:features:read+;qXfer:threads:read+;QStartNoAckMode+;vContSupported+

Reason

OpenOCD becomes unrespnosive due to:

Solution

Possible solutions:

  • Increase GDB remote timeout.
  • Increase debug adapter speed by adding -c adapter_khz XXX at the end of OpenOCD command line or change it in config file

Non-Espressif Debug Adapters

TBD

Chip-Specific Issues

OpenOCD reports flasher stub running problem (for chips with memory protection)

OpenOCD log like below.

Error: Hart is not halted!
Error: Failed to wait algorithm (-4)!
Error: Algorithm run failed (-4)!
Error: Failed to run flasher stub (-4)!
Warn : Failed to get flash mappings (-4)!
Error: Abstract command ended in error 'exception' (abstractcs=0x10001302)
Error: Timed out after 5s waiting for busy to go low (abstractcs=0x10001302). Increase the timeout with riscv set_command_timeout_sec.
Error: Failed to write stub section!
Error: Failed to run flasher stub (-4)!
Error: Abstract command ended in error 'exception' (abstractcs=0x10001302)
Error: Timed out after 5s waiting for busy to go low (abstractcs=0x10001302). Increase the timeout with riscv set_command_timeout_sec.
Error: Failed to write stub section!
Error: Failed to run flasher stub (-4)!
Error: Failed to probe flash, size 0 KB
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected

Reason

Flasher stub fails when memory protection is enabled.

Solution

Need to reset chip after OpenOCD is run and before GDB connects to it or disable memory protetion in project settings

Application Level Tracing fails RISCV chips

OpenOCD log at startup looks like below.

Error: Failed to get max trace block size!
Error: Failed to init cmd ctx (-4)!

Reason

For Espressif RISCV chips you need to reset target after OpenOCD is connected in order to trigger apptrace control info transfer from target to OpenOCD. It is done by invoking special syscall when apptrace is initialized on the target during startup.

Solution

Reset chip after OpenOCD is connected.

ESP32-C3 and ESP32-S3 builtin USB_JTAG gets stuck after HW reset

OpenOCD log after target HW reset looks like below.

Error: esp_usb_jtag: usb sent only 0 out of 31 bytes.
Error: missing data from bitq interface
Error: esp_usb_jtag: usb sent only 0 out of 50 bytes.
Error: missing data from bitq interface
Error: Failed to exec JTAG queue!
Error: Failed to read debug stubs address location (-104)!

Reason

This is known issue.

Solution

Is by 9e06f3e commit.

ESP32-S3 flash access problem using builtin USB_JTAG

OpenOCD log looks like below when flash is accessed (e.g. upon GDB connect).

Error: esp_usb_jtag: usb sent only 0 out of 31 bytes.
Error: missing data from bitq interface
Error: esp_usb_jtag: usb sent only 0 out of 50 bytes.
Error: missing data from bitq interface
Error: Failed to exec JTAG queue!
Error: Failed to read debug stubs address location (-104)!

Reason

This is known issue.

Solution

Workaround is to use external JTAG adapter or run OpenOCD with disabled flash support with option -c 'set ESP_FLASH_SIZE 0'.

ESP32-C3 'JTAG_SEL_ENABLE' efuse does not work in silicon rev3

This is kbown issue of rev3 silicon. https://github.com/espressif/esp-idf/issues/7836

Clone this wiki locally