How to declare a variable which can maintain value in RAM after program reset or watchdog reset

Is there a way I can declare variable which can maintain value in RAM after program reset or watchdog reset? I am using iMX7 Yocto.

Thank you
Neeraj

A DDR content can be corrupted during reboot process. Probably you can use an OCRAM kkep some data between rests. Linux also is using OCRAM so you have to check for free space there and modify memory layout if needed.

Please take a look :

hardware.h - header file is used to provide macros for all the I/O
module physical and virtual base addresses and physical to virtual mapping macros.

mx7.h - header files for the I/O module physical addresses

pm-imx7.c - the memory map source code.

http://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm/mach-imx?h=toradex_5.4-2.3.x-imx