Hi Alberto Ferrari,
Did you enable the SSP2 interface power/clock in register PCONP register?
From the user manual, you can get:

So, please check PCONP bit20, did you enable the SSP2 power and clock?
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------