ST-Link connection suddenly stops responding
It seems that in the HAL project the SYS / Debug was not set to Serial Wire (this is not default).

However, the first time it was possible to debug, but not afterwards anymore. The reason is that the JTAG/SWDIO is disabled during the application. When it is disabled, even a connection is hard to make.

What worked:


Set BOOT0 to 1
Keep Reset button pressed
Remove / Erase Chip
Restart debugging