Hi all,
I have a problem with the function "System Power Down", parameter "Sleep" and wake up via sci4 interrupt.
Short background:
I have a 100ms task, this is activated via RTI and in this task I call the function "System Power Down" after 5sec only to see if my wake up is working.
The problem of the wake up is sometimes it is working and sometimes not. It is a 50% chance that it is working or not.
It is possible to get access via Debugger if it the system is not wake up and I implemented some debug variables before calling "System Power Down" to see what going on.
So here is my Debug code:
/* Debug */
DebugIRQINDEX = vimREG->IRQINDEX;
DebugFIQINDEX = vimREG->FIQINDEX;
DebugFIRQPR0 = vimREG->FIRQPR0;
DebugFIRQPR1 = vimREG->FIRQPR1;
DebugFIRQPR2 = vimREG->FIRQPR2;
DebugFIRQPR3 = vimREG->FIRQPR3;
DebugINTREQ0 = vimREG->INTREQ0;
DebugINTREQ1 = vimREG->INTREQ1;
DebugINTREQ2 = vimREG->INTREQ2;
DebugINTREQ3 = vimREG->INTREQ3;
systemPowerDown(SYS_SLEEP_MODE); <--------------- calling Systen Power Down
Now the following szenario:
- restart system via power off / on
- the software is calling "System Power Down" after 5 sec. and it is not possible to get access via sci4
- I start the Debugger, the debugger stops in "prefetchEntry"
- I looked at my debug variables
DebugIRQINDEX, value is 0x0000 0000
DebugFIQINDEX, value is 0x0000 0000
DebugFIRQPR0, value is 0x0000 0003
DebugFIRQPR1, value is 0x0000 0000
DebugFIRQPR2, value is 0x0000 0000
DebugFIRQPR3, value is 0x0000 0000
DebugINTREQ0, value is 0x0100 0000
DebugINTREQ1, value is 0x0000 0000
DebugINTREQ2, value is 0x0000 0000
DebugINTREQ3, value is 0x0000 0000
the debug variables before calling "System Power Down" are looking good, but if I looked at the corresponding register via debugger (Debugger stops in prefetchEntry) I see:
IrqIVec, value is 0x0000 0078 <- ???
FiqIVec, value is 0x0000 0001 <- ???
FIrqPr0, value is 0x0000 0003
FIrqPr1, value is 0x0000 0000
FIrqPr2, value is 0x0000 0000
FIrqPr3, value is 0x0000 0000
IntReq0, value is 0x0100 0001 <- ???
IntReq1, value is 0x0000 0000
IntReq2, value is 0x0000 0000
IntReq3, value is 0x0080 0000 ok, this is my sciLowLevelInterrupt (channel 119) and it is pending
What I do not undestand is:
- why it is sometimes wortking and sometime not, it is like a random function. If it is running the values of the debug variables are equal to the register values. That's how it should always be.
- the register differences before and after calling "System Power Down" if it is not running
- the IrqIVec0 = 0x0000 0078, this means the interrupt channel 125 is activated. But it is a reserved interrupt and it is definedly not enabled in my HalCoGen Project. What kind of interrupt is this ? I do not find any documentation.
- FiqIVec = 0x0000 0001, this means "esmHighInterrupt". How can I generate this interrupt.
Many thanks in advance and happy X-mas.
Best regards
Lars