This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This might also work for other STM32 chips. I use the HAL, so it also might be supported by your chip. | |
To use the Backup SRAM (most of the time 4 Kb), you need to add a backup power source (like a battery or a supercap) | |
to the VBAT pin of your STM32. I use a simple CR2032 battery. | |
Use following code to get access to the Backup SRAM: | |
__HAL_RCC_PWR_CLK_ENABLE(); | |
HAL_PWR_EnableBkUpAccess(); | |
__HAL_RCC_BKPSRAM_CLK_ENABLE(); |