2016-07-19 01:47 AM
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. #stm32l152 #stm32l #discovery #stm32l1-rtc2016-07-19 02:56 AM
Hi Chris152,
Try to follow the recommendation described in the application note ''Using the STM32 hardware real-time clock (RTC)'' ; in both following parts: ''1.4 RTC coarse calibration part'' ''1.9.1 RTC_CALIB output'' . -Hannibal-