2021-06-01 08:01 PM
The HAL RTC initialization routines for the STM32F476 unconditionally reset the clock to
January 1, 2000. I have a battery backup for the clock and do not want the clock reset on initialization.
Has anybody found a way to do this within the CubeMX framework?
Solved! Go to Solution.
2021-06-01 08:16 PM
Within MX_RTC_Init, exit the function if the RTC is already configured
/**
* @brief RTC Initialization Function
* @param None
* @retval None
*/
static void MX_RTC_Init(void)
{
/* USER CODE BEGIN RTC_Init 0 */
if (already configured and running) {
return;
}
/* USER CODE END RTC_Init 0 */
...
.
2021-06-01 08:15 PM
Sorry folks. I'm using a STM32F429, and NOT STM32F476.
2021-06-01 08:16 PM
Within MX_RTC_Init, exit the function if the RTC is already configured
/**
* @brief RTC Initialization Function
* @param None
* @retval None
*/
static void MX_RTC_Init(void)
{
/* USER CODE BEGIN RTC_Init 0 */
if (already configured and running) {
return;
}
/* USER CODE END RTC_Init 0 */
...
.
2021-06-01 08:38 PM
You're correct. I overlooked those user code blocks. Thanks.