aja said:I’ve made another short cable but this time using the speed sensor cable end; identical problem; this is a total waste of time . As lots of people have done this successfully there’s something I’m not doing right; what can it be?
I soldered connections onto the speed sensor cable so that it could be connected to the ST LINK V2. My cable is about 10-11cm long. I also made a 9cm then cut it down to 5cm home made cable before I bastardised the speed sensor cable. 4 wires including 5V for power are connected.
I have Windows VM running.
I open up the ST Visual programmer application.
I plug in the ST LINK V2 to the USB already plugged in to the TSDZ2. A blue light shines on the ST LINK V2.
I click on the USB bar in Windows and select the ST LINK V2
I select STM8S105x6 (I have also tried the x4 variant; makes no difference).
Port: USB; Programming mode SWIM.
I then try to read the controller by pressing Read all tabs: I then get the following error:
Cannot communicate with device!
Check 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 SEIM clock divider. Try now to Switch off and on the application power supply while NRST reset pin is forced low.
The light alternates from blue to red a couple of after the error pops up then goes red.
Where am I going wrong?
To anyone who is struggling with this issue of "Cannot communicate with device!" in the ST Visual Programmer while trying to "read all tabs (on active sectors if any)" I would like to share my experience of overcoming this issue.
While google and reading I've concluded that this problem arises from the long communication wires (i've seen people making as short as 5 cm wire between StLink and the motor speed sensor connections, some even were directly soldering wires to the motor controller). Well after my first attempt failed (I've been using a USB type StLinkv2 for programming (https://imgaz2.staticbg.com/thumb/large/oaupload/banggood/images/A6/A7/fa2d5c18-1122-43de-93a6-4358ac72bf5e.JPG)) I've went and bought a StLinkV2 programmer/debugger (a cheap knock-off from China that I've bought a local store for 7.5 EUR (https://lt.farnell.com/productimages/standard/en_GB/1892523-40.jpg)). After connecting it to TSDZ2 I was still receiving error "Cannot communicate with device!". After that I did some more googling and came across a solution that worked for me. I'm posting some links below to the wiring diagram that helped me to flash the firmware with no errors using the StLink programer/debugger (not he USB dongle, but he copy of STMicroelectronics one):
1) StLink side wiring (note I did not care for colors of the wires as long as they helped me separate the connections):
https://i.imgur.com/BH3Z2D1.jpg
2) TSDZ2 side wiring:
https://i.imgur.com/AdVpVD6.jpg
3) If someone is interested in how long was my wire connections, here are the image for that:
https://i.imgur.com/FSuzVlD.jpg
Hope this helps to anybody who is the same situation that I was