2015-06-22 02:33 AM
Hello,
HAL_RTC_SetTime
fails when trying to set new values on the RTC due toRTC_EnterInitMode
timeout.while((hrtc->Instance->ISR & RTC_ISR_INITF) == (uint32_t)RESET)
{ if((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE) { return HAL_TIMEOUT; } }During init (MX_RTC_Init
)HAL_RTC_SetTime
is successful.STM32L151RDCubeMX 4.8.0L1 Library 1.2.0LCI RC @ 37kHz configured bySystemClock_Config()
Any clues?Thanks!George2015-06-22 05:16 AM
After some time I figured out that the the RTC Backup domain must be unlocked.
HAL_PWR_EnableBkUpAccess
must be called before calling any RTC set functions.