I'm struggling to initialize the RTC on an STM8L051F3 microcontroller. I've used the exact code below on an STM8L151K6 microcontroller with no issues. The code hangs waiting for the LSI clock to be ready. Interrupts are disabled before calling the initialize function. Any ideas on what could be wrong?
// configures the RTC (Low Speed Internal RC is 38 kHz)
// wait for LSI clock to be ready
while(CLK_GetFlagStatus(CLK_FLAG_LSIRDY) == RESET); <------CODE HANGS HERE