Thanks for the reply. I set the PLL as the first operation.
I solved, the problem was that the PLL1 was not enabled, ie bit 0 (PD) was not clear.
However now it works but I have to skip the wait LOCK phases. In fact, the LOCK bit of PLL1_STAT is never set to 1.
I set the PLL1_CTRL register in several steps, but when I check the LOCK it is always 0.
If I skip the LOCK check the process goes on all the same and everything works.
Attached the function I use.
What could be the problem of LOCK bit?