AnsweredAssumed Answered

Setting RTC calibration output crashes STM32L1 discovery

Question asked by Chris152 on Jul 19, 2016
Latest reply on Jul 19, 2016 by FTITI.Walid
Hello, I'm working with an STM32L152C discovery trying to get the RTC to output a calibration signal. When configured to output a 512Hz signal it works as expected, however when set to output 1Hz, the processor crashes and appears to get stuck in some sort of constant resetting loop. I have a timer interrupt set to trigger every second and output an incremented variable via the USART. The interrupt still triggers but the variable remain at their default value. Any sort of debugging during this period isn't possible. After a hard reset, the debugger (ST-Link via IAR) fails to read the CPUID. I've ran into this issue using HAL and straight CMSIS, and have tested two boards and got the same result. Please help. Here is the code I'm using below with PreDiv_A = 127, PreDiv_S = 255 and RTCCLK = 32.768kHz.

  RTC->CR |= (1 << 19);
  RTC->CR |= (1 << 23);

I can confirm that the bits are being set correctly, but after that it all goes crazy.

Thanks in advance.

Outcomes