cancel
Showing results for 
Search instead for 
Did you mean: 

Using the backup SRAM?

Abhishek Kumar
Associate III
Posted on November 30, 2017 at 12:35

MCU: STM32F777II

How can I use the backup SRAM to store non volatile data? Are there any examples?

Is there also way to let the compiler know that this is the area of RAM to use for allocating these variable which I want to store in the backup SRAM?

#stm32-f7 #backup-ram
2 REPLIES 2
Posted on November 30, 2017 at 16:19

How can I use the backup SRAM to store non volatile data? Are there any examples?

See the Reference Manual Section 4.1.5.

Is there also way to let the compiler know that this is the area of RAM to use for allocating these variable which I want to store in the backup SRAM?

Yes, with either some linker script voodoo or a simple overlay structure accessed via a pointer (into Backup SRAM).

Posted on November 30, 2017 at 16:49

It is memory within the addressable space of the processor, consider using pointers and structures to access directly, or memcpy() data in/out.

The memory can be described with linker scripts or scatter files, data/structures can be directed into such regions or sections using attributes. Review the documentation for your compiler and linker.

I would tend to use the pointer/structure method as it is more agnostic to tool-chain issues. Your app would hold default data, check the validity of structures in NVRAM/BKPRAM and copy such data over to replace the defaults. As settings change, the content can then be written back to the backup structure.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..