2026-03-25 5:12 AM
Could I erase rtc backup registers with STM32CubeProgrammer ?
Solved! Go to Solution.
2026-03-31 6:02 AM
... and, to be able to write into PWR registers, you have to set RCC_APB1ENR.PWREN first... :)
JW
2026-03-26 12:43 AM
Yes, it is possible, but not via the standard mass erase in STM32CubeProgrammer.
For STM32L010/L07x/L08x you have two practical options:
Program and run the following HAL code once; this clears all RTC backup registers:
__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_BACKUPRESET_FORCE();
__HAL_RCC_BACKUPRESET_RELEASE();
HAL_PWR_DisableBkUpAccess();
Only if both VDD and VBAT are completely removed will the backup registers be lost automatically.
Does that answer your question?
Regards
/Peter
2026-03-31 5:23 AM
2026-03-31 5:44 AM
I don't use CubeProgrammer, but I believe you still need to enable the backup-domain access by setting PWR_CR.DBP before trying to overwrite the backup registers.
JW
2026-03-31 5:52 AM - edited 2026-03-31 5:55 AM
2026-03-31 6:02 AM
... and, to be able to write into PWR registers, you have to set RCC_APB1ENR.PWREN first... :)
JW
2026-03-31 8:25 AM
Thank you, That is worked.