How do I get the wake source for K344

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

How do I get the wake source for K344

跳至解决方案
700 次查看
ZDDL
Contributor III

I looked at the S32K3 Low Power Management AN and demos, but those demos uses DS3.4, which I couldn't open and compile. Is there a demo of DS3.5 available?

I have a problem with low power Management. After the MCU is awakened, the reset type obtained by using Power_Ip_GetResetReason() is MCU_WAKEUP_REASON, and this is correct. But when I used Wkpu Ip GetInputState() to get the wake source, I didn't get the correct result.  I don't know why.

ZDDL_2-1732804683081.png

 

ZDDL_1-1732804624327.png

This is my test project. I hope someone could help me.

Thanks!

0 项奖励
回复
1 解答
679 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @ZDDL,

You can refer to the following examples: S32K3 Low Power Management AN and demos RTD 4.0.0 & 5.0.0 - NXP Community.

For the wakeup source, please try reading the registers directly:

uint32_t WISR_Value;
uint32_t WISR64_Value;

void WKPU_Handler(void)
{
	/*store the WISR value which indicate the wake up source.*/
	WISR_Value = IP_WKPU->WISR;
	WISR64_Value = IP_WKPU->WISR_64;
	if(MCU_WAKEUP_REASON == Power_Ip_GetResetReason())
	{
		printf("Reset reason = MCU_WAKEUP_REASON\r\n");
	}
	printf("WISR = %"PRIu32",", WISR_Value);
	printf("WISR64 = %"PRIu32".\n", WISR64_Value);
	/*Clear the flag by writing 1.*/
	IP_WKPU->WISR = 0xffffffff;
	IP_WKPU->WISR_64 = 0xffffffff;
	__asm("dsb");
	__asm("isb");
}

Best regards,
Julián

在原帖中查看解决方案

0 项奖励
回复
1 回复
680 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @ZDDL,

You can refer to the following examples: S32K3 Low Power Management AN and demos RTD 4.0.0 & 5.0.0 - NXP Community.

For the wakeup source, please try reading the registers directly:

uint32_t WISR_Value;
uint32_t WISR64_Value;

void WKPU_Handler(void)
{
	/*store the WISR value which indicate the wake up source.*/
	WISR_Value = IP_WKPU->WISR;
	WISR64_Value = IP_WKPU->WISR_64;
	if(MCU_WAKEUP_REASON == Power_Ip_GetResetReason())
	{
		printf("Reset reason = MCU_WAKEUP_REASON\r\n");
	}
	printf("WISR = %"PRIu32",", WISR_Value);
	printf("WISR64 = %"PRIu32".\n", WISR64_Value);
	/*Clear the flag by writing 1.*/
	IP_WKPU->WISR = 0xffffffff;
	IP_WKPU->WISR_64 = 0xffffffff;
	__asm("dsb");
	__asm("isb");
}

Best regards,
Julián

0 项奖励
回复