Unable to flash STM32 device with ST-Link v2 and Mbed Studio

I haven’t been using Mbed Studio for a while and when I opened it in Windows 11 I was able to compile and flash my STM32F103RB target via the ST-Link v2 clone, so far so good.

However I noticed that the notification for “installing tools” was not disappearing after a long time. I reopened the app and it was still there. Finally I’ve decided to reinstall it, the notification disappeared, but now I’m unable to flash after clicking “run”. It compiles just fine though. This is the error I’m getting:

0000761:WARNING:common:STLink and CMSIS-DAPv2 probes are not supported because no libusb library was found.
0000761:CRITICAL:__main__:No backend available
Traceback (most recent call last):
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\__main__.py", line 402, in run
    self._COMMANDS[self._args.cmd](self)
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\__main__.py", line 568, in do_flash
    options=convert_session_options(self._args.options))
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\helpers.py", line 237, in session_with_chosen_probe
    unique_id=unique_id,
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\helpers.py", line 138, in choose_probe
    allProbes = ConnectHelper.get_all_connected_probes(blocking=blocking, unique_id=unique_id)
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\helpers.py", line 82, in get_all_connected_probes
    allProbes = DebugProbeAggregator.get_all_connected_probes(unique_id=unique_id)
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\probe\aggregator.py", line 58, in get_all_connected_probes
    probe = cls.get_probe_with_id(unique_id, is_explicit)
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\probe\picoprobe.py", line 337, in get_probe_with_id
    probes = PicoLink.enumerate_picoprobes(unique_id)
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\probe\picoprobe.py", line 108, in enumerate_picoprobes
    return [PicoLink(probe) for probe in core.find(find_all=True, custom_match=FindPicoprobe(uid))]
  File "c:\ProgramData\Mbed Studio\mbed-studio-tools\python\lib\site-packages\usb\core.py", line 1299, in find
    raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available

The version I had before was the 1.4.4, the current one is still 1.4.4, here’s a snapshot of the tool versions:

Flashing the generated bin file with other tools like ST-Link Utility works as expected.

Any help will be welcomed! Thanks in advance :slight_smile:

EDIT:

Ok, so apparently having OpenOCD installed (downloaded the binaries and added the folder to PATH in Windows) was interfering with Mbed Studio (pyOCD) for some reason. I deleted the binaries, removed the folder from PATH and now I’m able to flash my device again from Mbed Studio.