I am trying to change RTC->PRLH and RTC->PRLL.
The second WHILE hangs.
I keep re-reading the same paragraph in the STM32F101xx reference manual (UM0306, CH8), but I can't see what I am doing wrong.
Preceding code has enabled APB1 at much more than 4x 32kHz.
Commenting out the second WHILE and reading RTC->PRLL later confirms that it has been set as expected.
while((RTC->CRL & RTC_CRL_RTOFF) ==0);
while((RTC->CRL & RTC_CRL_RTOFF) == 0);