Check your initial conditions. Dump them out, and along the way so people can at least figure out what might be amiss.
Check that HSI is running, and ready, and the source clock. Make sure you mask the CFGR properly when setting HCLK, PCLK1/2 Try using the library code.
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..