2024-05-03 06:08 AM - edited 2024-05-03 06:52 AM
What is the expected RTC peripheral behavior through power cycles on VDD? We have a 3.3V system design with the STM32H562VGT6 right now.
Setup:
Action:
Expected Behavior Through Power-Cycle:
Observed:
Is this expected? Is it possible to keep the RTC counter active & counting through power cycles?
Solved! Go to Solution.
2024-05-29 06:15 AM - edited 2024-05-29 10:13 AM
Thank you for the detail and patience @STOne-32 & @unsigned_char_array, we were able to resolve the situation! Our project was using the LSI within the MSP -
Solution:
void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
{
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
if(hrtc->Instance==RTC)
{
/** Initializes the peripherals clock
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; // <- Originally 'RCC_RTCCLKSOURCE_LSI'
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
/* Peripheral clock enable */
__HAL_RCC_RTC_ENABLE();
__HAL_RCC_RTCAPB_CLK_ENABLE();
}
}
Our IOC file wasn't in-sync with our project; is it supposed to be? Here was the update to apply with the IOC -
Thank you guys!
2024-05-29 10:17 AM
Hi @jreina
Very Glad to see you are able to fix it ! well done. Continue Releasing your Creativity using STM32 ;)
Ciao
STOne-32.