Once the OP understands what is a clock MUX and how to configure a clock MUX in the CubeMX clock view, he can help himself. It's simple enough and CubeMX will tell you if one of the output clocks is out of range and it can resolve such issues all by itself.
For a beginner understanding the STM32 clock generators to the point where he needs "some lines of code" can take a lot of time, even if born as "reader of manuals".
Regards, Dieter