A method is provided for saving system information immediately following a
hardware or software failure that causes a processor to reset. After
failure is imminent and before the processor allows the reset to occur,
the processor is instructed to copy a fixed amount of the system stack
SRAM, in addition to any processor registers that can be used to
determine the reset cause, into a preserved area of SRAM. During the
initialization sequence, the preserved area of SRAM is tested, but not
overwritten. This allows all of the preserved SRAM data including
previous stack contents and register settings at the time of the failure
to be available for analysis.