What should I do if the computer cannot connect to ST-Link? You can try the following methods one by one.
method 1
Restart the computer.
Method 2
Make sure that your computer driver is installed. If not, you can see the driver installation link below.
http://www.openedv.com/docs/tool/dap/ST-LINKV2.html
If you can see this thing in the device manager, it means it has been installed.
Method 3
Find this software in the installation path. This software can update the firmware of the ST-Link module. ST-LinkUpgrade.exe.
The update here does not necessarily mean an upgrade. It may mean a downgrade to match the computer's keil software.
Click the device link, then click yes to start the update. Reconnect after the update, and you can use it normally.