zephyr/samples/boards/stm32/backup_sram
Thorsten Spätling 486d109e7e dts: stm32h5: Add backup sram DT node to STM32H56xx
I also added an overlay file for the nucleo_h563zi board to the
samples/boards/stm32/backup_sram example.

Signed-off-by: Thorsten Spätling <thorsten.spaetling@vierling.de>
2024-06-12 14:30:45 +03:00
..
boards dts: stm32h5: Add backup sram DT node to STM32H56xx 2024-06-12 14:30:45 +03:00
src samples: stm32: backup_sram: Fix main function return statement 2023-04-17 20:19:19 +09:00
CMakeLists.txt cmake: increase minimal required version to 3.20.0 2021-08-20 09:47:34 +02:00
prj.conf samples: boards: stm32: add backup SRAM sample 2021-02-15 08:04:24 -05:00
README.rst doc: fix :zephyr-app: paths 2023-07-17 16:51:16 -04:00
sample.yaml samples: boards: stm32: add backup SRAM sample 2021-02-15 08:04:24 -05:00

.. _stm32_backup_sram:

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 exercise this sample with an independent VBAT source, you will need to
    remove the jumper.

Building and Running
********************

In order to run this sample, make sure to enable ``backup_sram`` node in your
board DT file.

.. zephyr-app-commands::
   :zephyr-app: samples/boards/stm32/backup_sram
   :board: nucleo_h743zi
   :goals: build
   :compact:

Sample Output
=============

.. code-block:: console

    Current value in backup SRAM: 11
    Next reported value should be: 12
    Keep VBAT power source and reset the board now!