ST-LINK error: "The interface firmware FAILED to reset/halt the target MCU"

Then try to use the built-in bootloader accessible over UART1, as explained here.