I have a S32K312 (with SCB FS26) software, which should detect a cold/warm powerup. Due to HW layouts, the DES /FES registers cannot be used. Therefore, a memory mapped variable in the standby ram is used, which contains a magic number in case of warm powerups and undefined values in case of cold powerups. To preserve the magic number, this memory area isn’t initialized during startup (otherwise the information would be lost). But a read access on this variable leads to a HardFault.
What is the official nxp way to detect cold/hot powerups, if DES/FES cannot be used?
What needs to be done to handle the hardfault in that way, that there is a safe return to the function, which reads the uninitialized variable, and continue code execution?