I am developing a firmware that also has an update feature. For that I want to store the current version number of my firmware in ROM so it is retained even after power-off. Then when the user attempts to update the firmware, the program loads the current version number from ROM and compares it to the one provided by the user. It the user provided firmware is newer, the firmware is updated. My question is, how can I tell the compiler to store the global version number variable in ROM. I am using Keilv5.20 with an ARM compiler.
Update: The variable has to be a non-constant because if the user provides a newer version of the firmware, its value has to be updated.