2024-01-22 08:07 AM
After connecting to a X-NUCLEO-LPM01A board for power consumption test , RTC init will not end.
Stuck in this while loop:
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)
{
return HAL_TIMEOUT;
}
}
Current solution: I have to program some example using stm32wbIDE, only that fixes it and I can now use my FW.
2024-01-23 06:15 AM
Hello @DS.4 ,
Make sure the RTC APB clock is enabled by checking the RTCAPBEN bit field , this could be due to some missing steps in the configuration of RTC and its clock source . This is just a guess if this does not resolve your issue i need further details on your configuration to help you solve this problem.
BR
2024-01-23 06:18 AM
I will check that,
Weird thing is even after aligning my init process to that of the example, it still won't work.
I still have to program the example and later my code.
2024-01-23 08:09 AM
Please see attached system viewer, RTCAPBEN is EN
2024-01-23 08:27 AM
Hello @DS.4 ,
Note that The RTC Initialization mode is write protected,you need to use
__HAL_RTC_WRITEPROTECTION_DISABLE() before calling this function.
BR
2024-01-23 01:11 PM - edited 2024-01-23 01:11 PM
Thanks, but I am actually doing that, ( the HAL is doing that for me to be precise)
i haven't changed the HAL functions, and using HAL_RTC_Init as is.
Any other flags that might be of help?