2017-11-30 03:35 AM
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-ram2017-11-30 07:19 AM
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).
2017-11-30 07:49 AM
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.