As a Update, I had the same issue.For me, setting the ord to use internal high speed clock solved the problem.It's possible that when powering the board with external source, the ST-Link can't output a stable clock source, before clock configuration ...