All embedded devices includes a "Factory reset" option that allows the user to reset his device if something is wrong.
I am developing a Firmware on an STM32 board. The firmware includes a boot loader that allows to upgrade the application via UART (By sending a binary file that contains the new image) and I want to add another feature: A factory reset. When the user choose this option, the board shall load the original image.
What is a Factory reset? Is it about loading the whole binary file into memory again or it's just calling a function that reinitialize variables modified by the end user?
What are the best practices to do so?
Where to store the original FW? is it in an internal or external flash?