As long as power is stable, RAM contents will remain unchanged. Fixed locations can be used for flags/values that persist across soft resets. What you do have to be concerned about is the C runtime initialization sequence overwriting your variables. Generally, to make this work, you need to do a few things: 1. Fix the location of the variables in RAM. 2. Mark them as No-Init (varies by toolchain) 3. Have a way of knowing good data from bad data (such that might occur with a brownout or hard power reset)
↧