Hi Antoine,
I met the same issue.
The clock source should be selected by OSC32KSEL(19-18 bits) of SIM_SOPT1 (page 194 of KL25 Sub-Family Reference Manual). But it doesn't work. For each set of multiplekser the RTC_CLKIN source is selected.
Let me know if someone has better observation.
Regards,
Marcin
my code compiled by mbed.org:
printf("\rSOPT1:0x%.8x:0x%.8x\r",SIM,SIM->SOPT1);
SIM->SOPT1 &= ~SIM_SOPT1_OSC32KSEL_MASK;
SIM->SOPT1 |= SIM_SOPT1_OSC32KSEL(3); //LPO 1kHz
printf("\rSOPT1:0x%.8x:0x%.8x\r",&(SIM->SOPT1),SIM->SOPT1);
printf("SIM_SOPT1_OSC32KSEL_MASK:0x%.8x\r",SIM_SOPT1_OSC32KSEL_MASK);
printf("SIM_SOPT1_OSC32KSEL(3):0x%.8x\r",SIM_SOPT1_OSC32KSEL(3));
printf("SIM_SOPT1_OSC32KSEL(2):0x%.8x\r",SIM_SOPT1_OSC32KSEL(2));
as work around I drived the RTC_CLKIN by external source or PWM.