Slow Clock External Crystal is Not Used - BUG

I followed a simpler way.
Before to use the RTC, I switch to the 32 kHz with this code:

SUPC->SUPC_CR = ((((uint32_t)(0xA5)) << 24) | (SUPC_CR_XTALSEL));

This sets the source clock of the Slow Clock Generator to the external clock (0xA5 is the password that MUST be written into the SUPC_CR register otherwhise the chip won't execute the switch).

The datasheet suggests to wait for the chip changes the source clock by monitoring the change of the OSCSEL bit in SUPC_SR register. when that bit will be set to 1, the chip has done the change. This can be done with this code after the preivous code

while ((SUPC->SUPC_SR & SUPC_SR_OSCSEL) != SUPC_SR_OSCSEL);