Stop STM32 from rerunning code when repowered
I am using an STM32H753I-EVAL2. I have the real-time clock(RTC) counting. I want it to be set to the current time. I am successfully able to do this inside of MX_RTC_Init() with:
RTC_TimeTypeDef sTime = {0};
sTime.Hours = 0x11;
sTime.Minutes = 0x22;
sTime.Seconds = 0x33;
if (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK) {
Error_Handler();
}I configured the H7 such that the RTC continues to count when the main power is disconnected, through VBAT. The issue is that STM reruns all of the code when it is repowered, causing the time to be reset to where it started. Is there any way to avoid it rerunning all code? Thanks
