I would like to share a solution to a problem.
What happened?
I had launched the .cfg in the OCD and I had the following message:
► Show Spoiler
I did not know the reason, I tried to modify the .cfg, I tried to reinstall usb drivers, I tried to lauch with different .cfg....but nothing changed and at the end I was very sad as I tought I had broken three discovery boards.
But the microcontrollers were still working, leds were blinking as they were supposed to do, anyway I was unable re-flash them.
The problem was that I used PA13 and PA14 as output pin and those pin were reserved for the JTAG! For this reason the code was working but the microcontrollers were unable to communicate with OCD.
SOLUTION (PROBABLY NOT THE BEST ONE)
Keep the reset button pressed, then lauch the .cfg (the operation will be successful), then try to flash the microcontroller, this operation obviously
will not succed, but the old firmware will be erased and the JTAG pins will be free again.
And then it will be possible to lauch again the .cfg