I want to define a variable whose value can survives a reset. Is it possible?
You can write to flash and get the written values back. That does the fds library for you. There are some examples around the forum.