• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/04-Jan-2025-3024

src/04-Jan-2025-5133

CMakeLists.txtD04-Jan-2025234 96

README.rstD04-Jan-20251.2 KiB4229

prj.confD04-Jan-202527 21

sample.yamlD04-Jan-2025224 98

README.rst

1.. zephyr:code-sample:: stm32_backup_sram
2   :name: Backup SRAM
3
4   Use Backup SRAM to store a variable that persists across power cycles.
5
6Overview
7********
8
9Multiple STM32 microcontrollers have a small backup SRAM that can be used as a
10NVM when VBAT pin is supplied with a voltage source, e.g. a coin button cell.
11
12This example shows how to define a variable on the Backup SRAM. Each time the
13application runs the current value is displayed and then incremented by one. If
14VBAT is preserved, the incremented value will be shown on the next power-cycle.
15
16.. note::
17
18    On most boards VBAT is typically connected to VDD thanks to a jumper.
19    To exercise this sample with an independent VBAT source, you will need to
20    remove the jumper.
21
22Building and Running
23********************
24
25In order to run this sample, make sure to enable ``backup_sram`` node in your
26board DT file.
27
28.. zephyr-app-commands::
29   :zephyr-app: samples/boards/st/backup_sram
30   :board: nucleo_h743zi
31   :goals: build
32   :compact:
33
34Sample Output
35=============
36
37.. code-block:: console
38
39    Current value in backup SRAM: 11
40    Next reported value should be: 12
41    Keep VBAT power source and reset the board now!
42