cancel
Showing results for 
Search instead for 
Did you mean: 

STOP mode going comatose

jodonnell
Associate II
Posted on November 05, 2008 at 19:06

STOP mode going comatose

1 REPLY 1
jodonnell
Associate II
Posted on November 05, 2008 at 19:06

I am having problems with STR712s sometimes requiring a reset to get out of STOP mode. Most of the time, everything goes just fine, but if the WAKEUP line is asserted when trying to enter STOP, the processor sometimes just hangs in a low power (slightly higher power than STOP) state. I am not using wakeup interrupts and have interrupts disabled.

The Processor Reference Manual (RM0002 rev. 2) states

Quote:

Interrupt requests to the CPU are disabled: in this case the device will not enter STOP mode, no interrupt service routine will be executed and the program execution continues from the instruction following the STOP bit setting sequence. The status of STOP and STOP_I bits will be again:

STOP = 0, STOP_I = 0

The application can determine why the device did not enter STOP mode by polling the pending bits of the external lines (at least one must be at 1).

But I am getting a processor hang sometimes. Here is the relevant code

Code:

<BR> __ARMLIB_disableIRQ(); <BR> EIC->ICR = 0; // tried with and without this line <BR> <BR>_SleepNow: <BR> XTI->TRH = 0x80; // wake on rising edge <BR> XTI->TRL = 0x00; <BR> <BR> XTI->MRH = 0x80; // wake on Wakeup line only <BR> XTI->MRL = 0x00; <BR> <BR> XTI->PRH = 0x00; <BR> XTI->PRL = 0x00; <BR> XTI->SR = 0x00; // clear pending interrupts <BR> <BR> XTI->CTRL = 0x01; // turn on wakeup (no interrupt) <BR> <BR> RCCU->CFR &= ~RCCU_STOP_I; // clear the STOP interrupt flag <BR> <BR> XTI->CTRL = 0x05; // writing 1 0 1 sequence to STOP <BR> XTI->CTRL = 0x01; <BR> XTI->CTRL = 0x05; <BR> __asm(''MOV R1, R1''); <BR> __asm(''MOV R1, R1''); <BR> // 100+ more of these just to be sure <BR> __asm(''MOV R1, R1''); <BR> __asm(''MOV R1, R1''); <BR> <BR> // when the failure occurs, it does not get here <BR> // even after multiple wakeup events <BR> <BR> if ((RCCU->CFR & RCCU_STOP_I)==0) <BR> goto _SleepNow; // failed to correctly enter sleep <BR> <BR> XTI->SR = 0x00; // clear pending interrupts <BR> XTI->PRH = 0x00; <BR> XTI->PRL = 0x00; <BR> RCCU->CFR &= ~RCCU_STOP_I; // clear the STOP interrupt flag <BR> <BR> EIC->ICR = 1; <BR> __ARMLIB_enableIRQ(); <BR>

Any ideas would be appreciated.

Jon O'Donnell

[ This message was edited by: NuVo on 05-11-2008 23:39 ]