Unfortunately I'm still encountering problems with the stop mode. I remind you that I'm testing it on MCF52259DEMOKIT.
I set the LPICR register with ENBSTOP bit enabled and priority level = 0.
I set the LPCR register with LPMD = 11 (stop mode chosen) and STPMD = 11 (all disabled).
The way I should exit the stop mode is through an alarm interrupt from RTC.
I launch my application and the CPU enters stop mode, but the alarm can't wake it up. When I press the reset button on the board, the red reset led remains on; I have to unplug and plug USB cable to be able to restart the board.
Reading in the clock module section of the reference manual, I thought that could be a PLL problem and there could be loss of clock or loss of lock when disabling PLL.
To verify this thought I changed the STPMD field in the LPCR register according to table 10-10 of the reference manual; I tried the other three options. The board is always stuck in stop mode, but, now, when I press reset it restarts normally.
Finally I tried another low-power mode, wait mode, and it works fine; the alarm I set can wake the CPU up from the wait mode.
Where is the problem?
Thanks,
Marco.