-
Notifications
You must be signed in to change notification settings - Fork 132
Troubleshooting FAQ
OpenOCD log looks like the 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 '*'
No debug adapter is connected.
Check that the 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. |
MacOS |
system_profiler SPUSBDataType or brew install lsusb and use lsusb to list all connected USB devices |
Debug adapter's driver was installed incorrectly.
https://github.com/espressif/openocd-esp32/issues/174
OpenOCD log looks like the 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...
JTAG wires are connected improperly.
Check JTAG wires are connected.
ESP32 | ESP32-S2(S3) | ESP32-C2(C3) | |
---|---|---|---|
TDI | GPIO12 | GPIO41 | GPIO5 |
TCK | GPIO13 | GPIO39 | GPIO6 |
TMS | GPIO14 | GPIO42 | GPIO4 |
TDO | GPIO15 | GPIO40 | GPIO7 |
GND | GND | GND | GND |
Application reconfigured JTAG pins for other purposes (e.g. SPI or SDMMC).
If possible make your application using other pins.
JTAG wires are too long or bad.
Try to use shorter wires for JTAG or lower the adapter speed with -c 'adapter speed <speed_in_khz>'
command.
OpenOCD log at startup looks like the below.
WARNING: ESP flash support is disabled!
WARNING: ESP flash support is disabled!
Flash support is disabled because it has not been implemented for that chip yet.
Flash FW over UART.
Flash support is disabled via OpenOCD command line by option -c 'set ESP_FLASH_SIZE 0'
.
Flash FW over UART.
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+
OpenOCD becomes unresponsive due to:
- slow communication with target
- high verbosity of its debug output (enabled with
-d3
)
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 the config file
Error: 113 485 libusb_helper.c:373 jtag_libusb_get_serial(): libusb_get_string_descriptor_ascii() failed with -9
The error code "-9" corresponds to LIBUSB_ERROR_PIPE, which generally indicates that the target can not respond to the OpenOCD command.
Possible reasons for this failure:
- USB Connection Issues: Ensure that the USB cable is properly connected between the host computer and the chip. Check for any physical damage to the USB cable or connectors.
- Driver Issues: Make sure that the appropriate USB drivers are installed for the chip on the host computer. Verify that the USB drivers are up-to-date.
- Power Supply: Insufficient power supply to the chip might lead to USB communication problems. Ensure that the chip is adequately powered.
- Floating bootstrap pins: For some chips (eg. ESP32-C3) floating bootstrap pins can cause USB communication problems. Ensure that the bootstrap pins are not left in the float mode for proper functionality.
There is no unique solution. Check all possible reasons and take action for all.
TBD
Mostly, warnings can be seen in 2 different forms.
Warn : Failed to get flash maps (-8)!
Warn : Invalid magic number in app image!
Warn : Failed to get flash mappings (-4)!
or
Warn : Failed to get flash maps (-6)!
Warn : Application image is invalid! Check configured binary flash offset 'appimage_offset'.
Warn : Failed to get flash mappings (-4)!
The partition table offset is not 0x8000, so flash mappings can not be read from the partition table.
Set application image offset explicitly with the OpenOCD command.
openocd -s <tcl_path> -f <board_config> -c "init; halt; esp appimage_offset <new_app_binary_offset>"
Application is not loaded to flash or unexpected magic number read from the partition table flash location
Load the application and try again.
Set application image offset explicitly with the OpenOCD command.
OpenOCD log at startup looks like the below.
Error: Failed to get max trace block size!
Error: Failed to init cmd ctx (-4)!
For Espressif RISCV chips you need to reset the target after OpenOCD is connected to trigger apptrace control info transfer from the target to OpenOCD. It is done by invoking a special syscall when apptrace is initialized on the target during startup.
Reset chip after OpenOCD is connected.
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)!
Solved by commit.
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)!
This is a known issue.
The workaround is to use an external JTAG adapter or run OpenOCD with disabled flash support with option -c 'set ESP_FLASH_SIZE 0'
.
This is known issue of rev3 silicon. https://github.com/espressif/esp-idf/issues/7836
https://github.com/espressif/openocd-esp32/issues/312
gprof
searches for a .text
section in the compiled binary to generate a report. However, ESP-IDF application ELF files have a .flash.text
section.
To resolve this, replace .flash.text
with .text
using the following command:
xtensa-esp32s3-elf-objcopy -I elf32-xtensa-le --rename-section .flash.text=.text <app.elf>