I have a similar problem and hope someone can help.
Background: This is the third time in 2.5 years that my TSZD2b/860c/OSF setup has crashed. Like the prior two times, the screen will start but get stuck on the startup screen with a message "error brakes or coms." The prior two times, the solution was to reflash the option byte file via STVP by connecting the computer to the motor via the speed sensor cable with an ST-Link cable.
Problem: This time, when I set it up exactly as I have before, the STVP won't connect to the motor. It gives me the following error message over and over (not just once or twice)--the same error I get if I try to run the "read" function (or any other) when there's nothing at all plugged into the cable.
Cannot communicate with the device !
Check the SWIM cable connection and check all the needed pin connections on the SWIM connector.
If the application code uses Swim Disable and Reset pin as Output or has disabled SWIM Clock Divider: Try Now to SWITCH OFF and ON the application Power Supply while NRST Reset pin is forced low.
What I have tried/discovered:
*I uninstalled, redownloaded, and reinstalled the latest version of STVP.
*The ST-Link cable appeared fine. In case it was bad or got fried or something, I bought a new one and connected it to the wires in the 6-pin connector I have. Each of the three wires is conducting (tested by multimeter) from the pin in the bike connector to the end of the cable.
*There is a light on the ST-Link dongle that turns on when I plug it into the computer and the computer recognizes the USB device.
*The cable coming from the motor appears fine. I checked the pins in the cable with a multimeter. Using this image from above as reference--I think mine is wired the same way: red 5V, white Swim and black Gnd. The readings are 4.9V between the black and white; 4.9V or -4.9V, depending on the polarity of the leads, between the red and black; and 0V between the white and red.

*I have tried connecting the wire leads/connectors onto the pins on the ST-Link in every combination--trying both the 5V and the 3.3V pins, trying the RST, etc. I either get the same error as originally or this error:
Error : Cannot communicate with the tool.
Wrong tool selection or check tool power supply or check that a previous session is closed.
I am at a loss. Do you have any advice or what I could try next? Is there anything else I can do short of opening the motor casing and checking the interior components? (which is going to require some bike disassembly) And, I guess, even if I do that, what am I looking for?
Or even any ideas of what kind of professional I need to find to help me out? (none of the bike mechanics I know work on electrical aspects of ebikes at all, and this doesn't even seem to be an electrical wiring problem so much as a computer circuitry problem)
Thanks!