ST-Link V2 Error: "Can not connect to target"
I have been trying to share some of my helpful experiences with you which I faced in the electronic and programming field and provide some viable solutions since I feel it would help and save your time. A couple of days ago, I was struggling with ST-Link V2 to program an ARM microcontroller (STM32F103C8T6). This is the error message that I got when I tried to connect to the microcontroller:
"Can not connect to target"
I checked everything multiple times, and they seemed it was connected correctly, However it was not able to connect to the target microcontroller. At the end of the day, I opened the programmer casing curiously and all of a sudden, there was the name of the pins programmer on the PCB as well, I compared the PCB pin names with the cover pin names, the interesting thing was that they could not match !!!!!
There was something wrong with the pin names, which were labeled on the casing, and real pin names that were connected to the PCB, Finally I connected the programmer to ARM microcontroller based on PCB pin names and not the cover pin names, and it ultimately, worked correctly !!!!