CubeMX SystemClock_Config is resetting my RTC due to LL_RCC_ForceBackupDomainReset
STM32CubeMX 5.6.1 , Atollic TrueStudio 9.3.0 , MCU is a STM32L053 with VDD wired to a coin cell. LSE is connected to a watch crystal.
The RTC works fine. Going into standby mode works fine. Waking up from standby mode works fine. Checking and resetting the WU flag works fine.
But the RTC does not keep the time or backup registers from the previous session when woken up.
The culprit is found in SystemClock_Config, where
LL_PWR_EnableBkUpAccess();
LL_RCC_ForceBackupDomainReset();
LL_RCC_ReleaseBackupDomainReset();
LL_RCC_LSE_SetDriveCapability(LL_RCC_LSEDRIVE_LOW);
LL_RCC_LSE_Enable();The backup domain is reset and data from the RTC is lost.
Commenting out LL_RCC_ForceBackupDomainReset and LL_RCC_ReleaseBackupDomainReset solves this problem quickly. But, this code is auto-generated by CubeMX
I do not see a way in CubeMX to disable this unnecessary reset. How can I tell CubeMX to not generate code that calls those two functions?
Thanks