4 years, 10 months ago.

Saving current state to be used after reboot or reset

We are using a state machine in an embedded device and want to be able to restore its previous state after a warm reboot caused by either a fatal error or the hardware watchdog which triggers the reset pin. Ideally we are looking for a solution that works after both a cold or warm reset. But anything that only works in case of a warm reset is also great

We looked into misusing some of the functions described here to store the current state in a persistent way by logging it as a warning or error (haven't tried yet). Does anyone know a more elegant solution?

Thank you in advance!

Device: Nucleo F446RE mbed version: mbed-os-5.12.4

1 Answer

4 years, 10 months ago.

Hello Mo K,

You can try to use Mbed's NVStore API to save the status of state machine for next reboot.

Accepted Answer

Thanks a lot! Almost ashamed that we didn't find that feature

posted by Mo K 07 Jul 2019