I suggest you go into ISP mode, then using Flash Magic erase all flash.
It is possible to download an image into the flash on the target that will then prevent any further debug access or connections. The classic cases of this are:
The image contains code that sets the MCU clocks up "incorrectly".
The image contains code that enables a watchdog timer.
The image contains code that puts the MCU into a very low power mode.
The image contains code that "switches off" some, or all of the multiplexed debug pins (JTAG/SWD).