What does the wiring between the ST-Link and your MCU look like? Are you using a 10-pin connector with all 10 wires connected, or are you using a setup with 4 pins only? How do you power your board – through the ST-Link or with a separate power supply (e.g. via USB connection to board)?