I wish to use the MCU flash for storing non-volatile information such as tuning parameters. Is there a known 'best' policy of when to store these values...i find a few options and would like to get your view on them. a) Run a task for writing parameters to flash b) Write to flash during shutdown routine. (but what happens if a sudden shutdown happens)
Also, how to decide whether parameters should be read from flash or from the default code. Once a parameter is changed by the user (it is different from the default value), every following init will need to read those parameters from the flash...right? I want to know how the experienced folks deal with these issues?
Thanks and best regards, Vishal Sapre