2016-02-17 0:36 GMT+01:00 Niklas Hauser <niklas.hauser@rwth-aachen.de>:
However, there are some _significant_ drawbacks with this solution: 1. __persistant_start can change at any time. Can be easily fixed by setting it to a fixed address though. 2. If you have multiple symbols in this section, their order is not guaranteed. 3. the .persistent section would be overwritten on every programming. Not that useful for persistency.
In short: Don’t do it this way
Actually this seems like an ok solution for me. What I tought is to put all data that needs persisting into a struct, and save that to the flash. I would only rarely write to it (when turning off the device), that way I think I can get away with the limited rewriteability of the flash. (Let's say it's turned off every day in every year, which is really an overestimation. Then it would last for at least 10000/365 ~ 27 years.) Also, losing the data on reprogramming is not an issue, this is just to store settings.