STM32 Backup SRAM
Overview
Multiple STM32 microcontrollers have a small backup SRAM that can be used as a NVM when VBAT pin is supplied with a voltage source, e.g. a coin button cell.
This example shows how to define a variable on the Backup SRAM. Each time the application runs the current value is displayed and then incremented by one. If VBAT is preserved, the incremented value will be shown on the next power-cycle.
Note
On most boards VBAT is typically connected to VDD thanks to a jumper. To excercise this sample with an independent VBAT source, you will need to remove the jumper.