eclipse openocd **错误:libusb_open() 失败,LIBUSB_ERROR_NOT_SUPPORTED**
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41066653/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
openocd **Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED**
提问by Raph9023
I am trying to setup a eclipse development environment to work with stm32f303 nucleo 32 board. http://www.st.com/en/evaluation-tools/nucleo-f303k8.html
我正在尝试设置一个 eclipse 开发环境来使用 stm32f303 nucleo 32 板。 http://www.st.com/en/evaluation-tools/nucleo-f303k8.html
So far, the all the tools seems to be correctly installed and working: I have succefully compiled and started openocd debugger for stm32f4 discovery and when I connect stm32f303 nucleo 32 board and start openocd, the led on the board indicates that it is connected. (I have flashed the board.)
到目前为止,所有工具似乎都已正确安装并正常工作:我已成功编译并启动了用于 stm32f4 发现的 openocd 调试器,当我连接 stm32f303 nucleo 32 板并启动 openocd 时,板上的 LED 指示已连接。(我已经刷了黑板。)
The thing is openocd get lost when I do step by step debugging and this seems related to the message openocd gives me when started (look for bold line):
当我逐步调试时,问题是 openocd 丢失了,这似乎与 openocd 开始时给我的消息有关(查找粗线):
Open On-Chip Debugger 0.9.0 (2015-05-19-12:09)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
**Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED**
Info : STLINK v2 JTAG v27 API v2 SWIM v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.239293
Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
Does someone know how to fix usb driver in that case, or it is possible that something else cause the problem?
在这种情况下,有人知道如何修复 USB 驱动程序,还是可能是其他原因导致了问题?
回答by kissste
The OpenOCD distribution includes some libusb drivers, and recommends to run the zadig.exe tool to activate them. This will solve your problem.
OpenOCD 发行版包含一些 libusb 驱动程序,建议运行 zadig.exe 工具来激活它们。这将解决您的问题。
回答by kalmiya
In case you experience this issue on Linux, you have to configure udev rules to work with the device. Find the 99-openocd.rules included with the source distribution of openOCD under Contributions. Connect your ST-Link USB-device and run 'lsusb' from a terminal, it will list something like this:
如果您在 Linux 上遇到此问题,则必须配置 udev 规则才能使用该设备。在“贡献”下找到 openOCD 源分发中包含的 99-openocd.rules。连接您的 ST-Link USB 设备并从终端运行“lsusb”,它会列出如下内容:
Bus 004 Device 009: ID 0483:3748 STMicroelectronics ST-LINK/V2
Bus 004 Device 009: ID 0483:3748 STMicroelectronics ST-LINK/V2
Notice the value behind ID, you want to check the 99-openocd.rules to see if there is a matching entry supporting the device, in the above case it's this one:
注意 ID 后面的值,您要检查 99-openocd.rules 以查看是否有支持该设备的匹配条目,在上述情况下是这个:
# STLink v2
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="664", GROUP="plugdev"
Copy this file to your /etc/udev/rules.d configuration directory and reboot your machine. Then try debugging again.
将此文件复制到您的 /etc/udev/rules.d 配置目录并重新启动您的机器。然后再次尝试调试。

