STLINK V2 disconnects in the STLink Utility
Had a very similar issue with an ST-link that connected to the target device intermittently and then not at all. Ended up being a failed 22R resistor withing the ST-LINK/V2 that goes to the header. I Did a track cut to bypass the faulty resistor part (as it is a multi resistor device) and linked in a new through hole 22R resistor and all is good again. The mentioned resistor RS1 links directly to SWDIO (pin 7) on the header and is just one resistor within the multiple resistor SMT device.
You can cut the track linking the resistor RS1 to U7 and the apply the new resistor directly between U7 and the Header. For reference: The resistor in question and the required pin on U7 also links to pin 19 on the IC U2
Anyway the resistor might be worth checking if you have exhausted other options... worked for me, may have been an isolation issue.