I had two peculiar programming issues
1. Serial programming works (Demonstrator GUI ) sometimes connects , some times it wont . I found a pattern
a. Set Boot0 jumber to 3.3V
b. First connect the USB-UART to PC
c. Then power ON STM32 device
this times it works ... the other way that is connecting STM32 First & USB-UART Second is not working
2.SWD is not connecting ... (ST Link Utility )
you might have accidentally not selected Serial Wire Debug option under STM32Cubemx.
That will disable further debugging , only option to recover is
Set Boot0 jumber 3.3V & program the software that enabled serial Wire debug option.