On Saturday, August 13, 2022 we will be working on the Adafruit Customer Support Forums. If you visit over the weekend and things are not complete yet, please check back later, https://adafruit.com/forumupdates
0

Can't get STLINK V2 to be recognized on Win10
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Can't get STLINK V2 to be recognized on Win10

by marclefevre on Wed Jun 29, 2022 5:57 pm

Hi,
I just got an Adafruit ST-LINK V2 and I'm trying to get it to come up in the CubeProgrammer. I just wanted to check the firmware version to see if it needed updated. I cannot get CubeProgrammer to recognize the STLINK as either a USB device or as an STLINK device. When I first plugged it in, it came up as a USB Serial Bus device in the Device Manager. After following a few leads in other forums, I tried uninstalling the STLINK in Device Manager (checking the box to delete the driver) and disconnecting it. I then installed the STLINK V2 driver from ST Micro. After doing that, it came up as it's own category (STLINK V2) in Device Manager but cube programmer could still not find it. I repeated those steps a couple of times but now the STLINK always comes up as a Universal Serial Bus device.

Questions:
1) Is Cube Programmer the right tool to try to connect to the ST-LINK?
2) IS there a special driver I need?

Thanks,
Marc

marclefevre
 
Posts: 5
Joined: Wed Jun 29, 2022 5:45 pm

Re: Can't get STLINK V2 to be recognized on Win10

by mikeysklar on Thu Jun 30, 2022 3:13 pm

It sounds like you got close with the drivers.

The STM32 Cube Programmer is the right software.

If you are running 64-bit Win10/11 install looks a little trickier, but doable.

https://community.st.com/s/question/0D5 ... dows-arm64

mikeysklar
 
Posts: 8111
Joined: Mon Aug 01, 2016 8:10 pm

Re: Can't get STLINK V2 to be recognized on Win10

by marclefevre on Sat Jul 02, 2022 3:16 pm

I followed what I thought was the solution for my case (windows10) and rebooted into troubleshooting mode and selected "install unsigned drivers" and then installed the unsigned driver that was provided in the link. Windows said it was successful but the STLINK showed up in the "Other devices" folder with a yellow triangle. If I clicked on "update driver" and selected the unsigned driver, windows refused to install the driver (even though I'm still in troubleshooting mode).

So, I'm kind of stuck. I can't be one of just a few people that want to use this tool (ST-LINK V2) on Win10. On what O/S does it just plug and play?

marclefevre
 
Posts: 5
Joined: Wed Jun 29, 2022 5:45 pm

Re: Can't get STLINK V2 to be recognized on Win10

by mikeysklar on Tue Jul 05, 2022 1:27 pm

Just to confirm this is the driver you are trying to install (v2.0.2) STSW-LINK009:

https://www.st.com/content/st_com/en/pr ... nk009.html

It claims 32bit / 64bit compatibility with Win10.

Screen Shot 2022-07-05 at 10.06.57 AM.png
Screen Shot 2022-07-05 at 10.06.57 AM.png (33.45 KiB) Viewed 149 times


There is a weird order of operations issue between the driver and STLink utility which can require multiple installs. This video has some tips:

https://youtu.be/Sa48sPObmJ0?t=90

mikeysklar
 
Posts: 8111
Joined: Mon Aug 01, 2016 8:10 pm

Re: Can't get STLINK V2 to be recognized on Win10

by marclefevre on Tue Jul 05, 2022 2:29 pm

Yes, that is the version I am installing. I unzip it and run the "stlink_winusb_install.bat" batch file as administrator. It asks for permission and installs 3 files/drivers (the window is too small to see the details and is not re-sizeable). After that, I plug in the stlink and device manager shows it. However, the cube programmer does not see it either as an st-link or as a usb device. I have done these same steps 3 or 4 times now with the same results.

I watched that video before and did not find it helpful. The installation he used did not seem to start with a batch file as I think he was installing the old st-link utility (prior to cube programmer).

The driver version that shows up in device manager properties for the st-link is 2.2.0.0.

I wonder whether it would be worth trying to get the old utility and install it. Another guess is that maybe there is a registry entry somewhere that needs to be reset.

marclefevre
 
Posts: 5
Joined: Wed Jun 29, 2022 5:45 pm

Re: Can't get STLINK V2 to be recognized on Win10

by marclefevre on Tue Jul 05, 2022 2:39 pm

Just for fun, I uninstalled CubeProgrammer and uninstalled the st-link device from device manager along with its driver.

I then downloaded CubeProgrammer from STMicro and installed it. It installed driver version 2.1.0.0 but does not recognize the device as before. I uninstalled that device and its driver and re-installed driver version 2.2.0.0 and am now back where I started with CubeProgrammer not recognizing the device.

marclefevre
 
Posts: 5
Joined: Wed Jun 29, 2022 5:45 pm

Re: Can't get STLINK V2 to be recognized on Win10

by mikeysklar on Tue Jul 05, 2022 3:13 pm

I read through the st.com forum answers after searching for STSW-link009. There were quite a few folks having the same issue you have encounterd with STLINK v2 and WIN10.

https://community.st.com/s/global-search/stsw-link009

It looks like the best answer is to use the latest libusb.

It seems the culprit is libusb. After reading similar posts, I decided to try the latest libusb.



I went out and downloaded the latest libusb 1.0.24 from /libusb-1.0/libusb-1.0.24/libusb-1.0.24.7z and copied the libusb-1.0.dll from the MinGW32\dll folder into the st-link-server folder "C:\Program Files (x86)\STMicroelectronics\stlink_server", kill the stlinkserver.exe process in task manager, and that did the trick!



Now my STM32CubeIDE 1.6.1 can see the debug probes using either the ST-LINK (ST-LINK GDB server) or ST-LINK(OpenOCD) probe options.


https://sourceforge.net/projects/libusb ... z/download

mikeysklar
 
Posts: 8111
Joined: Mon Aug 01, 2016 8:10 pm

Re: Can't get STLINK V2 to be recognized on Win10

by marclefevre on Tue Jul 05, 2022 3:40 pm

Thanks for the pointer. That scenario doesn't seem to match mine. I don't have a stlinkserver folder in ProgramFiles(x86)\STMicroelectronics. If I go over to ProgramFiles\STMicroelectronics I find the STM32Cube folder and STM32CubeProgrammer below it. Those folders don't have a stlinkserver in them. Further, I don't see where to put the libusb-1.0 dll file where it would make a difference.

marclefevre
 
Posts: 5
Joined: Wed Jun 29, 2022 5:45 pm

Re: Can't get STLINK V2 to be recognized on Win10

by mikeysklar on Wed Jul 06, 2022 8:02 pm

I'm out of guesses. This would probably be a good time to open a thread on the st.com forum.

https://community.st.com/s/

There is MacOS and Linux support, but you would probably prefer to do all your development on Win10.

mikeysklar
 
Posts: 8111
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.