Closed nerdralph closed 3 years ago
Thanks for reporting this. I'll try to reproduce it.
What version of pyocd—0.28.3? Do you have libusb installed for the version of Python you are using? (I assume so since you said pyocd listed the STLink before the firmware upgrade.)
Yes, I'm using 0.28.3. And yes, libusb is installed. pyocd not only recognized the STlink before the firmware upgrade, but it also communicates fine with the ch551/ch552 CMSIS-DAP adapter I've been working on. https://github.com/nerdralph/ch554_sdcc/tree/master/examples/CMSIS_DAP
$ pyocd list
# Probe Unique ID
---------------------------------------
0 WCH CH55x CMSIS-DAP ?
Unfortunately, I'm not able to reproduce this on macOS or Win10 after updating STLinkV2-1 firmware to the same V2J37M27 version (on an STM32L475VG IOT01A board).
Would you mind running pyocd cmd -vv
? That will include some debug log messages for looking up the device in Windows.
I did some more digging on my end. For Windoze, I'm using Win7E, which may explain the different behavior. 'pyocd cmd -vv' only output "Waiting for a debug probe to be connected...", which got me thinking pyocd isn't getting any results from libusb. When I looked in the device manager, I saw that the upgrade removed the association between ST-Link and libusb. Under Universal Serial Bus devices I could see: "STMicroelectronics STLink dongle". I used Zadig to set the driver for "ST-Link Debug (Interface 0) " to libusb-win32, and now pyocd works fine.
Now that I think about it, being only on Win7 makes sense. STLink uses WinUSB to avoid requiring a kernel driver on Windows, but this is only supported on Win 8 and above.
I tried using a st-link (part of a Nucleo board), and pyocd would list the adapter. If I tried to connect, I got an error saying the firmware was too old. I upgraded to the latest firmware (V2J37M27), and now pyocd can't even find the device. openocd is still able to use the st-link. This is on Win7E.