Are you sure that the reset status information is being requested from the correct module in the device?
Older devices may have the information in the MC block and newer ones (revision 2) in the RCM. When using the incorrect one there are strange results because the access is to a different peripheral block.
Here is the reset detection code from the uTasker project (based on RCM_SRS0 or MC_SRSH according to the part that it is running on). The typical reset causes (commanded, reset pin, watchdog, POR) are all accurately recognised.
// Determine the cause of the last reset
//
extern unsigned char fnAddResetCause(CHAR *ptrBuffer)
{
static const CHAR cJtag[] = "JTAG";
static const CHAR cLockup[] = "Lockup";
static const CHAR cSoftwareReset[] = "Software";
static const CHAR cPowerOn[] = "Power-on";
static const CHAR cUndervoltage[] = "Undervoltage";
static const CHAR cWakeup[] = "Wakeup reset";
static const CHAR cWakeupOther[] = "Wakeup";
static const CHAR cResetInput[] = "External";
static const CHAR cWatchdog[] = "WDOG";
static const CHAR cClockLoss[] = "Clock loss";
static const CHAR cUnknown[] = "???";
const CHAR *ptrStr;
#if defined KINETIS_K_FPU || defined KINETIS_KL || defined KINETIS_REVISION_2 || (KINETIS_MAX_SPEED > 100000000) // {7}
static const CHAR cHostDebug[] = "Host debugger";
static const CHAR cEZPORT[] = "EZPORT";
static const CHAR cPerFailure[] = "peripheral failure";
static const CHAR cTamper[] = "tamper";
if (RCM_SRS0 & RCM_SRS0_POR) { // power on reset
ptrStr = cPowerOn;
}
else if (RCM_SRS0 & RCM_SRS0_LVD) { // low voltage detector
ptrStr = cUndervoltage;
}
else if (RCM_SRS0 & RCM_SRS0_LOC) { // loss of external clock
ptrStr = cClockLoss;
}
else if (RCM_SRS0 & RCM_SRS0_WDOG) { // watchdog
ptrStr = cWatchdog;
}
else if (RCM_SRS0 & RCM_SRS0_WAKEUP) {
if (RCM_SRS0 & RCM_SRS0_PIN) {
ptrStr = cWakeup; // wakeup via reset pin
}
else {
ptrStr = cWakeupOther; // wakeup from other source
}
}
else if (RCM_SRS0 & RCM_SRS0_PIN) { // reset pin
ptrStr = cResetInput;
}
else if (RCM_SRS1 & RCM_SRS1_JTAG) { // jtag
ptrStr = cJtag;
}
else if (RCM_SRS1 & RCM_SRS1_LOCKUP) { // core lockup
ptrStr = cLockup;
}
else if (RCM_SRS1 & RCM_SRS1_SW) { // software reset
ptrStr = cSoftwareReset;
}
else if (RCM_SRS1 & RCM_SRS1_MDM_AP) { // host debugger
ptrStr = cHostDebug;
}
else if (RCM_SRS1 & RCM_SRS1_EZPT) { // EZPORT reset
ptrStr = cEZPORT;
}
else if (RCM_SRS1 & RCM_SRS1_SACKERR) { // peripheral failed to acknowledge attempt to enter stop mode
ptrStr = cPerFailure;
}
else if (RCM_SRS1 & RCM_SRS1_TAMPER) { // tamper detect
ptrStr = cTamper;
}
else { // unexpected
ptrStr = cUnknown;
}
#else
if (MC_SRSH & MC_SRSH_JTAG) { // jtag reset
ptrStr = cJtag;
}
else if (MC_SRSH & MC_SRSH_LOCKUP) { // lockup reset
ptrStr = cLockup;
}
else if (MC_SRSH & MC_SRSH_SW) { // software reset
ptrStr = cSoftwareReset;
}
else if (MC_SRSL == (MC_SRSL_POR | MC_SRSL_LVD)) { // power on reset
ptrStr = cPowerOn;
}
else if (MC_SRSL == MC_SRSL_LVD) { // low voltage detect reset
ptrStr = cUndervoltage;
}
else if (MC_SRSL == (MC_SRSL_PIN | MC_SRSL_WAKEUP)) { // low leakage wakeup reset due to reset pin
ptrStr = cWakeup;
}
else if (MC_SRSL == MC_SRSL_WAKEUP) { // low voltage wakeup due to other source
ptrStr = cWakeupOther;
}
else if (MC_SRSL & MC_SRSL_PIN) { // reset input
ptrStr = cResetInput;
}
else if (MC_SRSL & MC_SRSL_COP) { // watchdog reset
ptrStr = cWatchdog;
}
else if (MC_SRSL & MC_SRSL_LOC) { // clock-loss
ptrStr = cClockLoss;
}
else { // unexpected
ptrStr = cUnknown;
}
#endif
if (ptrBuffer == 0) { // {8}
fnDebugMsg((CHAR *)ptrStr);
return 0;
}
return (uStrcpy(ptrBuffer, ptrStr) - ptrBuffer); // return the length of the string
}