How do I get the wake source for K344

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How do I get the wake source for K344

ソリューションへジャンプ
684件の閲覧回数
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 解決策
663件の閲覧回数
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 返信
664件の閲覧回数
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 件の賞賛
返信