Troubleshooting Common OpenOCD Problems
This page provides troubleshooting instructions for common OpenOCD problems that you may encounter with VisualGDB.
Couldn’t bind to TCL socket
Sometimes OpenOCD fails to start with the following error:
Error: couldn't bind tcl to socket on port 6666: |
This happens when OpenOCD is not able to listen for incoming scripting connections on its default port. You can solve this by manually adding the following textat the beginning of the OpenOCD command line:
-c "tcl_port 10240" |
If you still get errors, try replacing 10240 with another number between 1024 and 65535.
Open Failed
Sometimes OpenOCD would fail to start the debug session displaying the “Error: Open Failed” message. It typically happens when the debug adapter (e.g. ST-Link) returns an error code and usually indicates problem with wiring, power, or JTAG pins. You can obtain more information about whereabouts of the problem by enabling the “Show debug output from OpenOCD” checkbox:If nothing helps, try erasing the target’s FLASH memory using a different tool (e.g. ST-Link Tool) or using a different debug probe.
No Device Found / LIBUSB_ERROR_NOT_SUPPORTED
Another reason for the “Open Failed” message could be a missing USB driver. This may also result in the LIBUSB_ERROR_NOT_SUPPORTED message. If this happens, make sure you are using the USB Devices view in Debug Settings so that VisualGDB can automatically check/install the USB drivers:Warning: Security settings on some computers may prevent VisualGDB from installing the WinUSB driver for your JTAG probe automatically. If this happens, try installing them manually as shown in the OpenOCD documentation or using the open-source Zadig tool.
JTAG Scan Chain Interrogation Failed
Another common type of OpenOCD error is the one shown below:
Error: JTAG scan chain interrogation failed: all ones Error: Check JTAG interface, timings, target power, etc. Error: Trying to use configured scan chain anyway... |
Another variant:
Error: init mode failed (unable to connect to the target)
It means that OpenOCD has managed to connect to the JTAG probe (i.e. the USB driver is working correctly), however the debugged device did not respond. The typical causes of this problem are:
- Incorrect wiring (e.g. some JTAG pins are not connected)
- Power issues (the device is not running or is constantly reset)
- Device configuration issues (the device has disabled the JTAG pins or entered deep sleep mode)