Hello Community,
I would like to get wakeup source causing exit from Standby mode.
For example, I configured WKPU0, WKPU1 and WKPU2 (Wakeup input) for wakeup sources to exit from standby mode and enabled rising edge detection for all wakeup sources.
If I make the S32G2 enter standby mode and WKPU1 HIGH, then I want to get the wakeup source as WKPU1 on the application after exit from standby.
Is there any register or API to get the wakeup source easily?
Thanks,
Harry
Solved! Go to Solution.
Hello Harry,
I’ve tested on my side, and there is no such issue.
I set 3 wakeup sources as WKUP0, 1, 2 (MSCR43, 146, 148) and enables those by WRER.
I tried to wake up by WKUP0, and successfully waked up and the WISR value was only source 0 like below.
Please refer to below register setting that I tested with.
WKPU_WIFER = 0;
WKPU_WBMSR = 0x00000007;
WKPU_IRER = 0x0;
WKPU_WRER = 0x0;
SIUL2_0.MSCR[43].B.PUE = 1;
SIUL2_0.MSCR[43].B.PUS = 1;
SIUL2_0.MSCR[43].B.IBE = 1;
SIUL2_1.MSCR[146].B.PUE = 1;
SIUL2_1.MSCR[146].B.PUS = 1;
SIUL2_1.MSCR[146].B.IBE = 1;
SIUL2_1.MSCR[148].B.PUE = 1;
SIUL2_1.MSCR[148].B.PUS = 1;
SIUL2_1.MSCR[148].B.IBE = 1;
STBY_GPR.WKUP_PUS.B.WKUP_PUS |= 0x1;
WKPU_WIPUER_WIPDER = 0x1;
STBY_GPR.WKUP_PUS.B.WKUP_PU_OVERRIDE |= 0x1;
WKPU_WIFEER = 0x00000007;
WKPU_WIREER = 0x0;
WKPU_IRER = 0;
WKPU_WRER = 0x00000007;
WKPU_WISR = 0xffffffff;
Best regards,
John
Hello Harry,
If the wake-up signal occurs, the WKUP will record the event through the WISR register.
Please refer to the WISR register in S32G RM.
Best Regards,
John
Hello John,
Thank for your reply.
When I read WISR after wake up from sleep, all BITs which were configured to wakeup source are '1'.
For example, if I set WKPU1 and WKPU3 for wakeup source and go to sleep, and then both WKPU1, WKPU2 and WKPU3 bits are HIGH when read the WISR register after wake up from sleep by WKPU1.
My codes are as below:(Actually I set 5 channels for wakeup source)
for (i = 0; i < ICU_MAX_CHANNEL; i++)
{
/* Configure ICU */
Icu_EnableWakeup(i);
Icu_EnableEdgeDetection(i);
Icu_EnableNotification(i);
}
Icu_SetMode(ICU_MODE_SLEEP);
Thanks,
Harry
Hello Harry,
I’ve tested on my side, and there is no such issue.
I set 3 wakeup sources as WKUP0, 1, 2 (MSCR43, 146, 148) and enables those by WRER.
I tried to wake up by WKUP0, and successfully waked up and the WISR value was only source 0 like below.
Please refer to below register setting that I tested with.
WKPU_WIFER = 0;
WKPU_WBMSR = 0x00000007;
WKPU_IRER = 0x0;
WKPU_WRER = 0x0;
SIUL2_0.MSCR[43].B.PUE = 1;
SIUL2_0.MSCR[43].B.PUS = 1;
SIUL2_0.MSCR[43].B.IBE = 1;
SIUL2_1.MSCR[146].B.PUE = 1;
SIUL2_1.MSCR[146].B.PUS = 1;
SIUL2_1.MSCR[146].B.IBE = 1;
SIUL2_1.MSCR[148].B.PUE = 1;
SIUL2_1.MSCR[148].B.PUS = 1;
SIUL2_1.MSCR[148].B.IBE = 1;
STBY_GPR.WKUP_PUS.B.WKUP_PUS |= 0x1;
WKPU_WIPUER_WIPDER = 0x1;
STBY_GPR.WKUP_PUS.B.WKUP_PU_OVERRIDE |= 0x1;
WKPU_WIFEER = 0x00000007;
WKPU_WIREER = 0x0;
WKPU_IRER = 0;
WKPU_WRER = 0x00000007;
WKPU_WISR = 0xffffffff;
Best regards,
John
Hello John,
When I tested again, I confirmed that I could read wakeup source by following your advise.
Maybe there had been my mistake which read another register and so on.
Thanks for your support and solution.
Harry
Hello John,
Thanks for your quick and kind response.
I will check more on my side and get back you soon.
Thanks,
Harry
Does anybody have an idea for this?
Thanks,
Harry