2023-11-20 12:20 AM
hi,
I configure my micro to work on internal clock by cubemx - this is the clock configure:
and this is the RTC init function:
RTC_EnterInitMode() function
HAL_StatusTypeDef RTC_EnterInitMode(RTC_HandleTypeDef *hrtc)
{
uint32_t tickstart;
/* Check if the Initialization mode is set */
if ((hrtc->Instance->ISR & RTC_ISR_INITF) == 0U)
{
/* Set the Initialization mode */
hrtc->Instance->ISR = (uint32_t)RTC_INIT_MASK;
tickstart = HAL_GetTick();
/* Wait till RTC is in INIT state and if Time out is reached exit */
while ((hrtc->Instance->ISR & RTC_ISR_INITF) == 0U)
{
if ((HAL_GetTick() - tickstart) > RTC_TIMEOUT_VALUE)
{
I RECEIVED THE TIMEOUT ERROR HERE:
return HAL_TIMEOUT;
}
}
}
return HAL_OK;
}
I tried everything without success :(
Can anyone help me to understand where the problem is?
Solved! Go to Solution.
2023-11-20 08:54 AM
Hello @aviel,
Try adding HAL_PWR_EnableBkUpAccess() after SystemClock_Config()
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-20 08:54 AM
Hello @aviel,
Try adding HAL_PWR_EnableBkUpAccess() after SystemClock_Config()
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-21 12:20 AM
Hi Sarra,
thank you!
at now its work for me!
for better understanding why need to add this function?