Getting wakeup source causing exit from Standby mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Getting wakeup source causing exit from Standby mode

跳至解决方案
4,552 次查看
harry_choi
Contributor IV

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

0 项奖励
回复
1 解答
4,494 次查看
johnyoo
NXP Employee
NXP Employee

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.

johnyoo_1-1657088352963.png

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

在原帖中查看解决方案

0 项奖励
回复
8 回复数
4,263 次查看
fxn
Contributor II

Hi Harry and John,

I am testing S32G2 M7 with entrying standby mode and wakeup.

I followed register setting, but still can't wakeup.

Do you have any idea about this?

 

Thanks,

fxn

0 项奖励
回复
4,506 次查看
johnyoo
NXP Employee
NXP Employee

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.

 johnyoo_0-1657073435741.png

 

Best Regards,

John

 

0 项奖励
回复
4,504 次查看
harry_choi
Contributor IV

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

0 项奖励
回复
4,495 次查看
johnyoo
NXP Employee
NXP Employee

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.

johnyoo_1-1657088352963.png

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

0 项奖励
回复
4,474 次查看
harry_choi
Contributor IV

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

0 项奖励
回复
3,643 次查看
jian72
Contributor I

Hello Harry,

I had the same problem with S32K312, set the external wake source to rise edge trigger, everything was fine, but set to fall edge trigger, all the WISR set as the wake source corresponding bit was set to 1, that is, all wake sources triggered the wake. I can confirm that there is no problem with the register I read. May I ask if you have solved this problem

Thanks for your support and solution.

Jian

0 项奖励
回复
4,489 次查看
harry_choi
Contributor IV

Hello John,

Thanks for your quick and kind response.

I will check more on my side and get back you soon.

Thanks,

Harry

0 项奖励
回复
4,542 次查看
harry_choi
Contributor IV

Does anybody have an idea for this?

Thanks,

Harry

0 项奖励
回复