We're trying to make our device automatically recover after a brown-out or brief power loss. I'm hoping to leave a system-state value in a RAM location and check for it on boot-up.
Is there a persistent register I can use to store a state value between resets? The GPREGRET registers are cleared on a hard reset. I believe RAM is all zeroed on boot-up. Or is there a way to prevent some RAM locations from being reset during the start-up process?
I could store the app state in the FDS, but I feel like that would thrash the FLASH over the product's life cycle. Starting the FDS also requires substantially booting the system. That hurts our power budget.
I'm using the Segger toolchain.
Thanks!