Re: save memory into backup ram

"Tom Collins tom-lnEA/wrDJtNWk0Htik3J/[email protected] [rabbit-semi]" <[email protected]> Fri, 2 Sep 2016 14:40:30 -0700
Newsgroups gmane.comp.hardware.rabbit-semiconductor
Message-ID <[email protected]>
On Sep 1, 2016, at 11:53 AM, [email protected] [rabbit-semi] wrote:
> I have some parameters in BL4S200, user will change them from HMI, and I want to save this change, so program can use them after controller power on next time. I find bbram and protected, but I am not very clear how to use it? does anybody give me a sample for that?


Take a look at Samples/RestartVars/BatteryRAM/bbvars.c for an example of using battery-backed RAM to persist variables across reboots.

For configuration information, I prefer to use the UserBlock as mentioned by Mircea:

On Sep 2, 2016, at 12:29 PM, Mircea Neacsu [email protected] [rabbit-semi] wrote:
> You can use writeUserBlock and readUserBlock functions. 
> 
> Normally you would add a checksum to the values you save to verify their integrity. In case of failure you can restore some factory defaults. 


-Tom